]> granicus.if.org Git - procps-ng/commitdiff
testsuite shmid can be hex too
authorCraig Small <csmall@dropbear.xyz>
Tue, 3 May 2022 09:37:39 +0000 (19:37 +1000)
committerCraig Small <csmall@dropbear.xyz>
Tue, 3 May 2022 09:37:39 +0000 (19:37 +1000)
Previously the match for shmid was \d+ but the variable is printed
as a hex number, updated the regex to suit.

Added some changes for pmap test so if the test_shm process fails
we just skip past it.

Signed-off-by: Craig Small <csmall@dropbear.xyz>
testsuite/config/unix.exp
testsuite/pmap.test/pmap.exp

index a43dbaebfb6d9370072af56baf881028a22b0028..2590f95b3539a285bf45140a5c23ce64e1ac0e10 100644 (file)
@@ -195,8 +195,8 @@ proc make_testshm_proc { } {
     set testshmproc_spawnid $spawn_id
     expect {
        -i $testshmproc_spawnid
-       -re "^SHMID: (\\d+)" { set shmid $expect_out(1,string) }
-       default { fail "spawning testshm" }
+       -re "^SHMID: (\[0-9a-f\]+)" { set shmid $expect_out(1,string) }
+       default { set shmid "" }
     }
 
 }
index 3b7e50efdc805ae1412deebe688fd92604fec2e2..1622cea635929591700504440cb131c5d59d3b2b 100644 (file)
@@ -68,6 +68,10 @@ expect_pass $test "$pmap_initname\$"
 
 set test "pmap finding shm"
 make_testshm_proc
-spawn $pmap $testshmproc_pid
-expect_pass $test "\[ shmid=0x$shmid \]"
+if { $shmid == "" } {
+    unsupported "$test - could not start test_shm"
+} else {
+    spawn $pmap $testshmproc_pid
+    expect_pass $test "\[ shmid=0x$shmid \]"
+}
 kill_testshm_proc