diff mbox series

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

Message ID 20210415215141.1865467-7-crosa@redhat.com
State New
Headers show
Series Tests: introduce custom jobs | expand

Commit Message

Cleber Rosa April 15, 2021, 9:51 p.m. UTC
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(-)

Comments

Willian Rampazzo April 16, 2021, 3:56 p.m. UTC | #1
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>
Wainer dos Santos Moschetta April 19, 2021, 7:07 p.m. UTC | #2
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')
diff mbox series

Patch

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')