[DTrace-devel] [PATCH] Ensure stable testing criteria for profile-n basic tests

Kris Van Hees kris.van.hees at oracle.com
Tue Sep 29 21:27:15 PDT 2020


The test/unittest/profile-n/tst.profile*.d test cases were written
to generate output that was compared with expected output.  They all
followed the same basic template:

	profile-<spec>
	{
		printf("<string>");
		exit(0);
	}

The assumption was that only a single instance of the <string> would
be seen in the output.  This assumption is based on a bug in the
exit() action implementation where any exit() action executed from any
clause *after* an initial exit() was already executed would result in
any and all trace data from that clause to be dropped.

Given that these tests merely verify that the profile-<spec> probe name
is valid and results in a successful probing session, there is no need
to output any data.  If the dtrace command completes successfully with
return code 0, the test succeeded.

Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>
---
 test/unittest/profile-n/tst.profilehz.d   | 1 -
 test/unittest/profile-n/tst.profilehz.r   | 1 -
 test/unittest/profile-n/tst.profilems.d   | 1 -
 test/unittest/profile-n/tst.profilems.r   | 1 -
 test/unittest/profile-n/tst.profilemsec.d | 1 -
 test/unittest/profile-n/tst.profilemsec.r | 1 -
 test/unittest/profile-n/tst.profilenhz.d  | 1 -
 test/unittest/profile-n/tst.profilenhz.r  | 1 -
 test/unittest/profile-n/tst.profilens.d   | 1 -
 test/unittest/profile-n/tst.profilens.r   | 1 -
 test/unittest/profile-n/tst.profilensec.d | 1 -
 test/unittest/profile-n/tst.profilensec.r | 1 -
 test/unittest/profile-n/tst.profiles.d    | 1 -
 test/unittest/profile-n/tst.profiles.r    | 1 -
 test/unittest/profile-n/tst.profilesec.d  | 1 -
 test/unittest/profile-n/tst.profilesec.r  | 1 -
 test/unittest/profile-n/tst.profileus.d   | 1 -
 test/unittest/profile-n/tst.profileus.r   | 1 -
 test/unittest/profile-n/tst.profileusec.d | 1 -
 test/unittest/profile-n/tst.profileusec.r | 1 -
 20 files changed, 20 deletions(-)
 delete mode 100644 test/unittest/profile-n/tst.profilehz.r
 delete mode 100644 test/unittest/profile-n/tst.profilems.r
 delete mode 100644 test/unittest/profile-n/tst.profilemsec.r
 delete mode 100644 test/unittest/profile-n/tst.profilenhz.r
 delete mode 100644 test/unittest/profile-n/tst.profilens.r
 delete mode 100644 test/unittest/profile-n/tst.profilensec.r
 delete mode 100644 test/unittest/profile-n/tst.profiles.r
 delete mode 100644 test/unittest/profile-n/tst.profilesec.r
 delete mode 100644 test/unittest/profile-n/tst.profileus.r
 delete mode 100644 test/unittest/profile-n/tst.profileusec.r

diff --git a/test/unittest/profile-n/tst.profilehz.d b/test/unittest/profile-n/tst.profilehz.d
index 1de623e8..72367bf2 100644
--- a/test/unittest/profile-n/tst.profilehz.d
+++ b/test/unittest/profile-n/tst.profilehz.d
@@ -20,6 +20,5 @@
 
 profile-100hz
 {
-	printf("This test is a simple profile-hz provider test");
 	exit(0);
 }
diff --git a/test/unittest/profile-n/tst.profilehz.r b/test/unittest/profile-n/tst.profilehz.r
deleted file mode 100644
index 711f635b..00000000
--- a/test/unittest/profile-n/tst.profilehz.r
+++ /dev/null
@@ -1 +0,0 @@
-This test is a simple profile-hz provider test
diff --git a/test/unittest/profile-n/tst.profilems.d b/test/unittest/profile-n/tst.profilems.d
index f0f21c9b..5b42934a 100644
--- a/test/unittest/profile-n/tst.profilems.d
+++ b/test/unittest/profile-n/tst.profilems.d
@@ -20,6 +20,5 @@
 
 profile-1ms
 {
-	printf("This test is a simple profile-ms provider test");
 	exit(0);
 }
diff --git a/test/unittest/profile-n/tst.profilems.r b/test/unittest/profile-n/tst.profilems.r
deleted file mode 100644
index 1fe17e7c..00000000
--- a/test/unittest/profile-n/tst.profilems.r
+++ /dev/null
@@ -1 +0,0 @@
-This test is a simple profile-ms provider test
diff --git a/test/unittest/profile-n/tst.profilemsec.d b/test/unittest/profile-n/tst.profilemsec.d
index 557fb6a6..8e7d03e8 100644
--- a/test/unittest/profile-n/tst.profilemsec.d
+++ b/test/unittest/profile-n/tst.profilemsec.d
@@ -20,6 +20,5 @@
 
 profile-1msec
 {
-	printf("This test is a simple profile-msec provider test");
 	exit(0);
 }
diff --git a/test/unittest/profile-n/tst.profilemsec.r b/test/unittest/profile-n/tst.profilemsec.r
deleted file mode 100644
index c3fb4a3b..00000000
--- a/test/unittest/profile-n/tst.profilemsec.r
+++ /dev/null
@@ -1 +0,0 @@
-This test is a simple profile-msec provider test
diff --git a/test/unittest/profile-n/tst.profilenhz.d b/test/unittest/profile-n/tst.profilenhz.d
index beb5a3b8..02a0c48c 100644
--- a/test/unittest/profile-n/tst.profilenhz.d
+++ b/test/unittest/profile-n/tst.profilenhz.d
@@ -20,6 +20,5 @@
 
 profile-100
 {
-	printf("This test is a simple profile implicit hz test");
 	exit(0);
 }
