diff options
Diffstat (limited to 'test/fcopy/cmdline.exp')
-rwxr-xr-x | test/fcopy/cmdline.exp | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/test/fcopy/cmdline.exp b/test/fcopy/cmdline.exp new file mode 100755 index 000000000..95e221321 --- /dev/null +++ b/test/fcopy/cmdline.exp | |||
@@ -0,0 +1,56 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2016 Firejail Authors | ||
4 | # License GPL v2 | ||
5 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | send -- "/usr/lib/firejail/fcopy\r" | ||
11 | expect { | ||
12 | timeout {puts "TESTING ERROR 0\n";exit} | ||
13 | "files missing" | ||
14 | } | ||
15 | expect { | ||
16 | timeout {puts "TESTING ERROR 1\n";exit} | ||
17 | "Usage:" | ||
18 | } | ||
19 | after 100 | ||
20 | |||
21 | send -- "/usr/lib/firejail/fcopy foo\r" | ||
22 | expect { | ||
23 | timeout {puts "TESTING ERROR 2\n";exit} | ||
24 | "files missing" | ||
25 | } | ||
26 | expect { | ||
27 | timeout {puts "TESTING ERROR 3\n";exit} | ||
28 | "Usage:" | ||
29 | } | ||
30 | after 100 | ||
31 | |||
32 | send -- "/usr/lib/firejail/fcopy f%oo1 foo2\r" | ||
33 | expect { | ||
34 | timeout {puts "TESTING ERROR 4\n";exit} | ||
35 | "invalid file name" | ||
36 | } | ||
37 | after 100 | ||
38 | |||
39 | send -- "/usr/lib/firejail/fcopy foo1 f,oo2\r" | ||
40 | expect { | ||
41 | timeout {puts "TESTING ERROR 5\n";exit} | ||
42 | "invalid file name" | ||
43 | } | ||
44 | after 100 | ||
45 | |||
46 | send -- "/usr/lib/firejail/fcopy foo1 foo2\r" | ||
47 | expect { | ||
48 | timeout {puts "TESTING ERROR 6\n";exit} | ||
49 | "cannot find destination directory" | ||
50 | } | ||
51 | after 100 | ||
52 | |||
53 | |||
54 | |||
55 | |||
56 | puts "\nall done\n" | ||