[PATCH 3/3] Add new case for -k
Zhou Wenjian
zhouwj-fnst@cn.fujitsu.com
Thu Dec 10 10:43:00 GMT 2015
* testsuite/systemtap.base/temp-directory.exp: new test case
---
testsuite/systemtap.base/temp-directory.exp | 37 +++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)
create mode 100644 testsuite/systemtap.base/temp-directory.exp
diff --git a/testsuite/systemtap.base/temp-directory.exp b/testsuite/systemtap.base/temp-directory.exp
new file mode 100644
index 0000000..66a629f
--- /dev/null
+++ b/testsuite/systemtap.base/temp-directory.exp
@@ -0,0 +1,37 @@
+# Check keep temporary directory
+set test "keep temporary directory"
+#if {![installtest_p]} { untested "$test"; return }
+
+# Script we'll use while testing:
+set script "probe begin{exit();}"
+set ret 0
+
+spawn stap -k -e $script
+expect {
+-re {Keeping temporary directory \"((/[0-9a-zA-Z]*)+)\"\r\n} {set dir $expect_out(1,string); exp_continue}
+eof
+}
+
+if { [file isdirectory $dir] == 1 } {
+ exec rm -rf $dir
+} else {
+ set ret 1
+}
+
+spawn stap -k -p1 -e $script
+expect {
+-re {Keeping temporary directory \"((/[0-9a-zA-Z]*)+)\"\r\n} {set dir $expect_out(1,string); exp_continue}
+eof
+}
+
+if { [file isdirectory $dir] == 1 } {
+ exec rm -rf $dir
+} else {
+ set ret 1
+}
+
+if { $ret == 0 } {
+ pass $test
+} else {
+ fail $test
+}
--
1.8.3.1
More information about the Systemtap
mailing list