summaryrefslogtreecommitdiff
path: root/testsuite/server
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2000-05-24 06:03:00 +0000
committerTim Potter <tpot@samba.org>2000-05-24 06:03:00 +0000
commit2962a4cc616660dfc3ef5765a4911abec86ae36f (patch)
tree10ee492b58a6fae3cd5f4c9601e5c4b4427e366c /testsuite/server
parentaabf523cafaf3ee528a51dff71332c8073670971 (diff)
downloadsamba-2962a4cc616660dfc3ef5765a4911abec86ae36f.tar.gz
samba-2962a4cc616660dfc3ef5765a4911abec86ae36f.tar.bz2
samba-2962a4cc616660dfc3ef5765a4911abec86ae36f.zip
Testharness for masktest program.
(This used to be commit 4a14b16cd16289a46f9562e927679ef8ca2dcdfc)
Diffstat (limited to 'testsuite/server')
-rw-r--r--testsuite/server/masktest.exp57
1 files changed, 57 insertions, 0 deletions
diff --git a/testsuite/server/masktest.exp b/testsuite/server/masktest.exp
new file mode 100644
index 0000000000..532291bffb
--- /dev/null
+++ b/testsuite/server/masktest.exp
@@ -0,0 +1,57 @@
+#
+# Test various things using the masktest program
+#
+
+# Initialisation
+
+load_lib env-single.exp
+
+set timeout 10
+
+# Test each wildcard individually, then all together at once
+
+set testlist {{"abc" "<"} {"abc" ">"} {"abc" "\""} {"abc" "?"} {"abc" "*"} \
+ {"abc" "."} {"abc" "<>\"?*."}}
+
+foreach { test } $testlist {
+
+ set got_output 0
+ set fail 0
+
+ # Spawn masktest
+
+ spawn bin/masktest //$server/$share -U $user -n 1000 -a \
+ -f [lindex $test 0] -m [concat [lindex $test 0] [lindex $test 1]]
+
+ # Check output
+
+ while 1 {
+ expect {
+ -re "(...) (...) \[0-9\]+ mask=" {
+ if { $expect_out(1,string) != $expect_out(2,string) } {
+ fail "masktest [lindex $test 1]"
+ puts $expect_out(0,string);
+ set fail 1
+ break;
+ } else {
+ set got_output 1
+ }
+ }
+ eof { break }
+ }
+ }
+
+ # Produce result
+
+ set testname "[lindex $test 0] [lindex $test 1]"
+
+ if {$got_output} {
+ if {$fail} {
+ fail "masktest $testname"
+ } else {
+ pass "masktest $testname"
+ }
+ } else {
+ perror "no output seen for test $testname"
+ }
+}