public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] [gdb/testsuite] Fix gdb.server/ext-run.exp in container
@ 2023-09-26 13:40 Tom de Vries
  2023-09-26 13:56 ` Tom Tromey
  0 siblings, 1 reply; 2+ messages in thread
From: Tom de Vries @ 2023-09-26 13:40 UTC (permalink / raw)
  To: gdb-patches

When running the gdb testsuite inside a container, I run into:
...
(gdb) gdb_expect_list pattern: /1 +root +[/a-z]*(init|systemd)/
FAIL: gdb.server/ext-run.exp: get process list (pattern 2)
...
because there's no process with pid 1 and cmd init or systemd.

In the host system (where the test passes), I have:
...
$ ps -f 1
UID        PID  PPID  C STIME TTY      STAT   TIME CMD
root         1     0  0 Sep25 ?        Ss     0:03 /usr/lib/systemd/systemd ...
...
but in the container instead:
...
UID        PID  PPID  C STIME TTY      STAT   TIME CMD
root         1     0  0 11:45 pts/0    Ss     0:00 /bin/bash
...

Fix this by also accepting bash as a valid cmd.

Tested on x86_64-linux.
---
 gdb/testsuite/gdb.server/ext-run.exp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.server/ext-run.exp b/gdb/testsuite/gdb.server/ext-run.exp
index 59ead666d7b..269158cd5b8 100644
--- a/gdb/testsuite/gdb.server/ext-run.exp
+++ b/gdb/testsuite/gdb.server/ext-run.exp
@@ -59,7 +59,7 @@ if { [istarget *-*-linux*] } {
 	# This is done in a way to avoid the timeout that can occur from
 	# applying .* regexp to large output.
 	gdb_test_sequence "info os processes" "get process list" \
-	    { "pid +user +command" "1 +root +\[/a-z\]*(init|systemd)" }
+	    { "pid +user +command" "1 +root +\[/a-z\]*(init|systemd|bash)" }
     }
 }
 

base-commit: d5fa6e8c6cb82b03f20dd521f70dcc7fefe573dc
-- 
2.35.3


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] [gdb/testsuite] Fix gdb.server/ext-run.exp in container
  2023-09-26 13:40 [PATCH] [gdb/testsuite] Fix gdb.server/ext-run.exp in container Tom de Vries
@ 2023-09-26 13:56 ` Tom Tromey
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Tromey @ 2023-09-26 13:56 UTC (permalink / raw)
  To: Tom de Vries via Gdb-patches; +Cc: Tom de Vries

>>>>> "Tom" == Tom de Vries via Gdb-patches <gdb-patches@sourceware.org> writes:

Tom> When running the gdb testsuite inside a container, I run into:
Tom> ...
Tom> (gdb) gdb_expect_list pattern: /1 +root +[/a-z]*(init|systemd)/
Tom> FAIL: gdb.server/ext-run.exp: get process list (pattern 2)
Tom> ...
Tom> because there's no process with pid 1 and cmd init or systemd.

...
Tom> Fix this by also accepting bash as a valid cmd.

This seems totally fine to me, since IIUC the precise image here doesn't
matter at all to the test.

Approved-By: Tom Tromey <tom@tromey.com>

Tom

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-09-26 13:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-26 13:40 [PATCH] [gdb/testsuite] Fix gdb.server/ext-run.exp in container Tom de Vries
2023-09-26 13:56 ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).