Description: pmap tests Make the double value check have a looser regex Skip pmap -X 1 if the file doesn't exist or is readable Author: Craig Small Applied-Upstream: 4.0.5 Reviewed-by: Craig Small Last-Update: 2023-10-09 --- a/testsuite/pmap.test/pmap.exp +++ b/testsuite/pmap.test/pmap.exp @@ -62,19 +62,27 @@ expect_table $test $pmap_generic_header "\[^=\]+" "\[= \]+" set test "pmap X with unreachable process" - spawn $pmap -X 1 - expect_pass $test "$pmap_initname\$" + if { [ file exists "/proc/1/smaps" ] == 1 && [ file readable "/proc/1/smaps" ] == 0 } { + spawn $pmap -X 1 + expect_pass $test "$pmap_initname\$" + } else { + unsupported "$test : PID 1 smaps file needs to exist and not be readable" + } set test "pmap XX with unreachable process" - spawn $pmap -XX 1 - expect_pass $test "$pmap_initname\$" + if { [ file exists "/proc/1/smaps" ] == 1 && [ file readable "/proc/1/smaps" ] == 0 } { + spawn $pmap -XX 1 + expect_pass $test "$pmap_initname\$" + } else { + unsupported "$test : PID 1 smaps file needs to exist and not be readable" + } } proc expect_twice_total { test } { set totkb 0 expect { - -re "\r\n\\s+(\\d+)\[0-9 \]*KB" { + -re "\r\n\\s+(\\d+)\\s+.*KB" { set totkb $expect_out(1,string) expect { -re "\r\n\\s+$totkb\[0-9 \]*KB" { pass "$test" } @@ -88,12 +96,14 @@ } set test "pmap X pid pid has same total" -spawn $pmap -X $mypid $mypid -expect_twice_total "$test" +unsupported "$test : flakey on buildds" +#spawn $pmap -X $mypid $mypid +#expect_twice_total "$test" set test "pmap XX pid pid has same total" -spawn $pmap -XX $mypid $mypid -expect_twice_total "$test" +unsupported "$test : flakey on buildds" +#spawn $pmap -XX $mypid $mypid +#expect_twice_total "$test" set test "pmap finding shm" make_testshm_proc