diff options
Diffstat (limited to 'test/root')
-rwxr-xr-x | test/root/firecfg.exp | 6 | ||||
-rwxr-xr-x | test/root/login_nobody.exp | 35 | ||||
-rwxr-xr-x | test/root/root.sh | 29 |
3 files changed, 56 insertions, 14 deletions
diff --git a/test/root/firecfg.exp b/test/root/firecfg.exp index 656b8e215..b73167bd1 100755 --- a/test/root/firecfg.exp +++ b/test/root/firecfg.exp | |||
@@ -7,10 +7,10 @@ set timeout 10 | |||
7 | spawn $env(SHELL) | 7 | spawn $env(SHELL) |
8 | match_max 100000 | 8 | match_max 100000 |
9 | 9 | ||
10 | send -- "firecfg\r" | 10 | send -- "firecfg --debug\r" |
11 | sleep 1 | 11 | sleep 1 |
12 | 12 | ||
13 | send -- "firecfg --clean\r" | 13 | send -- "firecfg --debug --clean\r" |
14 | expect { | 14 | expect { |
15 | timeout {puts "TESTING ERROR 0\n";exit} | 15 | timeout {puts "TESTING ERROR 0\n";exit} |
16 | "less removed" | 16 | "less removed" |
@@ -27,7 +27,7 @@ expect { | |||
27 | } | 27 | } |
28 | sleep 1 | 28 | sleep 1 |
29 | 29 | ||
30 | send -- "firecfg\r" | 30 | send -- "firecfg --debug\r" |
31 | expect { | 31 | expect { |
32 | timeout {puts "TESTING ERROR 3\n";exit} | 32 | timeout {puts "TESTING ERROR 3\n";exit} |
33 | "less created" | 33 | "less created" |
diff --git a/test/root/login_nobody.exp b/test/root/login_nobody.exp new file mode 100755 index 000000000..8e9ec4367 --- /dev/null +++ b/test/root/login_nobody.exp | |||
@@ -0,0 +1,35 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2018 Firejail Authors | ||
4 | # License GPL v2 | ||
5 | |||
6 | set timeout 10 | ||
7 | cd /home | ||
8 | spawn $env(SHELL) | ||
9 | match_max 100000 | ||
10 | |||
11 | send -- "su - nobody -s /usr/bin/firejail\r" | ||
12 | expect { | ||
13 | timeout {puts "TESTING ERROR 0\n";exit} | ||
14 | "Child process initialized" | ||
15 | } | ||
16 | after 100 | ||
17 | |||
18 | send -- "cat /proc/self/status | grep Seccomp\r" | ||
19 | expect { | ||
20 | timeout {puts "TESTING ERROR 3\n";exit} | ||
21 | "2" | ||
22 | } | ||
23 | after 100 | ||
24 | |||
25 | send -- "cat /proc/self/status | grep CapBnd\r" | ||
26 | expect { | ||
27 | timeout {puts "TESTING ERROR 4\n";exit} | ||
28 | "0000000000000000" | ||
29 | } | ||
30 | after 100 | ||
31 | |||
32 | send -- "exit\r" | ||
33 | sleep 1 | ||
34 | |||
35 | puts "\nall done\n" | ||
diff --git a/test/root/root.sh b/test/root/root.sh index 22b12cf86..4132bc739 100755 --- a/test/root/root.sh +++ b/test/root/root.sh | |||
@@ -3,6 +3,21 @@ | |||
3 | # set a new firejail config file | 3 | # set a new firejail config file |
4 | #cp firejail.config /etc/firejail/firejail.config | 4 | #cp firejail.config /etc/firejail/firejail.config |
5 | 5 | ||
6 | |||
7 | #******************************** | ||
8 | # firecfg | ||
9 | #******************************** | ||
10 | which less | ||
11 | if [ "$?" -eq 0 ]; | ||
12 | then | ||
13 | echo "TESTING: firecfg (test/root/firecfg.exp)" | ||
14 | mv /home/netblue/.local/share/applications /home/netblue/.local/share/applications-store | ||
15 | ./firecfg.exp | ||
16 | mv /home/netblue/.local/share/applications-store /home/netblue/.local/share/applications | ||
17 | else | ||
18 | echo "TESTING SKIP: firecfg, less not found" | ||
19 | fi | ||
20 | |||
6 | #******************************** | 21 | #******************************** |
7 | # servers | 22 | # servers |
8 | #******************************** | 23 | #******************************** |
@@ -65,6 +80,9 @@ echo "TESTING: join (test/root/join.exp)" | |||
65 | echo "TESTING: git-install (test/root/git.exp)" | 80 | echo "TESTING: git-install (test/root/git.exp)" |
66 | ./git.exp | 81 | ./git.exp |
67 | 82 | ||
83 | echo "TESTING: login-nobody (test/root/login_nobody.exp)" | ||
84 | ./login_nobody.exp | ||
85 | |||
68 | #******************************** | 86 | #******************************** |
69 | # seccomp | 87 | # seccomp |
70 | #******************************** | 88 | #******************************** |
@@ -107,17 +125,6 @@ rm -f tmpfile | |||
107 | echo "TESTING: firemon events (test/root/firemon-events.exp)" | 125 | echo "TESTING: firemon events (test/root/firemon-events.exp)" |
108 | ./firemon-events.exp | 126 | ./firemon-events.exp |
109 | 127 | ||
110 | #******************************** | ||
111 | # firecfg | ||
112 | #******************************** | ||
113 | which less | ||
114 | if [ "$?" -eq 0 ]; | ||
115 | then | ||
116 | echo "TESTING: firecfg (test/root/firecfg.exp)" | ||
117 | ./firecfg.exp | ||
118 | else | ||
119 | echo "TESTING SKIP: firecfg, less not found" | ||
120 | fi | ||
121 | 128 | ||
122 | # restore the default config file | 129 | # restore the default config file |
123 | #cp ../../etc/firejail.config /etc/firejail/firejail.config | 130 | #cp ../../etc/firejail.config /etc/firejail/firejail.config |