[PATCH 6/8] Acceptance tests: prevent shutdown on non-specific target tests

Cleber Rosa posted 8 patches 4 years, 7 months ago
Maintainers: Cornelia Huck <cohuck@redhat.com>, Aurelien Jarno <aurelien@aurel32.net>, Aleksandar Rikalo <aleksandar.rikalo@syrmia.com>, "Philippe Mathieu-Daudé" <f4bug@amsat.org>, Thomas Huth <thuth@redhat.com>, Willian Rampazzo <willianr@redhat.com>, "Philippe Mathieu-Daudé" <philmd@redhat.com>, Jiaxun Yang <jiaxun.yang@flygoat.com>, Cleber Rosa <crosa@redhat.com>, "Alex Bennée" <alex.bennee@linaro.org>, Wainer dos Santos Moschetta <wainersm@redhat.com>
[PATCH 6/8] Acceptance tests: prevent shutdown on non-specific target tests
Posted by Cleber Rosa 4 years, 7 months ago
When running tests that are not target specific with various target
binaries, some specific behavior appears.  For s390x, when there's no
guest code running, it will produce GUEST_PANICKED events as the
firmware will shutdown the machine.

With this change, no GUEST_PANICKED *event* will be generated.

For some QMP commands, such as "query-migrate", a proper response
("guest-panicked" for the s390x target) will still be given.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
---
 tests/acceptance/migration.py | 4 ++--
 tests/acceptance/version.py   | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/acceptance/migration.py b/tests/acceptance/migration.py
index 25ee55f36a..b4d46becc6 100644
--- a/tests/acceptance/migration.py
+++ b/tests/acceptance/migration.py
@@ -46,12 +46,12 @@ def assert_migration(self, src_vm, dst_vm):
 
     def do_migrate(self, dest_uri, src_uri=None):
         dest_vm = self.get_vm('-incoming', dest_uri)
-        dest_vm.add_args('-nodefaults')
+        dest_vm.add_args('-nodefaults', '-no-shutdown')
         dest_vm.launch()
         if src_uri is None:
             src_uri = dest_uri
         source_vm = self.get_vm()
-        source_vm.add_args('-nodefaults')
+        source_vm.add_args('-nodefaults', '-no-shutdown')
         source_vm.launch()
         response = source_vm.qmp('migrate', uri=src_uri)
         if 'error' in response:
diff --git a/tests/acceptance/version.py b/tests/acceptance/version.py
index 79b923d4fc..3cf18c9878 100644
--- a/tests/acceptance/version.py
+++ b/tests/acceptance/version.py
@@ -17,7 +17,7 @@ class Version(Test):
     :avocado: tags=quick
     """
     def test_qmp_human_info_version(self):
-        self.vm.add_args('-nodefaults')
+        self.vm.add_args('-nodefaults', '-no-shutdown')
         self.vm.launch()
         res = self.vm.command('human-monitor-command',
                               command_line='info version')
-- 
2.25.4


Re: [PATCH 6/8] Acceptance tests: prevent shutdown on non-specific target tests
Posted by Willian Rampazzo 4 years, 7 months ago
On Thu, Apr 15, 2021 at 6:52 PM Cleber Rosa <crosa@redhat.com> wrote:
>
> When running tests that are not target specific with various target
> binaries, some specific behavior appears.  For s390x, when there's no
> guest code running, it will produce GUEST_PANICKED events as the
> firmware will shutdown the machine.
>
> With this change, no GUEST_PANICKED *event* will be generated.
>
> For some QMP commands, such as "query-migrate", a proper response
> ("guest-panicked" for the s390x target) will still be given.
>
> Signed-off-by: Cleber Rosa <crosa@redhat.com>
> ---
>  tests/acceptance/migration.py | 4 ++--
>  tests/acceptance/version.py   | 2 +-
>  2 files changed, 3 insertions(+), 3 deletions(-)
>

Reviewed-by: Willian Rampazzo <willianr@redhat.com>


Re: [PATCH 6/8] Acceptance tests: prevent shutdown on non-specific target tests
Posted by Wainer dos Santos Moschetta 4 years, 7 months ago
Hi,

On 4/15/21 6:51 PM, Cleber Rosa wrote:
> When running tests that are not target specific with various target
> binaries, some specific behavior appears.  For s390x, when there's no
> guest code running, it will produce GUEST_PANICKED events as the
> firmware will shutdown the machine.
>
> With this change, no GUEST_PANICKED *event* will be generated.
>
> For some QMP commands, such as "query-migrate", a proper response
> ("guest-panicked" for the s390x target) will still be given.
>
> Signed-off-by: Cleber Rosa <crosa@redhat.com>
> ---
>   tests/acceptance/migration.py | 4 ++--
>   tests/acceptance/version.py   | 2 +-
>   2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/tests/acceptance/migration.py b/tests/acceptance/migration.py
> index 25ee55f36a..b4d46becc6 100644
> --- a/tests/acceptance/migration.py
> +++ b/tests/acceptance/migration.py
> @@ -46,12 +46,12 @@ def assert_migration(self, src_vm, dst_vm):
>   
>       def do_migrate(self, dest_uri, src_uri=None):
>           dest_vm = self.get_vm('-incoming', dest_uri)
> -        dest_vm.add_args('-nodefaults')
> +        dest_vm.add_args('-nodefaults', '-no-shutdown')

On the other hand, can't that new argument introduce unwanted behavior 
on other targets? Maybe the argument should be set only for s390 because 
we know it prevents the test failure on that target only.

- Wainer

>           dest_vm.launch()
>           if src_uri is None:
>               src_uri = dest_uri
>           source_vm = self.get_vm()
> -        source_vm.add_args('-nodefaults')
> +        source_vm.add_args('-nodefaults', '-no-shutdown')
>           source_vm.launch()
>           response = source_vm.qmp('migrate', uri=src_uri)
>           if 'error' in response:
> diff --git a/tests/acceptance/version.py b/tests/acceptance/version.py
> index 79b923d4fc..3cf18c9878 100644
> --- a/tests/acceptance/version.py
> +++ b/tests/acceptance/version.py
> @@ -17,7 +17,7 @@ class Version(Test):
>       :avocado: tags=quick
>       """
>       def test_qmp_human_info_version(self):
> -        self.vm.add_args('-nodefaults')
> +        self.vm.add_args('-nodefaults', '-no-shutdown')
>           self.vm.launch()
>           res = self.vm.command('human-monitor-command',
>                                 command_line='info version')