~vcs-imports/samba/main

« back to all changes in this revision

Viewing changes to testsuite/server/masktest.exp

  • Committer: jerry
  • Date: 2006-07-14 21:48:39 UTC
  • Revision ID: vcs-imports@canonical.com-20060714214839-586d8c489a8fcead
gutting trunk to move to svn:externals

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#
2
 
# Test various things using the masktest program
3
 
#
4
 
 
5
 
# Initialisation
6
 
 
7
 
load_lib env-single.exp
8
 
 
9
 
set timeout 10
10
 
 
11
 
# Test each wildcard individually, then all together at once
12
 
 
13
 
set testlist {{"abc" "<"} {"abc" ">"} {"abc" "\""} {"abc" "?"} {"abc" "*"} \
14
 
        {"abc" "."} {"abc" "<>\"?*."}}
15
 
 
16
 
foreach { test } $testlist {
17
 
 
18
 
    set got_output 0
19
 
    set fail 0
20
 
 
21
 
    # Spawn masktest
22
 
 
23
 
    spawn bin/masktest //$server/$share -U $user -n 1000 -a \
24
 
            -f [lindex $test 0] -m [concat [lindex $test 0] [lindex $test 1]]
25
 
    
26
 
    # Check output
27
 
 
28
 
    while 1 {
29
 
        expect {
30
 
            -re "(...) (...) \[0-9\]+ mask=" { 
31
 
                if { $expect_out(1,string) != $expect_out(2,string) } {
32
 
                    fail "masktest [lindex $test 1]"
33
 
                    puts $expect_out(0,string);
34
 
                    set fail 1
35
 
                    break;
36
 
                } else {
37
 
                    set got_output 1
38
 
                }
39
 
            }
40
 
            eof    { break }
41
 
        }
42
 
    }
43
 
 
44
 
    # Produce result
45
 
 
46
 
    set testname "[lindex $test 0] [lindex $test 1]"
47
 
    
48
 
    if {$got_output} {
49
 
        if {$fail} { 
50
 
            fail "masktest $testname"
51
 
        } else {
52
 
            pass "masktest $testname"
53
 
        }
54
 
    } else {
55
 
        perror "no output seen for test $testname"
56
 
    }
57
 
}