aboutsummaryrefslogtreecommitdiffstats
path: root/test/fcopy/cmdline.exp
diff options
context:
space:
mode:
Diffstat (limited to 'test/fcopy/cmdline.exp')
-rwxr-xr-xtest/fcopy/cmdline.exp56
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
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "/usr/lib/firejail/fcopy\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 "files missing"
14}
15expect {
16 timeout {puts "TESTING ERROR 1\n";exit}
17 "Usage:"
18}
19after 100
20
21send -- "/usr/lib/firejail/fcopy foo\r"
22expect {
23 timeout {puts "TESTING ERROR 2\n";exit}
24 "files missing"
25}
26expect {
27 timeout {puts "TESTING ERROR 3\n";exit}
28 "Usage:"
29}
30after 100
31
32send -- "/usr/lib/firejail/fcopy f%oo1 foo2\r"
33expect {
34 timeout {puts "TESTING ERROR 4\n";exit}
35 "invalid file name"
36}
37after 100
38
39send -- "/usr/lib/firejail/fcopy foo1 f,oo2\r"
40expect {
41 timeout {puts "TESTING ERROR 5\n";exit}
42 "invalid file name"
43}
44after 100
45
46send -- "/usr/lib/firejail/fcopy foo1 foo2\r"
47expect {
48 timeout {puts "TESTING ERROR 6\n";exit}
49 "cannot find destination directory"
50}
51after 100
52
53
54
55
56puts "\nall done\n"