Debian Codegraph @

debian/patches/pmap_test

raw
1 Description: pmap tests
2 Make the double value check have a looser regex
3 Skip pmap -X 1 if the file doesn't exist or is readable
4 Author: Craig Small <[email protected]>
5 Forwarded: https://gitlab.com/procps-ng/procps/-/commit/ea6dcd529c632d36466e9ff61be42aa4ab803c94
6 Applied-Upstream: 4.0.5
7 Reviewed-by: Craig Small <[email protected]>
8 Last-Update: 2024-10-15
9 --- a/testsuite/pmap.test/pmap.exp
10 +++ b/testsuite/pmap.test/pmap.exp
11 @@ -62,19 +62,27 @@
12 expect_table $test $pmap_generic_header "\[^=\]+" "\[= \]+"
13
14 set test "pmap X with unreachable process"
15 - spawn $pmap -X 1
16 - expect_pass $test "$pmap_initname\$"
17 + if { [ file exists "/proc/1/smaps" ] == 1 && [ file readable "/proc/1/smaps" ] == 0 } {
18 + spawn $pmap -X 1
19 + expect_pass $test "$pmap_initname\$"
20 + } else {
21 + unsupported "$test : PID 1 smaps file needs to exist and not be readable"
22 + }
23
24 set test "pmap XX with unreachable process"
25 - spawn $pmap -XX 1
26 - expect_pass $test "$pmap_initname\$"
27 + if { [ file exists "/proc/1/smaps" ] == 1 && [ file readable "/proc/1/smaps" ] == 0 } {
28 + spawn $pmap -XX 1
29 + expect_pass $test "$pmap_initname\$"
30 + } else {
31 + unsupported "$test : PID 1 smaps file needs to exist and not be readable"
32 + }
33 }
34
35
36 proc expect_twice_total { test } {
37 set totkb 0
38 expect {
39 - -re "\r\n\\s+(\\d+)\[0-9 \]*KB" {
40 + -re "\r\n\\s+(\\d+)\\s+.*KB" {
41 set totkb $expect_out(1,string)
42 expect {
43 -re "\r\n\\s+$totkb\[0-9 \]*KB" { pass "$test" }
44 @@ -88,12 +96,14 @@
45 }
46
47 set test "pmap X pid pid has same total"
48 -spawn $pmap -X $mypid $mypid
49 -expect_twice_total "$test"
50 +unsupported "$test : flakey on buildds"
51 +#spawn $pmap -X $mypid $mypid
52 +#expect_twice_total "$test"
53
54 set test "pmap XX pid pid has same total"
55 -spawn $pmap -XX $mypid $mypid
56 -expect_twice_total "$test"
57 +unsupported "$test : flakey on buildds"
58 +#spawn $pmap -XX $mypid $mypid
59 +#expect_twice_total "$test"
60
61 set test "pmap finding shm"
62 make_testshm_proc