[Avocado-devel] leave VMs running question

Lukáš Doktor ldoktor at redhat.com
Mon Feb 8 11:56:20 UTC 2016


Hello Andrei,

we already discussed this over IRC, so let's summarize it here.

Currently there is no way to keep the VM running after the job finishes. 
This is because we store the environment (VMs) in temporary location, 
which get's removed after the job execution. I added card to discuss 
possibilities to do that on our next meeting:

 
https://trello.com/c/zd3BSHCF/575-rfc-add-api-to-interrupt-execution-on-predefined-places-for-debugging-purposes

For now your options are:

1. Use python debugger to interrupt the test
    - requires modifying the test/framework code
    + gives you possibility to interact with the machine
    + easy to set the breakpoint only when test fails (eg. 
env_postprocess:L1154)
    * it's my favored way, I use Eclipse's pydevd (import pydevd; 
pydevd.settrace("127.0.0.1", True, True) )

2. Use dummy test which just sleeps (eg. sleeptest with long time)
    - you have to add this test after the test you want to debug
    - you have to set "keep_guest_running = yes" in settings
    + does not require any code changes

3. You can SIGSTOP the PID of the avocado-vt thread
    - it's not the pid of the avocado UI
    + it's quite simple to do

Recently I sent a PR to finally add support SIGSTOP forwarding on 
SIGTSTP (ctrl+z) to avocado UI:

     https://github.com/avocado-framework/avocado/pull/1003

when it's merged the situation could be simpler. Anyway I still hope to 
add support for optional breakpoints (viz the trello link)

Last but not least, I'd like to mention that when avocado-vt test fails, 
it postprocess with "_on_error" params. By default we use "kill_vm = 
no", but "kill_vm_on_error = yes". One should always keep this in mind.

Regards,
Lukáš


Dne 4.2.2016 v 14:54 Andrei Stepanov napsal(a):
> I am sorry, I am talking about one test. I have a test that fails. I
> want to debug it as it is finish.
> I have next keys:
> 14:40:32 test             L0212 DEBUG|     kill_unresponsive_vms = yes
> 14:40:32 test             L0212 DEBUG|     kill_vm = no
> 14:40:32 test             L0212 DEBUG|     kill_vm_before_test = no
> 14:40:32 test             L0212 DEBUG|     kill_vm_gracefully = yes
> 14:40:32 test             L0212 DEBUG|     kill_vm_on_error = no
>
>
>
>
> On Thu, Feb 4, 2016 at 2:09 PM, Olav Philipp Henschel
> <olavph at linux.vnet.ibm.com <mailto:olavph at linux.vnet.ibm.com>> wrote:
>
>     Hi,
>
>     Regarding the first question:
>     In the repo avocado-vt, file etc/avocado/conf.d/pkvm.conf:
>     # Keep guest running between tests (faster, but unsafe)
>     keep_guest_running = False
>
>     This makes the VM shutdown between every test. Set to True to keep
>     it running.
>     Also make sure your tests .cfg files don't have kill_vm_before_test
>     or kill_vm set to "yes" (default is "no"). You could use those
>     parameters to shutdown after a specific test.
>
>
>     Regards,
>     Olav P. Henschel
>
>
>     On 04-02-2016 10:49, Andrei Stepanov wrote:
>>     Hello.
>>
>>     I want somehow specify that avocado-vt test should keep running no
>>     matter what test's result is. Is it possible?
>>
>>     Currently, _any_ uncaught exception is a result to immediately
>>     shutdown VMs.
>>
>>     I want specify:
>>
>>     1) in some_test.py that it is FAIL
>>     2) provide cartesian key that VM's should keep running.
>>
>>     Using: --vt-extra-params 'kill_vm_timeout = 30000' 'kill_vm = no'
>>     doesn't help me.
>>
>>
>>     Another question.
>>
>>
>>     I want run examples from:
>>     https://github.com/avocado-framework/avocado-vt/blob/master/examples/tests/template.py#L2
>>
>>     The comment suggests:
>>
>>     # Put this file into $test_provider/tests directory and use
>>     # $ avocado run template --vt-type qemu to execute it.
>>
>>     I tried to copy this files (avocado-vt/examples/tests/*.py) to:
>>
>>     avocado-data/avocado-vt/backends/qemu/tests/
>>     or
>>     avocado-data/avocado-vt/test-providers.d/downloads/io-github-autotest-qemu/provider/
>>     or
>>     avocado-data/avocado-vt/test-providers.d/downloads/io-github-autotest-qemu/qemu/tests
>>
>>     Result is always the same:
>>     Unable to discover url(s) 'template' with loader plugins(s)
>>     'file', 'vt', 'external', try running 'avocado list -V template'
>>     to see the details.
>>
>>
>>
>>     _______________________________________________
>>     Avocado-devel mailing list
>>     Avocado-devel at redhat.com <mailto:Avocado-devel at redhat.com>
>>     https://www.redhat.com/mailman/listinfo/avocado-devel
>
>
>     _______________________________________________
>     Avocado-devel mailing list
>     Avocado-devel at redhat.com <mailto:Avocado-devel at redhat.com>
>     https://www.redhat.com/mailman/listinfo/avocado-devel
>
>
>
>
> _______________________________________________
> Avocado-devel mailing list
> Avocado-devel at redhat.com
> https://www.redhat.com/mailman/listinfo/avocado-devel
>




More information about the Avocado-devel mailing list