This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 3/3] Add new case for -k


	* 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




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]