tests/functional: Remove sleep workarounds from sh4 test
PATCH 1/1 tests/functional: Remove sleep workarounds from sh4 test
These were introduced in the avocado tests to workaround read issues when interacting with console. They are no longer necessary and we can use the expected login string instead.
--- tests/functional/test_sh4_tuxrun.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
tests/functional/test_sh4_tuxrun.py +3 -5
@@ -15,7 +15,7 @@ import time from unittest import skipUnless -from qemu_test import Asset, exec_command_and_wait_for_pattern, exec_command +from qemu_test import Asset, exec_command_and_wait_for_pattern from qemu_test.tuxruntest import TuxRunBaselineTest class TuxRunSh4Test(TuxRunBaselineTest):
@@ -46,10 +46,8 @@ def test_sh4(self): console_index=1) self.vm.launch() - self.wait_for_console_pattern("Welcome to TuxTest") - time.sleep(0.1) - exec_command(self, 'root') - time.sleep(0.1) + self.wait_for_console_pattern("tuxtest login:") + exec_command_and_wait_for_pattern(self, 'root', 'root@tuxtest:~#') exec_command_and_wait_for_pattern(self, 'halt', "reboot: System halted")
Signature · 1 line
2.47.0
Quoted 24 lines · Cédric Le Goater
These were introduced in the avocado tests to workaround read issues when interacting with console. They are no longer necessary and we can use the expected login string instead.
Signed-off-by Cédric Le Goater <[email protected]>--- tests/functional/test_sh4_tuxrun.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)tests/functional/test_sh4_tuxrun.py +1
-1@@ -15,7 +15,7 @@ import time from unittest import skipUnless -from qemu_test import Asset, exec_command_and_wait_for_pattern, exec_command +from qemu_test import Asset, exec_command_and_wait_for_pattern from qemu_test.tuxruntest import TuxRunBaselineTest class TuxRunSh4Test(TuxRunBaselineTest):@@ -46,10 +46,8 @@ def test_sh4(self): console_index=1)
tests/functional/test_sh4_tuxrun.py def test_sh4(self): · line 52
Quoted 10 lines
tests/functional/test_sh4_tuxrun.py +2
-4self.vm.launch() - self.wait_for_console_pattern("Welcome to TuxTest") - time.sleep(0.1) - exec_command(self, 'root') - time.sleep(0.1) + self.wait_for_console_pattern("tuxtest login:") + exec_command_and_wait_for_pattern(self, 'root', 'root@tuxtest:~#') exec_command_and_wait_for_pattern(self, 'halt', "reboot: System halted")
Could we also remove the @skipUnless(os.getenv('QEMU_TEST_FLAKY_TESTS')...) now?
Thomas
Quoted 35 lines · Thomas Huth
Quoted 21 lines · Cédric Le Goater
These were introduced in the avocado tests to workaround read issues when interacting with console. They are no longer necessary and we can use the expected login string instead.
Signed-off-by Cédric Le Goater <[email protected]>---
tests/functional/test_sh4_tuxrun.py| 8 +++-----1 file changed, 3 insertions(+), 5 deletions(-)tests/functional/test_sh4_tuxrun.py +0
-0@@ -15,7 +15,7 @@import time
from unittest import skipUnlesstests/functional/test_sh4_tuxrun.py +1
-1-from qemu_test import Asset, exec_command_and_wait_for_pattern, exec_command +from qemu_test import Asset, exec_command_and_wait_for_patternfrom qemu_test.tuxruntest import TuxRunBaselineTest class TuxRunSh4Test(TuxRunBaselineTest):
tests/functional/test_sh4_tuxrun.py def test_sh4(self): · line 51
Quoted 10 lines
tests/functional/test_sh4_tuxrun.py +2
-4@@ -46,10 +46,8 @@ def test_sh4(self): console_index=1) self.vm.launch() - self.wait_for_console_pattern("Welcome to TuxTest") - time.sleep(0.1) - exec_command(self, 'root') - time.sleep(0.1) + self.wait_for_console_pattern("tuxtest login:") + exec_command_and_wait_for_pattern(self, 'root', 'root@tuxtest:~#') exec_command_and_wait_for_pattern(self, 'halt', "reboot: System halted")Could we also remove the @skipUnless(os.getenv('QEMU_TEST_FLAKY_TESTS')...) now?
Quoted 2 lines
Thomas
I didn't because of this comment :
# Note: some segfaults caused by unaligned userspace access
It does not reproduce on my systems though.
C.
Quoted 38 lines · Cédric Le Goater
Quoted 37 lines · Thomas Huth
Quoted 22 lines · Cédric Le Goater
These were introduced in the avocado tests to workaround read issues when interacting with console. They are no longer necessary and we can use the expected login string instead.
Signed-off-by Cédric Le Goater <[email protected]>---
tests/functional/test_sh4_tuxrun.py| 8 +++-----1 file changed, 3 insertions(+), 5 deletions(-)tests/functional/test_sh4_tuxrun.py +0
-0@@ -15,7 +15,7 @@import time
from unittest import skipUnless
-fromqemu_testimport Asset,exec_command_and_wait_for_pattern,exec_command
+fromqemu_testimport Asset,exec_command_and_wait_for_patternfrom qemu_test.tuxruntest import TuxRunBaselineTest class TuxRunSh4Test(TuxRunBaselineTest):tests/functional/test_sh4_tuxrun.py def test_sh4(self): · line 51
Quoted 10 lines
tests/functional/test_sh4_tuxrun.py +2
-4@@ -46,10 +46,8 @@ def test_sh4(self): console_index=1) self.vm.launch() - self.wait_for_console_pattern("Welcome to TuxTest") - time.sleep(0.1) - exec_command(self, 'root') - time.sleep(0.1) + self.wait_for_console_pattern("tuxtest login:") + exec_command_and_wait_for_pattern(self, 'root', 'root@tuxtest:~#') exec_command_and_wait_for_pattern(self, 'halt', "reboot: System halted")Could we also remove the @skipUnless(os.getenv('QEMU_TEST_FLAKY_TESTS')...) now?
Quoted 8 lines
Quoted 2 lines
Thomas
I didn't because of this comment :
# Note: some segfaults caused by unaligned userspace access
It does not reproduce on my systems though.
I also cannot reproduce the problem anymore here ... so maybe we should give it a try and remove the skipUnless now?
Thomas