aboutsummaryrefslogtreecommitdiffstats
path: root/test/fcopy/src/dircopy.exp
diff options
context:
space:
mode:
Diffstat (limited to 'test/fcopy/src/dircopy.exp')
-rwxr-xr-x[l---------]test/fcopy/src/dircopy.exp140
1 files changed, 139 insertions, 1 deletions
diff --git a/test/fcopy/src/dircopy.exp b/test/fcopy/src/dircopy.exp
index 2acf88f7b..0882561e5 120000..100755
--- a/test/fcopy/src/dircopy.exp
+++ b/test/fcopy/src/dircopy.exp
@@ -1 +1,139 @@
1../dircopy.exp \ No newline at end of file 1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2022 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 -- "fcopy src dest\r"
17after 100
18
19send -- "find dest\r"
20expect {
21 timeout {puts "TESTING ERROR 0\n";exit}
22 "dest/"
23}
24after 100
25
26send -- "find dest\r"
27expect {
28 timeout {puts "TESTING ERROR 0\n";exit}
29 "dest/"
30}
31after 100
32
33send -- "find dest\r"
34expect {
35 timeout {puts "TESTING ERROR 1\n";exit}
36 "dest/a"
37}
38after 100
39
40send -- "find dest\r"
41expect {
42 timeout {puts "TESTING ERROR 2\n";exit}
43 "dest/a/b"
44}
45after 100
46
47send -- "find dest\r"
48expect {
49 timeout {puts "TESTING ERROR 3\n";exit}
50 "dest/a/b/file4"
51}
52after 100
53
54send -- "find dest\r"
55expect {
56 timeout {puts "TESTING ERROR 4\n";exit}
57 "dest/a/file3"
58}
59after 100
60
61send -- "find dest\r"
62expect {
63 timeout {puts "TESTING ERROR 5\n";exit}
64 "dest/dircopy.exp"
65}
66after 100
67
68send -- "find dest\r"
69expect {
70 timeout {puts "TESTING ERROR 6\n";exit}
71 "dest/file2"
72}
73after 100
74
75send -- "find dest\r"
76expect {
77 timeout {puts "TESTING ERROR 7\n";exit}
78 "dest/file1"
79}
80after 100
81
82
83send -- "ls -al dest\r"
84expect {
85 timeout {puts "TESTING ERROR 8\n";exit}
86 "drwxr-xr-x" { puts "umask 0022\n" }
87 "drwxrwxr-x" { puts "umask 0002\n" }
88}
89expect {
90 timeout {puts "TESTING ERROR 9\n";exit}
91 "a"
92}
93expect {
94 timeout {puts "TESTING ERROR 10\n";exit}
95 "lrwxrwxrwx"
96}
97expect {
98 timeout {puts "TESTING ERROR 11\n";exit}
99 "dircopy.exp"
100}
101expect {
102 timeout {puts "TESTING ERROR 12\n";exit}
103 "rwxr-xr-x" { puts "umask 0022\n" }
104 "rwxrwxr-x" { puts "umask 0002\n" }
105}
106expect {
107 timeout {puts "TESTING ERROR 13\n";exit}
108 "file1"
109}
110expect {
111 timeout {puts "TESTING ERROR 14\n";exit}
112 "rw-r--r--" { puts "umask 0022\n" }
113 "rw-rw-r--" { puts "umask 0002\n" }
114}
115expect {
116 timeout {puts "TESTING ERROR 15\n";exit}
117 "file2"
118}
119after 100
120
121send -- "stty -echo\r"
122after 100
123send -- "diff -q src/a/b/file4 dest/a/b/file4; echo done\r"
124expect {
125 timeout {puts "TESTING ERROR 16\n";exit}
126 "differ" {puts "TESTING ERROR 17\n";exit}
127 "done"
128}
129
130send -- "file dest/dircopy.exp\r"
131expect {
132 timeout {puts "TESTING ERROR 18\n";exit}
133 "symbolic link"
134}
135
136send -- "rm -fr dest/*\r"
137after 100
138
139puts "\nall done\n"