diff options
author | netblue30 <netblue30@yahoo.com> | 2018-03-31 07:49:55 -0400 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2018-03-31 07:49:55 -0400 |
commit | 64699c828f52ab06055d50e1f4e781572a53c35f (patch) | |
tree | 7994edb936d282637b2d85f92155327f76eaded0 /test/utils | |
parent | Merge pull request #1848 from jelford/cloud-providers (diff) | |
download | firejail-64699c828f52ab06055d50e1f4e781572a53c35f.tar.gz firejail-64699c828f52ab06055d50e1f4e781572a53c35f.tar.zst firejail-64699c828f52ab06055d50e1f4e781572a53c35f.zip |
testing
Diffstat (limited to 'test/utils')
-rwxr-xr-x | test/utils/audit.exp | 20 | ||||
-rwxr-xr-x | test/utils/build.exp | 12 | ||||
-rwxr-xr-x | test/utils/utils.sh | 8 |
3 files changed, 38 insertions, 2 deletions
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 | } |
77 | after 100 | 77 | after 100 |
78 | 78 | ||
79 | # run audit executable without a sandbox | ||
80 | send -- "faudit\r" | ||
81 | expect { | ||
82 | timeout {puts "TESTING ERROR 13\n";exit} | ||
83 | "is not running in a PID namespace" | ||
84 | } | ||
85 | expect { | ||
86 | timeout {puts "TESTING ERROR 14\n";exit} | ||
87 | "BAD: seccomp disabled" | ||
88 | } | ||
89 | expect { | ||
90 | timeout {puts "TESTING ERROR 15\n";exit} | ||
91 | "BAD: the capability map is" | ||
92 | } | ||
93 | expect { | ||
94 | timeout {puts "TESTING ERROR 16\n";exit} | ||
95 | "MAYBE: /dev directory seems to be fully populated" | ||
96 | } | ||
97 | after 100 | ||
98 | |||
79 | puts "\nall done\n" | 99 | puts "\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 | |||
7 | spawn $env(SHELL) | 7 | spawn $env(SHELL) |
8 | match_max 100000 | 8 | match_max 100000 |
9 | 9 | ||
10 | send -- "firejail --build ls ~\r" | 10 | send -- "firejail --build cat ~/firejail-test-file-7699\r" |
11 | expect { | ||
12 | timeout {puts "TESTING ERROR 0\n";exit} | ||
13 | "whitelist ~/firejail-test-file-7699" | ||
14 | } | ||
15 | expect { | ||
16 | timeout {puts "TESTING ERROR 0.1\n";exit} | ||
17 | "include /etc/firejail/whitelist-common.inc" | ||
18 | } | ||
11 | expect { | 19 | expect { |
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 | } |
23 | expect { | 31 | expect { |
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 | } |
27 | expect { | 35 | expect { |
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 @@ | |||
6 | export MALLOC_CHECK_=3 | 6 | export MALLOC_CHECK_=3 |
7 | export MALLOC_PERTURB_=$(($RANDOM % 255 + 1)) | 7 | export MALLOC_PERTURB_=$(($RANDOM % 255 + 1)) |
8 | 8 | ||
9 | if [ -f /etc/debian_version ]; then | ||
10 | libdir=$(dirname "$(dpkg -L firejail | grep faudit)") | ||
11 | export PATH="$PATH:$libdir" | ||
12 | fi | ||
13 | export PATH="$PATH:/usr/lib/firejail" | ||
14 | |||
15 | echo "testing" > ~/firejail-test-file-7699 | ||
9 | echo "TESTING: build (test/utils/build.exp)" | 16 | echo "TESTING: build (test/utils/build.exp)" |
10 | ./build.exp | 17 | ./build.exp |
18 | rm -f ~/firejail-test-file-7699 | ||
11 | 19 | ||
12 | echo "TESTING: audit (test/utils/audit.exp)" | 20 | echo "TESTING: audit (test/utils/audit.exp)" |
13 | ./audit.exp | 21 | ./audit.exp |