diff --git a/test/unittest/profile-n/tst.profilenhz.r b/test/unittest/profile-n/tst.profilenhz.r
deleted file mode 100644
index c9409ce5..00000000
--- a/test/unittest/profile-n/tst.profilenhz.r
+++ /dev/null
@@ -1 +0,0 @@
-This test is a simple profile implicit hz test
diff --git a/test/unittest/profile-n/tst.profilens.d b/test/unittest/profile-n/tst.profilens.d
index 91009f4a..fb209fe5 100644
--- a/test/unittest/profile-n/tst.profilens.d
+++ b/test/unittest/profile-n/tst.profilens.d
@@ -20,6 +20,5 @@
 
 profile-2000000000ns
 {
-	printf("This test is a simple profile-ns provider test");
 	exit(0);
 }
diff --git a/test/unittest/profile-n/tst.profilens.r b/test/unittest/profile-n/tst.profilens.r
deleted file mode 100644
index 86251d01..00000000
--- a/test/unittest/profile-n/tst.profilens.r
+++ /dev/null
@@ -1 +0,0 @@
-This test is a simple profile-ns provider test
diff --git a/test/unittest/profile-n/tst.profilensec.d b/test/unittest/profile-n/tst.profilensec.d
index e6fe7604..68baafdd 100644
--- a/test/unittest/profile-n/tst.profilensec.d
+++ b/test/unittest/profile-n/tst.profilensec.d
@@ -20,6 +20,5 @@
 
 profile-2000000000nsec
 {
-	printf("This test is a simple profile-nsec provider test");
 	exit(0);
 }
diff --git a/test/unittest/profile-n/tst.profilensec.r b/test/unittest/profile-n/tst.profilensec.r
deleted file mode 100644
index 890b769d..00000000
--- a/test/unittest/profile-n/tst.profilensec.r
+++ /dev/null
@@ -1 +0,0 @@
-This test is a simple profile-nsec provider test
diff --git a/test/unittest/profile-n/tst.profiles.d b/test/unittest/profile-n/tst.profiles.d
index af0f00db..d6824f0d 100644
--- a/test/unittest/profile-n/tst.profiles.d
+++ b/test/unittest/profile-n/tst.profiles.d
@@ -20,6 +20,5 @@
 
 profile-1s
 {
-	printf("This test is a simple profile-s provider test");
 	exit(0);
 }
diff --git a/test/unittest/profile-n/tst.profiles.r b/test/unittest/profile-n/tst.profiles.r
deleted file mode 100644
index 03a0cf22..00000000
--- a/test/unittest/profile-n/tst.profiles.r
+++ /dev/null
@@ -1 +0,0 @@
-This test is a simple profile-s provider test
diff --git a/test/unittest/profile-n/tst.profilesec.d b/test/unittest/profile-n/tst.profilesec.d
index 5f5787f6..1f00718e 100644
--- a/test/unittest/profile-n/tst.profilesec.d
+++ b/test/unittest/profile-n/tst.profilesec.d
@@ -20,6 +20,5 @@
 
 profile-1sec
 {
-	printf("This test is a simple profile-sec provider test");
 	exit(0);
 }
diff --git a/test/unittest/profile-n/tst.profilesec.r b/test/unittest/profile-n/tst.profilesec.r
deleted file mode 100644
index 9091592d..00000000
--- a/test/unittest/profile-n/tst.profilesec.r
+++ /dev/null
@@ -1 +0,0 @@
-This test is a simple profile-sec provider test
diff --git a/test/unittest/profile-n/tst.profileus.d b/test/unittest/profile-n/tst.profileus.d
index bbd4a77e..312d2872 100644
--- a/test/unittest/profile-n/tst.profileus.d
+++ b/test/unittest/profile-n/tst.profileus.d
@@ -20,6 +20,5 @@
 
 profile-200us
 {
-	printf("This test is a simple profile-us provider test");
 	exit(0);
 }
diff --git a/test/unittest/profile-n/tst.profileus.r b/test/unittest/profile-n/tst.profileus.r
deleted file mode 100644
index aa270642..00000000
--- a/test/unittest/profile-n/tst.profileus.r
+++ /dev/null
@@ -1 +0,0 @@
-This test is a simple profile-us provider test
diff --git a/test/unittest/profile-n/tst.profileusec.d b/test/unittest/profile-n/tst.profileusec.d
index e29335c4..5847d25a 100644
--- a/test/unittest/profile-n/tst.profileusec.d
+++ b/test/unittest/profile-n/tst.profileusec.d
@@ -20,6 +20,5 @@
 
 profile-200usec
 {
-	printf("This test is a simple profile-usec provider test");
 	exit(0);
 }
diff --git a/test/unittest/profile-n/tst.profileusec.r b/test/unittest/profile-n/tst.profileusec.r
deleted file mode 100644
index 96dfef1c..00000000
--- a/test/unittest/profile-n/tst.profileusec.r
+++ /dev/null
@@ -1 +0,0 @@
-This test is a simple profile-usec provider test
-- 
2.28.0




More information about the DTrace-devel mailing list