[DTrace-devel] [PATCH 25/61] test: check goodkey results
eugene.loh at oracle.com
eugene.loh at oracle.com
Fri Jul 8 14:45:09 UTC 2022
From: Eugene Loh <eugene.loh at oracle.com>
This test was failing due to lack of support for aggregation keys.
The test was tagged XFAIL.
Support for aggregation keys would cause the test to XPASS.
Unfortunately, the crucial probe action does not even execute since it
depends on vtimestamp, which is not yet implemented. The XPASS would
be spurious since results were simply not being checked.
Add .r and .r.p files for a sanity check on results.
Signed-off-by: Eugene Loh <eugene.loh at oracle.com>
---
test/unittest/aggs/tst.goodkey.r | 5 +++++
test/unittest/aggs/tst.goodkey.r.p | 24 ++++++++++++++++++++++++
2 files changed, 29 insertions(+)
create mode 100644 test/unittest/aggs/tst.goodkey.r
create mode 100755 test/unittest/aggs/tst.goodkey.r.p
diff --git a/test/unittest/aggs/tst.goodkey.r b/test/unittest/aggs/tst.goodkey.r
new file mode 100644
index 00000000..ba9fb3a8
--- /dev/null
+++ b/test/unittest/aggs/tst.goodkey.r
@@ -0,0 +1,5 @@
+number number number number number
+number number number number number
+number number number number number
+number number number number number
+number number number number number
diff --git a/test/unittest/aggs/tst.goodkey.r.p b/test/unittest/aggs/tst.goodkey.r.p
new file mode 100755
index 00000000..3093029b
--- /dev/null
+++ b/test/unittest/aggs/tst.goodkey.r.p
@@ -0,0 +1,24 @@
+#!/usr/bin/gawk -f
+
+# skip blank lines
+NF == 0 { next; }
+
+# expect every line to have 7 fields
+NF != 7 { exit(1); }
+
+{
+ # check last column
+ # (We expect the five probe firings to have different
+ # aggregation keys since at least vtimestamp is likely
+ # to vary among them.)
+ if ($7 != 1) { print "last column expected to be 1";
+ exit(1);
+ }
+
+ # we do not care what the other numbers are
+ gsub(/ -?[0-9]+ /, " number ");
+
+ # ignore the first column (which can be anything)
+ # ignore the last column (which we already checked)
+ print $2, $3, $4, $5, $6;
+}
--
2.18.4
More information about the DTrace-devel
mailing list