Skip to content

Commit ba6e654

Browse files
nickalcockkvanhees
authored andcommitted
tests: repair accidentally deleted tst.pidprobes.sh
My intent when writing the earlier tests was to have test/unittest/usdt/pidprobes.sh as a sort of shell script library called by tst.pidprobes.sh, tst.pidargs.sh and tst.pidargmap.sh. Alas, *.sh is executed as a test by runtest.sh, so pidprobes.sh was treated as a test, not a library. So rename it back to what it was called before and make sure it works when invoked directly by runtest.sh, but also let it be called by the other two tests to test other corners of this. (Also: apply some small review comments that never made it before the previous patch hit dev.) Signed-off-by: Nick Alcock <[email protected]>
1 parent 1a87c88 commit ba6e654

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

test/unittest/usdt/tst.pidargmap.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
# This test verifies that USDT and pid probes that share underlying probes
99
# do not apply arg mappings (incorrectly) to the pid probes.
1010

11-
exec $(dirname $_test)/pidprobes.sh $1 t t
11+
exec $(dirname $_test)/tst.pidprobes.sh $1 t t

test/unittest/usdt/tst.pidargs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
# This test verifies that USDT and pid probes that share underlying probes
99
# get the arguments correct for the USDT probes.
1010

11-
exec $(dirname $_test)/pidprobes.sh $1 t ""
11+
exec $(dirname $_test)/tst.pidprobes.sh $1 t ""

test/unittest/usdt/pidprobes.sh renamed to test/unittest/usdt/tst.pidprobes.sh

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,16 @@
66
# http://oss.oracle.com/licenses/upl.
77
#
88
# This test verifies various properties of USDT and pid probes sharing
9-
# underlying probes.
9+
# underlying probes. With only one argument (as called by runtest.sh),
10+
# it verifies that USDT and pid probes can share underlying probes.
11+
#
12+
# Other tests call back to this one to test arg-mapping behaviour,
13+
# verify that usdt probes actually fire when overlapped by pid probes,
14+
# etc.
1015

1116
dtrace=$1
12-
usdt=$2
13-
mapping=$3
17+
usdt=${2:-}
18+
mapping=${3:-}
1419

1520
# Set up test directory.
1621

@@ -86,7 +91,7 @@ fi
8691
# Check that the program output is 0 when the USDT probe is not enabled.
8792
# That is, the PYRAMID_ENTRY_ENABLED() is-enabled checks should not pass.
8893

89-
./main standalone > main.out
94+
./main > main.out
9095
echo "my result: 0" > main.out.expected
9196
if ! diff -q main.out main.out.expected > /dev/null; then
9297
echo '"my result"' looks wrong when not using DTrace
@@ -131,7 +136,7 @@ fi
131136
echo "my result: 10" > main.out2.expected
132137

133138
if ! diff -q main.out2 main.out2.expected > /dev/null; then
134-
echo '"my result"' looks wrong
139+
echo '"my result"' looks wrong when using DTrace
135140
echo === got ===
136141
cat main.out2
137142
echo === expected ===
@@ -297,7 +302,7 @@ if [[ -n $usdt ]]; then
297302
fi
298303
fi
299304

300-
# Sort and check (dropping any wake-up firings from deferred probing).
305+
# Sort and check.
301306

302307
sort dtrace.out > dtrace.out.sorted
303308
sort dtrace.out.expected > dtrace.out.expected.sorted

0 commit comments

Comments
 (0)