Skip to contentSkip to conversation

support/scripts/boot-qemu-image.py: pexpect must throw an exception when a timeout occurs

PATCH New Romain Naour 3 participants 3 messages Feb 20, 2021 – Feb 27, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 support/scripts/boot-qemu-image.py: pexpect must throw an exception when a timeout occurs

As reported on IRC by sephthir, the gitlab test of the defconfig qemu_sparc_ss10_defconfig doesn't error out while the system is not working properly.

This is due to pexpect doesn't throw an exception when a timout occurs and continue to the next command.

Remove "pexpect.TIMEOUT" to get the expected behaviour.

The qemu_sparc_ss10_defconfig is already fixed by
4d16e6f5324f0285f51bfbb5a3503584f3b3ad12.

This was reported to gcc upstream:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98784

Cc Jugurtha BELKALEM <[email protected]>
---
 support/scripts/boot-qemu-image.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
support/scripts/boot-qemu-image.py +3 -3
index 4066788c88..0d4ad825fc 100755
@@ -36,7 +36,7 @@ def main():
     time.sleep(1)
 
     try:
-        child.expect(["buildroot login:", pexpect.TIMEOUT], timeout=60)
+        child.expect(["buildroot login:"], timeout=60)
     except pexpect.EOF as e:
         # Some emulations require a fork of qemu-system, which may be
         # missing on the system, and is not provided by Buildroot.
@@ -58,7 +58,7 @@ def main():
     child.sendline("root\r")
 
     try:
-        child.expect(["# ", pexpect.TIMEOUT], timeout=60)
+        child.expect(["# "], timeout=60)
     except pexpect.EOF:
         print("Cannot connect to shell")
         sys.exit(1)
@@ -69,7 +69,7 @@ def main():
     child.sendline("poweroff\r")
 
     try:
-        child.expect(["System halted", pexpect.TIMEOUT], timeout=60)
+        child.expect(["System halted"], timeout=60)
         child.expect(pexpect.EOF)
     except pexpect.EOF:
         pass
Signature · 1 line
2.29.2
#1 lore raw

PATCH 1/1 support/scripts/boot-qemu-image.py: pexpect must throw an exception when a timeout occurs

romain, All,

On 2021-02-20 17:56 +0100, Romain Naour spake thusly:

Quoted 8 lines

As reported on IRC by sephthir, the gitlab test of the defconfig qemu_sparc_ss10_defconfig doesn't error out while the system is not working properly.

This is due to pexpect doesn't throw an exception when a timout occurs and continue to the next command.

Remove "pexpect.TIMEOUT" to get the expected behaviour.

The commit log up to that point was a bit fuzzy about why that was the case, and the commit title was not very clear either, so I reworded it.

Quoted 5 lines

The qemu_sparc_ss10_defconfig is already fixed by
4d16e6f5324f0285f51bfbb5a3503584f3b3ad12.

This was reported to gcc upstream:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98784

This reference does not belong to this commit (it is about the failing defconfig itself,m not about the failure of our infra), so I dropped it.

Applied to master, thanks.

Regards,
Yann E. MORIN.

Quoted 44 lines
Cc Jugurtha BELKALEM <[email protected]>
---
 support/scripts/boot-qemu-image.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
support/scripts/boot-qemu-image.py +3 -3
index 4066788c88..0d4ad825fc 100755
@@ -36,7 +36,7 @@ def main():
     time.sleep(1)
 
     try:
-        child.expect(["buildroot login:", pexpect.TIMEOUT], timeout=60)
+        child.expect(["buildroot login:"], timeout=60)
     except pexpect.EOF as e:
         # Some emulations require a fork of qemu-system, which may be
         # missing on the system, and is not provided by Buildroot.
@@ -58,7 +58,7 @@ def main():
     child.sendline("root\r")
 
     try:
-        child.expect(["# ", pexpect.TIMEOUT], timeout=60)
+        child.expect(["# "], timeout=60)
     except pexpect.EOF:
         print("Cannot connect to shell")
         sys.exit(1)
@@ -69,7 +69,7 @@ def main():
     child.sendline("poweroff\r")
 
     try:
-        child.expect(["System halted", pexpect.TIMEOUT], timeout=60)
+        child.expect(["System halted"], timeout=60)
         child.expect(pexpect.EOF)
     except pexpect.EOF:
         pass
Signature · 6 lines
2.29.2

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#2 lore raw

PATCH 1/1 support/scripts/boot-qemu-image.py: pexpect must throw an exception when a timeout occurs

In reply to Romain Naour
Quoted 11 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Romain" == Romain Naour <[email protected]> writes:

As reported on IRC by sephthir, the gitlab test of the defconfig qemu_sparc_ss10_defconfig doesn't error out while the system is not working properly.

This is due to pexpect doesn't throw an exception when a timout occurs and continue to the next command.

Remove "pexpect.TIMEOUT" to get the expected behaviour.

Quoted 8 lines

The qemu_sparc_ss10_defconfig is already fixed by
4d16e6f5324f0285f51bfbb5a3503584f3b3ad12.

This was reported to gcc upstream:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98784

Cc Jugurtha BELKALEM <[email protected]>

Committed to 2020.11.x, thanks.

Signature · 1 line
Bye, Peter Korsgaard