aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2018-03-31 07:49:55 -0400
committerLibravatar netblue30 <netblue30@yahoo.com>2018-03-31 07:49:55 -0400
commit64699c828f52ab06055d50e1f4e781572a53c35f (patch)
tree7994edb936d282637b2d85f92155327f76eaded0 /test
parentMerge pull request #1848 from jelford/cloud-providers (diff)
downloadfirejail-64699c828f52ab06055d50e1f4e781572a53c35f.tar.gz
firejail-64699c828f52ab06055d50e1f4e781572a53c35f.tar.zst
firejail-64699c828f52ab06055d50e1f4e781572a53c35f.zip
testing
Diffstat (limited to 'test')
-rwxr-xr-xtest/root/firecfg.exp8
-rwxr-xr-xtest/root/root.sh4
-rwxr-xr-xtest/utils/audit.exp20
-rwxr-xr-xtest/utils/build.exp12
-rwxr-xr-xtest/utils/utils.sh8
5 files changed, 44 insertions, 8 deletions
diff --git a/test/root/firecfg.exp b/test/root/firecfg.exp
index 02f2323a0..656b8e215 100755
--- a/test/root/firecfg.exp
+++ b/test/root/firecfg.exp
@@ -13,7 +13,7 @@ sleep 1
13send -- "firecfg --clean\r" 13send -- "firecfg --clean\r"
14expect { 14expect {
15 timeout {puts "TESTING ERROR 0\n";exit} 15 timeout {puts "TESTING ERROR 0\n";exit}
16 "/usr/local/bin/firefox removed" 16 "less removed"
17} 17}
18sleep 1 18sleep 1
19 19
@@ -30,11 +30,11 @@ sleep 1
30send -- "firecfg\r" 30send -- "firecfg\r"
31expect { 31expect {
32 timeout {puts "TESTING ERROR 3\n";exit} 32 timeout {puts "TESTING ERROR 3\n";exit}
33 "firefox created" 33 "less created"
34} 34}
35sleep 1 35sleep 1
36 36
37send -- "file /usr/local/bin/firefox\r" 37send -- "file /usr/local/bin/less\r"
38expect { 38expect {
39 timeout {puts "TESTING ERROR 4\n";exit} 39 timeout {puts "TESTING ERROR 4\n";exit}
40 "symbolic link to /usr/bin/firejail" 40 "symbolic link to /usr/bin/firejail"
@@ -44,7 +44,7 @@ sleep 1
44send -- "firecfg --list\r" 44send -- "firecfg --list\r"
45expect { 45expect {
46 timeout {puts "TESTING ERROR 5\n";exit} 46 timeout {puts "TESTING ERROR 5\n";exit}
47 "/usr/local/bin/firefox" 47 "/usr/local/bin/less"
48} 48}
49sleep 1 49sleep 1
50 50
diff --git a/test/root/root.sh b/test/root/root.sh
index 912ae23f0..22b12cf86 100755
--- a/test/root/root.sh
+++ b/test/root/root.sh
@@ -110,13 +110,13 @@ echo "TESTING: firemon events (test/root/firemon-events.exp)"
110#******************************** 110#********************************
111# firecfg 111# firecfg
112#******************************** 112#********************************
113which firefox 113which less
114if [ "$?" -eq 0 ]; 114if [ "$?" -eq 0 ];
115then 115then
116 echo "TESTING: firecfg (test/root/firecfg.exp)" 116 echo "TESTING: firecfg (test/root/firecfg.exp)"
117 ./firecfg.exp 117 ./firecfg.exp
118else 118else
119 echo "TESTING SKIP: firecfg, firefox not found" 119 echo "TESTING SKIP: firecfg, less not found"
120fi 120fi
121 121
122# restore the default config file 122# restore the default config file
diff --git a/test/utils/audit.exp b/test/utils/audit.exp
index c68ee387c..684886af7 100755
--- a/test/utils/audit.exp
+++ b/test/utils/audit.exp
@@ -76,4 +76,24 @@ expect {
76} 76}
77after 100 77after 100
78 78
79# run audit executable without a sandbox
80send -- "faudit\r"
81expect {
82 timeout {puts "TESTING ERROR 13\n";exit}
83 "is not running in a PID namespace"
84}
85expect {
86 timeout {puts "TESTING ERROR 14\n";exit}
87 "BAD: seccomp disabled"
88}
89expect {
90 timeout {puts "TESTING ERROR 15\n";exit}
91 "BAD: the capability map is"
92}
93expect {
94 timeout {puts "TESTING ERROR 16\n";exit}
95 "MAYBE: /dev directory seems to be fully populated"
96}
97after 100
98
79puts "\nall done\n" 99puts "\nall done\n"
diff --git a/test/utils/build.exp b/test/utils/build.exp
index 916f373b9..de2a9b6ae 100755
--- a/test/utils/build.exp
+++ b/test/utils/build.exp
@@ -7,7 +7,15 @@ set timeout 10
7spawn $env(SHELL) 7spawn $env(SHELL)
8match_max 100000 8match_max 100000
9 9
10send -- "firejail --build ls ~\r" 10send -- "firejail --build cat ~/firejail-test-file-7699\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 "whitelist ~/firejail-test-file-7699"
14}
15expect {
16 timeout {puts "TESTING ERROR 0.1\n";exit}
17 "include /etc/firejail/whitelist-common.inc"
18}
11expect { 19expect {
12 timeout {puts "TESTING ERROR 1\n";exit} 20 timeout {puts "TESTING ERROR 1\n";exit}
13 "private-tmp" 21 "private-tmp"
@@ -22,7 +30,7 @@ expect {
22} 30}
23expect { 31expect {
24 timeout {puts "TESTING ERROR 4\n";exit} 32 timeout {puts "TESTING ERROR 4\n";exit}
25 "private-bin ls," 33 "private-bin cat,"
26} 34}
27expect { 35expect {
28 timeout {puts "TESTING ERROR 5\n";exit} 36 timeout {puts "TESTING ERROR 5\n";exit}
diff --git a/test/utils/utils.sh b/test/utils/utils.sh
index 59cd1cfd6..d72cc2269 100755
--- a/test/utils/utils.sh
+++ b/test/utils/utils.sh
@@ -6,8 +6,16 @@
6export MALLOC_CHECK_=3 6export MALLOC_CHECK_=3
7export MALLOC_PERTURB_=$(($RANDOM % 255 + 1)) 7export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))
8 8
9if [ -f /etc/debian_version ]; then
10 libdir=$(dirname "$(dpkg -L firejail | grep faudit)")
11 export PATH="$PATH:$libdir"
12fi
13export PATH="$PATH:/usr/lib/firejail"
14
15echo "testing" > ~/firejail-test-file-7699
9echo "TESTING: build (test/utils/build.exp)" 16echo "TESTING: build (test/utils/build.exp)"
10./build.exp 17./build.exp
18rm -f ~/firejail-test-file-7699
11 19
12echo "TESTING: audit (test/utils/audit.exp)" 20echo "TESTING: audit (test/utils/audit.exp)"
13./audit.exp 21./audit.exp