Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Brandon Maier via buildroot <buildroot@buildroot.org>
To: buildroot@buildroot.org
Cc: Brandon Maier <brandon.maier@collins.com>,
	Ricardo Martincoski <ricardo.martincoski@datacom.com.br>
Subject: [Buildroot] [PATCH 2/2] support/testing: fix TestInitSystemNone for non-login shell
Date: Mon, 15 Jul 2024 14:50:40 +0000	[thread overview]
Message-ID: <20240715-support-testing-fix-testinitsystemnone-v1-2-299145b2d342@collins.com> (raw)
In-Reply-To: <20240715-support-testing-fix-testinitsystemnone-v1-0-299145b2d342@collins.com>

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 emualtor.connect_shell() function which prepares the
shell without logging in.

Signed-off-by: Brandon Maier <brandon.maier@collins.com>
---
 support/testing/tests/init/test_none.py | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/support/testing/tests/init/test_none.py b/support/testing/tests/init/test_none.py
index fc4a46efd9..5bfcc3d5c9 100644
--- a/support/testing/tests/init/test_none.py
+++ b/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)

-- 
2.45.2

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  parent reply	other threads:[~2024-07-15 14:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-15 14:50 [Buildroot] [PATCH 0/2] support/testing: fix TestInitSystemNone for non-login shell Brandon Maier via buildroot
2024-07-15 14:50 ` [Buildroot] [PATCH 1/2] support/testing/infra/emulator.py: support init=/bin/sh Brandon Maier via buildroot
2024-07-15 14:50 ` Brandon Maier via buildroot [this message]
2024-07-22 19:51 ` [Buildroot] [PATCH 0/2] support/testing: fix TestInitSystemNone for non-login shell Thomas Petazzoni via buildroot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240715-support-testing-fix-testinitsystemnone-v1-2-299145b2d342@collins.com \
    --to=buildroot@buildroot.org \
    --cc=brandon.maier@collins.com \
    --cc=ricardo.martincoski@datacom.com.br \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox