diff options
author | 2016-04-24 07:42:47 -0400 | |
---|---|---|
committer | 2016-04-24 07:42:47 -0400 | |
commit | 9366b9ddd35168f9a42f374a887f3669ffbab234 (patch) | |
tree | 38631d1041646f3170e0099bf7cac02964470b7a /test/utils | |
parent | testing (diff) | |
download | firejail-9366b9ddd35168f9a42f374a887f3669ffbab234.tar.gz firejail-9366b9ddd35168f9a42f374a887f3669ffbab234.tar.zst firejail-9366b9ddd35168f9a42f374a887f3669ffbab234.zip |
testing
Diffstat (limited to 'test/utils')
-rwxr-xr-x | test/utils/ls.exp | 41 | ||||
-rwxr-xr-x | test/utils/utils.sh | 3 |
2 files changed, 44 insertions, 0 deletions
diff --git a/test/utils/ls.exp b/test/utils/ls.exp new file mode 100755 index 000000000..1936c0aff --- /dev/null +++ b/test/utils/ls.exp | |||
@@ -0,0 +1,41 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | |||
3 | set timeout 10 | ||
4 | spawn $env(SHELL) | ||
5 | match_max 100000 | ||
6 | |||
7 | send -- "rm -f lstesting\r" | ||
8 | sleep 1 | ||
9 | send -- "firejail --private --name=test\r" | ||
10 | expect { | ||
11 | timeout {puts "TESTING ERROR 0\n";exit} | ||
12 | "Child process initialized" | ||
13 | } | ||
14 | sleep 2 | ||
15 | send -- "echo my_testing > lstesting\r" | ||
16 | sleep 2 | ||
17 | |||
18 | |||
19 | spawn $env(SHELL) | ||
20 | send -- "firejail --ls=test ~/.\r" | ||
21 | expect { | ||
22 | timeout {puts "TESTING ERROR 1\n";exit} | ||
23 | "lstesting" | ||
24 | } | ||
25 | sleep 1 | ||
26 | send -- "firejail --get=test ~/lstesting\r" | ||
27 | expect { | ||
28 | timeout {puts "TESTING ERROR 2\n";exit} | ||
29 | "Transfer complete" | ||
30 | } | ||
31 | sleep 1 | ||
32 | send -- "cat lstesting\r" | ||
33 | expect { | ||
34 | timeout {puts "TESTING ERROR 3\n";exit} | ||
35 | "my_testing" | ||
36 | } | ||
37 | sleep 1 | ||
38 | send -- "rm -f lstesting\r" | ||
39 | |||
40 | sleep 1 | ||
41 | puts "\nall done\n" | ||
diff --git a/test/utils/utils.sh b/test/utils/utils.sh index 23cbc6b35..474c026d1 100755 --- a/test/utils/utils.sh +++ b/test/utils/utils.sh | |||
@@ -75,3 +75,6 @@ echo "TESTING: firemon --seccomp (test/utils/seccomp.exp)" | |||
75 | echo "TESTING: firemon --caps (test/ustil/caps.exp)" | 75 | echo "TESTING: firemon --caps (test/ustil/caps.exp)" |
76 | ./caps.exp | 76 | ./caps.exp |
77 | 77 | ||
78 | echo "TESTING: file transfer (test/ustil/ls.exp)" | ||
79 | ./ls.exp | ||
80 | |||