Sfoglia il codice sorgente

support/testing: fix TestInitSystemNone for non-login shell

This test started failing at commit
0cad947b964be5612a182413da136fcf0dc5a1f2
"support/testing/infra/emulator.py: fix qemu prompt detection" with the
error message

  AttributeError: 'NoneType' object has no attribute 'run_command'

This is because we changed emulator.run() so that emulator.login() must
be called first. But this test skips the login and goes directly to a
shell. Use the new emulator.connect_shell() function which prepares the
shell without logging in.

Signed-off-by: Brandon Maier <brandon.maier@collins.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Brandon Maier 1 anno fa
parent
commit
5ed1fab018
1 ha cambiato i file con 2 aggiunte e 4 eliminazioni
  1. 2 4
      support/testing/tests/init/test_none.py

+ 2 - 4
support/testing/tests/init/test_none.py

@@ -18,10 +18,8 @@ class TestInitSystemNone(InitSystemBase):
         if index != 0:
             self.emulator.logfile.write("==> System does not boot")
             raise SystemError("System does not boot")
-        index = self.emulator.qemu.expect(["#", pexpect.TIMEOUT], timeout=60)
-        if index != 0:
-            self.emulator.logfile.write("==> System does not boot")
-            raise SystemError("System does not boot")
+
+        self.emulator.connect_shell()
 
         out, exit_code = self.emulator.run("sh -c 'echo $PPID'")
         self.assertEqual(exit_code, 0)