aboutsummaryrefslogtreecommitdiffstats
path: root/test/fcopy/linkcopy.exp
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2016-11-16 11:10:32 -0500
committerLibravatar netblue30 <netblue30@yahoo.com>2016-11-16 11:10:32 -0500
commitedcd62d7523365165e23695d7daabc94f1e9f48d (patch)
tree25649c9b73acd260fbafa30ee66cd6f7ceae8f1c /test/fcopy/linkcopy.exp
parentMerge pull request #912 from curiosity-seeker/master (diff)
downloadfirejail-edcd62d7523365165e23695d7daabc94f1e9f48d.tar.gz
firejail-edcd62d7523365165e23695d7daabc94f1e9f48d.tar.zst
firejail-edcd62d7523365165e23695d7daabc94f1e9f48d.zip
fcopy part 1
Diffstat (limited to 'test/fcopy/linkcopy.exp')
-rwxr-xr-xtest/fcopy/linkcopy.exp86
1 files changed, 86 insertions, 0 deletions
diff --git a/test/fcopy/linkcopy.exp b/test/fcopy/linkcopy.exp
new file mode 100755
index 000000000..b87f24a59
--- /dev/null
+++ b/test/fcopy/linkcopy.exp
@@ -0,0 +1,86 @@
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#
7# copy directory src to dest
8#
9set timeout 10
10spawn $env(SHELL)
11match_max 100000
12
13send -- "rm -fr dest/*\r"
14after 100
15
16send -- "/usr/lib/firejail/fcopy src dest\r"
17after 100
18
19send -- "find dest\r"
20expect {
21 timeout {puts "TESTING ERROR 0\n";exit}
22 "dest/"
23}
24expect {
25 timeout {puts "TESTING ERROR 1\n";exit}
26 "dest/a"
27}
28expect {
29 timeout {puts "TESTING ERROR 2\n";exit}
30 "dest/a/b"
31}
32expect {
33 timeout {puts "TESTING ERROR 3\n";exit}
34 "dest/a/b/file4"
35}
36expect {
37 timeout {puts "TESTING ERROR 4\n";exit}
38 "dest/a/file3"
39}
40expect {
41 timeout {puts "TESTING ERROR 5\n";exit}
42 "dest/dircopy.exp"
43}
44expect {
45 timeout {puts "TESTING ERROR 6\n";exit}
46 "dest/file2"
47}
48expect {
49 timeout {puts "TESTING ERROR 7\n";exit}
50 "dest/file1"
51}
52after 100
53
54
55send -- "ls -al dest\r"
56expect {
57 timeout {puts "TESTING ERROR 8\n";exit}
58 "drwx--x--x"
59}
60expect {
61 timeout {puts "TESTING ERROR 9\n";exit}
62 "rwxrwxrwx"
63}
64expect {
65 timeout {puts "TESTING ERROR 10\n";exit}
66 "rw-r--r--"
67}
68after 100
69
70send -- "diff -q src/a/b/file4 dest/a/b/file4; echo done\r"
71expect {
72 timeout {puts "TESTING ERROR 11\n";exit}
73 "differ" {puts "TESTING ERROR 12\n";exit}
74 "done"
75}
76
77send -- "file dest/dircopy.exp\r"
78expect {
79 timeout {puts "TESTING ERROR 13\n";exit}
80 "symbolic link"
81}
82
83send -- "rm -fr dest/*\r"
84after 100
85
86puts "\nall done\n"