aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2017-09-05 19:15:39 -0400
committerLibravatar netblue30 <netblue30@yahoo.com>2017-09-05 19:15:39 -0400
commit912ec614b6c059c9cbc1028ddd56b13beb7ad393 (patch)
treee02c1e30eb17602f19d7adb451415f4ead14ebf3
parenttesting (diff)
downloadfirejail-912ec614b6c059c9cbc1028ddd56b13beb7ad393.tar.gz
firejail-912ec614b6c059c9cbc1028ddd56b13beb7ad393.tar.zst
firejail-912ec614b6c059c9cbc1028ddd56b13beb7ad393.zip
testing
-rwxr-xr-xtest/root/checkcfg.exp14
-rwxr-xr-xtest/root/firecfg.exp40
-rwxr-xr-xtest/root/seccomp-chown.exp17
3 files changed, 47 insertions, 24 deletions
diff --git a/test/root/checkcfg.exp b/test/root/checkcfg.exp
index 205ef1e0c..e17e9cda2 100755
--- a/test/root/checkcfg.exp
+++ b/test/root/checkcfg.exp
@@ -88,6 +88,7 @@ expect {
88 timeout {puts "TESTING ERROR 9\n";exit} 88 timeout {puts "TESTING ERROR 9\n";exit}
89 "noroot feature is disabled in Firejail configuration file\r" 89 "noroot feature is disabled in Firejail configuration file\r"
90} 90}
91sleep 1
91 92
92# netfilter-default 93# netfilter-default
93send -- "echo \"netfilter-default blablabla\" > /etc/firejail/firejail.config\r" 94send -- "echo \"netfilter-default blablabla\" > /etc/firejail/firejail.config\r"
@@ -97,6 +98,7 @@ expect {
97 timeout {puts "TESTING ERROR 10\n";exit} 98 timeout {puts "TESTING ERROR 10\n";exit}
98 "netfilter-default file blablabla not available\r" 99 "netfilter-default file blablabla not available\r"
99} 100}
101after 100
100 102
101# strings 103# strings
102send -- "echo \"xephyr-screen 800x600\" > /etc/firejail/firejail.config\r" 104send -- "echo \"xephyr-screen 800x600\" > /etc/firejail/firejail.config\r"
@@ -104,17 +106,15 @@ after 100
104send -- "echo \"xvfb-screen 800x600x24\" >> /etc/firejail/firejail.config\r" 106send -- "echo \"xvfb-screen 800x600x24\" >> /etc/firejail/firejail.config\r"
105after 100 107after 100
106send -- "echo \"xvfb-extra-params blablabla\" >> /etc/firejail/firejail.config\r" 108send -- "echo \"xvfb-extra-params blablabla\" >> /etc/firejail/firejail.config\r"
107after 100 109sleep 1
108send -- "firejail --noprofile\r" 110send -- "firejail --noprofile echo done\r"
109expect { 111expect {
110 timeout {puts "TESTING ERROR 11\n";exit} 112 timeout {puts "TESTING ERROR 11\n";exit}
111 "Child process initialized\r" 113 "done\r"
112} 114}
113after 100 115sleep 1
114send -- "exit\r"
115after 100
116 116
117# error exit 117after 100
118send -- "echo \"join no\" > /etc/firejail/firejail.config\r" 118send -- "echo \"join no\" > /etc/firejail/firejail.config\r"
119after 100 119after 100
120send -- "echo \"cache-tmpfs no\" >> /etc/firejail/firejail.config\r" 120send -- "echo \"cache-tmpfs no\" >> /etc/firejail/firejail.config\r"
diff --git a/test/root/firecfg.exp b/test/root/firecfg.exp
index 8961aed60..8210496bb 100755
--- a/test/root/firecfg.exp
+++ b/test/root/firecfg.exp
@@ -15,40 +15,64 @@ expect {
15 timeout {puts "TESTING ERROR 0\n";exit} 15 timeout {puts "TESTING ERROR 0\n";exit}
16 "/usr/local/bin/firefox removed" 16 "/usr/local/bin/firefox removed"
17} 17}
18after 100 18sleep 1
19
19send -- "file /usr/local/bin/firefox; echo done\r" 20send -- "file /usr/local/bin/firefox; echo done\r"
20expect { 21expect {
21 timeout {puts "TESTING ERROR 1\n";exit} 22 timeout {puts "TESTING ERROR 1\n";exit}
22 "symbolic link to /usr/bin/firejail" {puts "TESTING ERROR 2\n";exit} 23 "symbolic link to /usr/bin/firejail" {puts "TESTING ERROR 2\n";exit}
23 "done" 24 "done"
24} 25}
25after 100 26sleep 1
26 27
27send -- "firecfg\r" 28send -- "firecfg\r"
28expect { 29expect {
29 timeout {puts "TESTING ERROR 3\n";exit} 30 timeout {puts "TESTING ERROR 3\n";exit}
30 "/usr/local/bin/firefox created" 31 "firefox created"
31} 32}
32after 100 33sleep 1
34
33send -- "file /usr/local/bin/firefox\r" 35send -- "file /usr/local/bin/firefox\r"
34expect { 36expect {
35 timeout {puts "TESTING ERROR 4\n";exit} 37 timeout {puts "TESTING ERROR 4\n";exit}
36 "symbolic link to /usr/bin/firejail" 38 "symbolic link to /usr/bin/firejail"
37} 39}
38after 100 40sleep 1
39 41
40send -- "firecfg --list\r" 42send -- "firecfg --list\r"
41expect { 43expect {
42 timeout {puts "TESTING ERROR 5\n";exit} 44 timeout {puts "TESTING ERROR 5\n";exit}
43 "/usr/local/bin/firefox" 45 "/usr/local/bin/firefox"
44} 46}
45after 100 47sleep 1
46 48
47send -- "firecfg --fix\r" 49send -- "firecfg --fix\r"
48expect { 50expect {
49 timeout {puts "TESTING ERROR 5\n";exit} 51 timeout {puts "TESTING ERROR 6\n";exit}
50 "this option is not supported for root user" 52 "this option is not supported for root user"
51} 53}
54sleep 1
55
56send -- "firecfg --fix-sound\r"
57expect {
58 timeout {puts "TESTING ERROR 7\n";exit}
59 "PulseAudio configured, please logout and login back again"
60}
61sleep 1
62
63send -- "firecfg --version\r"
64expect {
65 timeout {puts "TESTING ERROR 8\n";exit}
66 "firecfg version"
67}
68sleep 1
69
70send -- "firecfg --blablabla\r"
71expect {
72 timeout {puts "TESTING ERROR 9\n";exit}
73 "invalid command line option"
74}
75sleep 1
76
52 77
53after 100
54puts "\nall done\n" 78puts "\nall done\n"
diff --git a/test/root/seccomp-chown.exp b/test/root/seccomp-chown.exp
index 7d9da5e5a..174a35ffe 100755
--- a/test/root/seccomp-chown.exp
+++ b/test/root/seccomp-chown.exp
@@ -14,33 +14,32 @@ expect {
14} 14}
15sleep 2 15sleep 2
16 16
17send -- "touch testfile;pwd\r" 17send -- "touch testfile; echo done\r"
18expect { 18expect {
19 timeout {puts "TESTING ERROR 1\n";exit} 19 timeout {puts "TESTING ERROR 1\n";exit}
20 "/root" {puts "running as root"} 20 "done"
21 "/home"
22} 21}
22after 100
23 23
24send -- "ls -l testfile;pwd\r" 24send -- "ls -l testfile; echo done\r"
25expect { 25expect {
26 timeout {puts "TESTING ERROR 2\n";exit} 26 timeout {puts "TESTING ERROR 2\n";exit}
27 "testfile" 27 "testfile"
28} 28}
29expect { 29expect {
30 timeout {puts "TESTING ERROR 3\n";exit} 30 timeout {puts "TESTING ERROR 3\n";exit}
31 "/root" {puts "running as root"} 31 "done"
32 "/home"
33} 32}
33after 100
34 34
35send -- "chown netblue:netblue testfile;pwd\r" 35send -- "chown netblue:netblue testfile; echo done\r"
36expect { 36expect {
37 timeout {puts "TESTING ERROR 2\n";exit} 37 timeout {puts "TESTING ERROR 2\n";exit}
38 "Bad system call" 38 "Bad system call"
39} 39}
40expect { 40expect {
41 timeout {puts "TESTING ERROR 3\n";exit} 41 timeout {puts "TESTING ERROR 3\n";exit}
42 "/root" {puts "running as root"} 42 "done"
43 "/home"
44} 43}
45 44
46 45