diff options
author | netblue30 <netblue30@yahoo.com> | 2018-04-01 10:41:00 -0400 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2018-04-01 10:41:00 -0400 |
commit | 80d0d452d660f2c77af94fc35d2caaea7cfd1cae (patch) | |
tree | 6887b38cef478cf917cc99b56e1d622635e78e02 /test | |
parent | testing (diff) | |
download | firejail-80d0d452d660f2c77af94fc35d2caaea7cfd1cae.tar.gz firejail-80d0d452d660f2c77af94fc35d2caaea7cfd1cae.tar.zst firejail-80d0d452d660f2c77af94fc35d2caaea7cfd1cae.zip |
testing
Diffstat (limited to 'test')
-rwxr-xr-x | test/root/firecfg.exp | 6 | ||||
-rwxr-xr-x | test/root/root.sh | 28 | ||||
-rwxr-xr-x | test/utils/build.exp | 33 | ||||
-rwxr-xr-x | test/utils/utils.sh | 4 |
4 files changed, 57 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/root.sh b/test/root/root.sh index 22b12cf86..d77982993 100755 --- a/test/root/root.sh +++ b/test/root/root.sh | |||
@@ -3,6 +3,23 @@ | |||
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 | rm -fr /home/netblue/.local/share/applications-store | ||
15 | mv /home/netblue/.local/share/applications /home/netblue/.local/share/applications-store | ||
16 | ./firecfg.exp | ||
17 | rm -fr /home/netblue/.local/share/applications | ||
18 | mv /home/netblue/.local/share/applications-store /home/netblue/.local/share/applications | ||
19 | else | ||
20 | echo "TESTING SKIP: firecfg, less not found" | ||
21 | fi | ||
22 | |||
6 | #******************************** | 23 | #******************************** |
7 | # servers | 24 | # servers |
8 | #******************************** | 25 | #******************************** |
@@ -107,17 +124,6 @@ rm -f tmpfile | |||
107 | echo "TESTING: firemon events (test/root/firemon-events.exp)" | 124 | echo "TESTING: firemon events (test/root/firemon-events.exp)" |
108 | ./firemon-events.exp | 125 | ./firemon-events.exp |
109 | 126 | ||
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 | 127 | ||
122 | # restore the default config file | 128 | # restore the default config file |
123 | #cp ../../etc/firejail.config /etc/firejail/firejail.config | 129 | #cp ../../etc/firejail.config /etc/firejail/firejail.config |
diff --git a/test/utils/build.exp b/test/utils/build.exp index de2a9b6ae..5e883e4ba 100755 --- a/test/utils/build.exp +++ b/test/utils/build.exp | |||
@@ -54,5 +54,38 @@ expect { | |||
54 | } | 54 | } |
55 | after 100 | 55 | after 100 |
56 | 56 | ||
57 | send -- "firejail --build cat /etc/passwd\r" | ||
58 | expect { | ||
59 | timeout {puts "TESTING ERROR 10\n";exit} | ||
60 | "private-etc passwd," | ||
61 | } | ||
62 | after 100 | ||
63 | |||
64 | send -- "firejail --build cat /var/tmp/firejail-test-file-7699\r" | ||
65 | expect { | ||
66 | timeout {puts "TESTING ERROR 11\n";exit} | ||
67 | "whitelist /var/tmp/firejail-test-file-7699" | ||
68 | } | ||
69 | after 100 | ||
70 | |||
71 | send -- "firejail --build man firejail\r" | ||
72 | expect { | ||
73 | timeout {puts "TESTING ERROR 12\n";exit} | ||
74 | "whitelist /usr/share/man" | ||
75 | } | ||
76 | after 100 | ||
77 | |||
78 | send -- "firejail --build wget blablabla\r" | ||
79 | expect { | ||
80 | timeout {puts "TESTING ERROR 13\n";exit} | ||
81 | "protocol inet" | ||
82 | } | ||
83 | after 100 | ||
84 | |||
85 | |||
86 | send -- "firejail --build cat /tmp/firejail-test-file-7699\r" | ||
87 | #todo - bug: it comes back with private-tmp | ||
88 | sleep 1 | ||
89 | |||
57 | 90 | ||
58 | puts "all done\n" | 91 | puts "all done\n" |
diff --git a/test/utils/utils.sh b/test/utils/utils.sh index 9259ee33a..5438e11a8 100755 --- a/test/utils/utils.sh +++ b/test/utils/utils.sh | |||
@@ -13,9 +13,13 @@ fi | |||
13 | export PATH="$PATH:/usr/lib/firejail" | 13 | export PATH="$PATH:/usr/lib/firejail" |
14 | 14 | ||
15 | echo "testing" > ~/firejail-test-file-7699 | 15 | echo "testing" > ~/firejail-test-file-7699 |
16 | echo "testing" > /tmp/firejail-test-file-7699 | ||
17 | echo "testing" > /var/tmp/firejail-test-file-7699 | ||
16 | echo "TESTING: build (test/utils/build.exp)" | 18 | echo "TESTING: build (test/utils/build.exp)" |
17 | ./build.exp | 19 | ./build.exp |
18 | rm -f ~/firejail-test-file-7699 | 20 | rm -f ~/firejail-test-file-7699 |
21 | rm -f /tmp/firejail-test-file-7699 | ||
22 | rm -f /var/tmp/firejail-test-file-7699 | ||
19 | 23 | ||
20 | echo "TESTING: audit (test/utils/audit.exp)" | 24 | echo "TESTING: audit (test/utils/audit.exp)" |
21 | ./audit.exp | 25 | ./audit.exp |