[DTrace-devel] [PATCH 15/61] test: Make tst.clearlquantize.d more discriminating
eugene.loh at oracle.com
eugene.loh at oracle.com
Fri Jul 8 14:44:59 UTC 2022
From: Eugene Loh <eugene.loh at oracle.com>
This test exercises both aggregation keys and the clear() action.
It has a .r.p postprocessing script that makes it insensitive to
whether clear() actually works.
Remove the .r.p file to simplify the test and make it more stringent.
Signed-off-by: Eugene Loh <eugene.loh at oracle.com>
---
test/unittest/aggs/tst.clearlquantize.r | 95 ++++++++++++++++++++++-
test/unittest/aggs/tst.clearlquantize.r.p | 33 --------
2 files changed, 94 insertions(+), 34 deletions(-)
delete mode 100755 test/unittest/aggs/tst.clearlquantize.r.p
diff --git a/test/unittest/aggs/tst.clearlquantize.r b/test/unittest/aggs/tst.clearlquantize.r
index e89ec6b5..5a1eb792 100644
--- a/test/unittest/aggs/tst.clearlquantize.r
+++ b/test/unittest/aggs/tst.clearlquantize.r
@@ -1 +1,94 @@
-All populated as expected.
+ linear
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 |@@@@@@@@ 1
+ 2 |@@@@@@@@ 1
+ 3 |@@@@@@@@ 1
+ 4 |@@@@@@@@ 1
+ 5 |@@@@@@@@ 1
+ 6 | 0
+
+
+ exp
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 |@@@@@@@@ 1
+ 2 |@@@@@@@@@@@@@@@@ 2
+ 4 |@@@@@@@@@@@@@@@@ 2
+ 8 | 0
+
+
+ linear
+ value ------------- Distribution ------------- count
+ 5 | 0
+ 6 |@@@@@@@@ 1
+ 7 |@@@@@@@@ 1
+ 8 |@@@@@@@@ 1
+ 9 |@@@@@@@@ 1
+ 10 |@@@@@@@@ 1
+ 11 | 0
+
+
+ exp
+ value ------------- Distribution ------------- count
+ 2 | 0
+ 4 |@@@@@@@@@@@@@@@@ 2
+ 8 |@@@@@@@@@@@@@@@@@@@@@@@@ 3
+ 16 | 0
+
+
+ linear
+ value ------------- Distribution ------------- count
+ 10 | 0
+ 11 |@@@@@@@@ 1
+ 12 |@@@@@@@@ 1
+ 13 |@@@@@@@@ 1
+ 14 |@@@@@@@@ 1
+ 15 |@@@@@@@@ 1
+ 16 | 0
+
+
+ exp
+ value ------------- Distribution ------------- count
+ 4 | 0
+ 8 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 5
+ 16 | 0
+
+
+ linear
+ value ------------- Distribution ------------- count
+ 15 | 0
+ 16 |@@@@@@@@ 1
+ 17 |@@@@@@@@ 1
+ 18 |@@@@@@@@ 1
+ 19 |@@@@@@@@ 1
+ 20 |@@@@@@@@ 1
+ 21 | 0
+
+
+ exp
+ value ------------- Distribution ------------- count
+ 8 | 0
+ 16 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 5
+ 32 | 0
+
+
+ linear
+ value ------------- Distribution ------------- count
+ 20 | 0
+ 21 |@@@@@@@@ 1
+ 22 |@@@@@@@@ 1
+ 23 |@@@@@@@@ 1
+ 24 |@@@@@@@@ 1
+ 25 |@@@@@@@@ 1
+ 26 | 0
+
+
+ exp
+ value ------------- Distribution ------------- count
+ 8 | 0
+ 16 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 5
+ 32 | 0
+
+
+
diff --git a/test/unittest/aggs/tst.clearlquantize.r.p b/test/unittest/aggs/tst.clearlquantize.r.p
deleted file mode 100755
index 02567c53..00000000
--- a/test/unittest/aggs/tst.clearlquantize.r.p
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/usr/bin/gawk -f
-# Oracle Linux DTrace.
-# Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
-# Licensed under the Universal Permissive License v 1.0 as shown at
-# http://oss.oracle.com/licenses/upl.
-# Check that all the graphs printed have at least one nonzero element.
-
-BEGIN {
- fail = 0;
- seenat = 0;
- active = 0;
-}
-
-/value /,/^$/ { active = 1; }
-
-/^$/ {
- if (active && !seenat) {
- printf("Unexpectedly empty result seen.\n");
- fail = 1;
- }
-
- active = 0;
-}
-
-/@/ {
- if (active)
- seenat = 1;
-}
-
-END {
- if (!fail)
- printf "All populated as expected.\n";
-}
--
2.18.4
More information about the DTrace-devel
mailing list