aboutsummaryrefslogtreecommitdiffstats
path: root/test/utils/ls.exp
diff options
context:
space:
mode:
Diffstat (limited to 'test/utils/ls.exp')
-rwxr-xr-xtest/utils/ls.exp69
1 files changed, 69 insertions, 0 deletions
diff --git a/test/utils/ls.exp b/test/utils/ls.exp
new file mode 100755
index 000000000..ff6867c51
--- /dev/null
+++ b/test/utils/ls.exp
@@ -0,0 +1,69 @@
1#!/usr/bin/expect -f
2
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6set firstspawn $spawn_id
7
8
9send -- "rm -f lstesting\r"
10sleep 1
11send -- "firejail --private --name=test\r"
12expect {
13 timeout {puts "TESTING ERROR 0\n";exit}
14 "Child process initialized"
15}
16sleep 1
17send -- "echo my_testing > ~/lstesting\r"
18after 100
19
20# ls
21spawn $env(SHELL)
22send -- "firejail --ls=test ~/.\r"
23expect {
24 timeout {puts "TESTING ERROR 1\n";exit}
25 "lstesting"
26}
27sleep 1
28
29# get
30send -- "firejail --get=test ~/lstesting\r"
31sleep 1
32send -- "cat lstesting\r"
33expect {
34 timeout {puts "TESTING ERROR 2n";exit}
35 "my_testing"
36}
37after 100
38
39# put
40send -- "echo put_test > ~/lstesting\r"
41after 100
42send -- "firejail --put=test ~/lstesting ~/lstesting_2\r"
43sleep 1
44
45set spawn_id $firstspawn
46send -- "ls -al ~\r"
47expect {
48 timeout {puts "TESTING ERROR 3\n";exit}
49 "lstesting_2"
50}
51
52after 100
53send -- "cat ~/lstesting_2\r"
54expect {
55 timeout {puts "TESTING ERROR 4\n";exit}
56 "put_test"
57}
58after 100
59send -- "exit\r"
60sleep 1
61
62
63
64
65
66send -- "rm -f lstesting\r"
67
68after 100
69puts "\nall done\n"