aboutsummaryrefslogtreecommitdiffstats
path: root/test/utils
diff options
context:
space:
mode:
Diffstat (limited to 'test/utils')
-rwxr-xr-xtest/utils/join.exp2
-rwxr-xr-xtest/utils/ls.exp42
-rwxr-xr-xtest/utils/utils.sh4
3 files changed, 40 insertions, 8 deletions
diff --git a/test/utils/join.exp b/test/utils/join.exp
index 7f582e2e5..fc30bc6a4 100755
--- a/test/utils/join.exp
+++ b/test/utils/join.exp
@@ -8,7 +8,7 @@ cd /home
8spawn $env(SHELL) 8spawn $env(SHELL)
9match_max 100000 9match_max 100000
10 10
11send -- "firejail --name=jointesting\r" 11send -- "firejail --name=jointesting --cpu=0 --nice=2\r"
12expect { 12expect {
13 timeout {puts "TESTING ERROR 0\n";exit} 13 timeout {puts "TESTING ERROR 0\n";exit}
14 "Child process initialized" 14 "Child process initialized"
diff --git a/test/utils/ls.exp b/test/utils/ls.exp
index cd2c2984c..ff6867c51 100755
--- a/test/utils/ls.exp
+++ b/test/utils/ls.exp
@@ -3,6 +3,8 @@
3set timeout 10 3set timeout 10
4spawn $env(SHELL) 4spawn $env(SHELL)
5match_max 100000 5match_max 100000
6set firstspawn $spawn_id
7
6 8
7send -- "rm -f lstesting\r" 9send -- "rm -f lstesting\r"
8sleep 1 10sleep 1
@@ -11,11 +13,11 @@ expect {
11 timeout {puts "TESTING ERROR 0\n";exit} 13 timeout {puts "TESTING ERROR 0\n";exit}
12 "Child process initialized" 14 "Child process initialized"
13} 15}
14sleep 2 16sleep 1
15send -- "echo my_testing > ~/lstesting\r" 17send -- "echo my_testing > ~/lstesting\r"
16sleep 2 18after 100
17
18 19
20# ls
19spawn $env(SHELL) 21spawn $env(SHELL)
20send -- "firejail --ls=test ~/.\r" 22send -- "firejail --ls=test ~/.\r"
21expect { 23expect {
@@ -23,14 +25,44 @@ expect {
23 "lstesting" 25 "lstesting"
24} 26}
25sleep 1 27sleep 1
28
29# get
26send -- "firejail --get=test ~/lstesting\r" 30send -- "firejail --get=test ~/lstesting\r"
27sleep 2 31sleep 1
28send -- "cat lstesting\r" 32send -- "cat lstesting\r"
29expect { 33expect {
30 timeout {puts "TESTING ERROR 3\n";exit} 34 timeout {puts "TESTING ERROR 2n";exit}
31 "my_testing" 35 "my_testing"
32} 36}
37after 100
38
39# put
40send -- "echo put_test > ~/lstesting\r"
41after 100
42send -- "firejail --put=test ~/lstesting ~/lstesting_2\r"
33sleep 1 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
34send -- "rm -f lstesting\r" 66send -- "rm -f lstesting\r"
35 67
36after 100 68after 100
diff --git a/test/utils/utils.sh b/test/utils/utils.sh
index 7b0ab1096..bd91110f7 100755
--- a/test/utils/utils.sh
+++ b/test/utils/utils.sh
@@ -88,10 +88,10 @@ echo "TESTING: top (test/utils/top.exp)"
88echo "TESTING: file transfer (test/utils/ls.exp)" 88echo "TESTING: file transfer (test/utils/ls.exp)"
89./ls.exp 89./ls.exp
90 90
91echo "TESTING: firemon --seccomp (test/utils/firemon-seccomp.exp)" 91echo "TESTING: firemon seccomp (test/utils/firemon-seccomp.exp)"
92./firemon-seccomp.exp 92./firemon-seccomp.exp
93 93
94echo "TESTING: firemon --caps (test/utils/firemon-caps.exp)" 94echo "TESTING: firemon caps (test/utils/firemon-caps.exp)"
95./firemon-caps.exp 95./firemon-caps.exp
96 96
97echo "TESTING: firemon cpu (test/utils/firemon-cpu.exp)" 97echo "TESTING: firemon cpu (test/utils/firemon-cpu.exp)"