Automatic testing using qemu
Hi there, I have written a seL4 app using CAmkES, that I am continuously building using Jenkins. I'd like to add a test step to this continuous integration process, launching the app with qemu and parsing the output to validate my expectations. The thing is, although all the active ("control") components reach their last instruction after a while, seL4 does not "exit" (which is expected I guess) and qemu does not stop, keeping my continuous integration job running for ever. Any idea on how to achieve this? Thank you very much in advance. Cheers, Paolo Crisafulli
On Tue, May 15, 2018 at 7:43 AM, Paolo Crisafulli
Hi there,
I have written a seL4 app using CAmkES, that I am continuously building using Jenkins.
I'd like to add a test step to this continuous integration process, launching the app with qemu and parsing the output to validate my expectations.
The thing is, although all the active ("control") components reach their last instruction after a while, seL4 does not "exit" (which is expected I guess) and qemu does not stop, keeping my continuous integration job running for ever.
Any idea on how to achieve this?
Thank you very much in advance.
I'd imagine there are probably a few ways, mainly by binding the monitor to some input device, the following uses a unix socket/socat qemu-system-i386 -monitor unix:path=./monitor.io,server,nowait & # can exit whenever with echo "system_powerdown" | socat - UNIX-CONNECT:monitor.io echo "quit" | socat - UNIX-CONNECT:monitor.io
Hi Paolo,
For our internal continuous integration, we use the python pexpect[1] package to detect output/timeouts and then terminate the test. It's not perfect, but it works most of the time.
Cheers,
Anna.
[1] https://pexpect.readthedocs.io/en/stable/
________________________________________
From: Devel
Hi there,
I have written a seL4 app using CAmkES, that I am continuously building using Jenkins.
I'd like to add a test step to this continuous integration process, launching the app with qemu and parsing the output to validate my expectations.
The thing is, although all the active ("control") components reach their last instruction after a while, seL4 does not "exit" (which is expected I guess) and qemu does not stop, keeping my continuous integration job running for ever.
Any idea on how to achieve this?
Thank you very much in advance.
I'd imagine there are probably a few ways, mainly by binding the monitor to some input device, the following uses a unix socket/socat qemu-system-i386 -monitor unix:path=./monitor.io,server,nowait & # can exit whenever with echo "system_powerdown" | socat - UNIX-CONNECT:monitor.io echo "quit" | socat - UNIX-CONNECT:monitor.io _______________________________________________ Devel mailing list Devel@sel4.systems https://sel4.systems/lists/listinfo/devel
Thank you very much for your answer, I will try this too. Cheers, Paolo On 15/05/18 22:56, Anna.Lyons@data61.csiro.au wrote:
Hi Paolo,
For our internal continuous integration, we use the python pexpect[1] package to detect output/timeouts and then terminate the test. It's not perfect, but it works most of the time.
Cheers, Anna.
[1] https://pexpect.readthedocs.io/en/stable/ ________________________________________ From: Devel
on behalf of Matt Rice Sent: Wednesday, 16 May 2018 5:08 AM To: Paolo Crisafulli Cc: devel@sel4.systems Subject: Re: [seL4] Automatic testing using qemu Hi there,
I have written a seL4 app using CAmkES, that I am continuously building using Jenkins.
I'd like to add a test step to this continuous integration process, launching the app with qemu and parsing the output to validate my expectations.
The thing is, although all the active ("control") components reach their last instruction after a while, seL4 does not "exit" (which is expected I guess) and qemu does not stop, keeping my continuous integration job running for ever.
Any idea on how to achieve this?
Thank you very much in advance. I'd imagine there are probably a few ways, mainly by binding the monitor to some input device,
On Tue, May 15, 2018 at 7:43 AM, Paolo Crisafulli
wrote: the following uses a unix socket/socat qemu-system-i386 -monitor unix:path=./monitor.io,server,nowait & # can exit whenever with echo "system_powerdown" | socat - UNIX-CONNECT:monitor.io echo "quit" | socat - UNIX-CONNECT:monitor.io
_______________________________________________ Devel mailing list Devel@sel4.systems https://sel4.systems/lists/listinfo/devel
Thank you very much for your very interesting answer. Some issues: - I'm no longer getting output from my emulated app in the terminal. - After echoing "quit", the socket seems to be no longer read (further socat commands hang), but ps still lists qemu-system-arm. Is that expected? On 15/05/18 21:08, Matt Rice wrote:
Hi there,
I have written a seL4 app using CAmkES, that I am continuously building using Jenkins.
I'd like to add a test step to this continuous integration process, launching the app with qemu and parsing the output to validate my expectations.
The thing is, although all the active ("control") components reach their last instruction after a while, seL4 does not "exit" (which is expected I guess) and qemu does not stop, keeping my continuous integration job running for ever.
Any idea on how to achieve this?
Thank you very much in advance. I'd imagine there are probably a few ways, mainly by binding the monitor to some input device,
On Tue, May 15, 2018 at 7:43 AM, Paolo Crisafulli
wrote: the following uses a unix socket/socat qemu-system-i386 -monitor unix:path=./monitor.io,server,nowait & # can exit whenever with echo "system_powerdown" | socat - UNIX-CONNECT:monitor.io echo "quit" | socat - UNIX-CONNECT:monitor.io
On Thu, May 17, 2018 at 6:04 AM, Paolo Crisafulli
Thank you very much for your very interesting answer.
Some issues: - I'm no longer getting output from my emulated app in the terminal.
Hmm, I am not sure, this is not something i've used in this regard, merely knew of. I imagine you added -nographic? I'm not seeing any output either, but I imagine that is perhaps because i'm not writing anything to the serial port :)
- After echoing "quit", the socket seems to be no longer read (further socat commands hang), but ps still lists qemu-system-arm.
I don't experience this here, e.g. qemu always exits this could perhaps be because of my little snippet launching qemu in the background? e.g. try getting rid of the & and running the echo's from another terminal If that's what you already did though, i'm not sure, apologies.
Is that expected?
Not in my experience, I believe it should exit, although I see this "-no-quit" command line option, that deals with the graphical window close though so i wouldn't expect it to change this behavior
On 15/05/18 21:08, Matt Rice wrote:
On Tue, May 15, 2018 at 7:43 AM, Paolo Crisafulli
wrote: Hi there,
I have written a seL4 app using CAmkES, that I am continuously building using Jenkins.
I'd like to add a test step to this continuous integration process, launching the app with qemu and parsing the output to validate my expectations.
The thing is, although all the active ("control") components reach their last instruction after a while, seL4 does not "exit" (which is expected I guess) and qemu does not stop, keeping my continuous integration job running for ever.
Any idea on how to achieve this?
Thank you very much in advance.
I'd imagine there are probably a few ways, mainly by binding the monitor to some input device, the following uses a unix socket/socat
qemu-system-i386 -monitor unix:path=./monitor.io,server,nowait & # can exit whenever with echo "system_powerdown" | socat - UNIX-CONNECT:monitor.io echo "quit" | socat - UNIX-CONNECT:monitor.io
participants (3)
-
Anna.Lyons@data61.csiro.au
-
Matt Rice
-
Paolo Crisafulli