| 1 |
spawn stap $srcdir/$subdir/args.stp |
| 2 |
expect { |
| 3 |
-timeout 120 |
| 4 |
"READY" { |
| 5 |
sleep 1 |
| 6 |
exec echo 1 > /proc/stap_test_cmd |
| 7 |
expect { |
| 8 |
-timeout 5 |
| 9 |
"yyy_int -1 200 300\r\nyyy_int returns 499\r\n" { |
| 10 |
pass "integer function arguments" |
| 11 |
} |
| 12 |
timeout {fail "integer function arguments"} |
| 13 |
} |
| 14 |
exec echo 2 > /proc/stap_test_cmd |
| 15 |
expect { |
| 16 |
-timeout 5 |
| 17 |
"yyy_uint 4294967295 200 300\r\nyyy_uint returns 499\r\n" { |
| 18 |
pass "unsigned function arguments" |
| 19 |
} |
| 20 |
timeout {fail "unsigned function arguments"} |
| 21 |
} |
| 22 |
exec echo 3 > /proc/stap_test_cmd |
| 23 |
expect { |
| 24 |
-timeout 5 |
| 25 |
"yyy_long -1 200 300\r\nyyy_long returns 499\r\n" { |
| 26 |
pass "long function arguments" |
| 27 |
} |
| 28 |
timeout {fail "long function arguments"} |
| 29 |
} |
| 30 |
exec echo 4 > /proc/stap_test_cmd |
| 31 |
expect { |
| 32 |
-timeout 5 |
| 33 |
"yyy_int64 -1 200 300\r\nyyy_int64 returns 499\r\n" { |
| 34 |
pass "int64 function arguments" |
| 35 |
} |
| 36 |
timeout {fail "int64 function arguments"} |
| 37 |
} |
| 38 |
exec echo 5 > /proc/stap_test_cmd |
| 39 |
expect { |
| 40 |
-timeout 5 |
| 41 |
"yyy_char a b c\r\nyyy_char returns Q\r\n" { |
| 42 |
pass "char function arguments" |
| 43 |
} |
| 44 |
timeout {fail "char function arguments"} |
| 45 |
} |
| 46 |
exec echo 6 > /proc/stap_test_cmd |
| 47 |
expect { |
| 48 |
-timeout 5 |
| 49 |
"yyy_str Hello-System-Tap\r\nyyy_str returns XYZZY\r\n" { |
| 50 |
pass "string function arguments" |
| 51 |
} |
| 52 |
timeout {fail "string function arguments"} |
| 53 |
} |
| 54 |
} |
| 55 |
timeout {fail "all args tests - timeout"} |
| 56 |
eof {fail "function arguments: unexpected timeout"} |
| 57 |
} |
| 58 |
kill -INT -[exp_pid] 2 |
| 59 |
catch { close } |
| 60 |
catch { wait } |