diff options
author | netblue30 <netblue30@yahoo.com> | 2016-04-23 08:53:07 -0400 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2016-04-23 08:53:07 -0400 |
commit | 2905b9f9ab5c5ed6f9210d1d843a8bcf41451854 (patch) | |
tree | d3bb968dbcb9f22856de345d0df5ecf2a44d594f /test/profiles | |
parent | quiterss profile (diff) | |
download | firejail-2905b9f9ab5c5ed6f9210d1d843a8bcf41451854.tar.gz firejail-2905b9f9ab5c5ed6f9210d1d843a8bcf41451854.tar.zst firejail-2905b9f9ab5c5ed6f9210d1d843a8bcf41451854.zip |
make test-utils
Diffstat (limited to 'test/profiles')
-rwxr-xr-x | test/profiles/ignore.exp | 50 | ||||
-rw-r--r-- | test/profiles/ignore.profile | 3 | ||||
-rw-r--r-- | test/profiles/ignore2.profile | 3 | ||||
-rwxr-xr-x | test/profiles/profiles.sh | 7 |
4 files changed, 61 insertions, 2 deletions
diff --git a/test/profiles/ignore.exp b/test/profiles/ignore.exp new file mode 100755 index 000000000..281697b26 --- /dev/null +++ b/test/profiles/ignore.exp | |||
@@ -0,0 +1,50 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2016 Firejail Authors | ||
4 | # License GPL v2 | ||
5 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | send -- "firejail --profile=ignore.profile --ignore=seccomp \r" | ||
11 | expect { | ||
12 | timeout {puts "TESTING ERROR 0\n";exit} | ||
13 | "Error: please use --profile after --ignore" | ||
14 | } | ||
15 | |||
16 | send -- "firejail --debug --ignore=seccomp\r" | ||
17 | expect { | ||
18 | timeout {puts "TESTING ERROR 1\n";exit} | ||
19 | BLACKLIST {puts "TESTING ERROR 2\n";exit} | ||
20 | "Child process initialized" | ||
21 | } | ||
22 | sleep 1 | ||
23 | send -- "exit\r" | ||
24 | sleep 1 | ||
25 | |||
26 | send -- "firejail --ignore=seccomp --ignore=shell --profile=ignore.profile \r" | ||
27 | expect { | ||
28 | timeout {puts "TESTING ERROR 3\n";exit} | ||
29 | "Child process initialized" | ||
30 | } | ||
31 | sleep 1 | ||
32 | |||
33 | send -- "ps aux | wc -l\r" | ||
34 | expect { | ||
35 | timeout {puts "TESTING ERROR 4\n";exit} | ||
36 | "5" | ||
37 | } | ||
38 | sleep 1 | ||
39 | send -- "exit\r" | ||
40 | sleep 1 | ||
41 | |||
42 | send -- "firejail --debug --profile=ignore2.profile\r" | ||
43 | expect { | ||
44 | timeout {puts "TESTING ERROR 5\n";exit} | ||
45 | BLACKLIST {puts "TESTING ERROR 6\n";exit} | ||
46 | "Child process initialized" | ||
47 | } | ||
48 | |||
49 | |||
50 | puts "\nall done\n" | ||
diff --git a/test/profiles/ignore.profile b/test/profiles/ignore.profile new file mode 100644 index 000000000..aec231ad2 --- /dev/null +++ b/test/profiles/ignore.profile | |||
@@ -0,0 +1,3 @@ | |||
1 | private | ||
2 | seccomp | ||
3 | shell none | ||
diff --git a/test/profiles/ignore2.profile b/test/profiles/ignore2.profile new file mode 100644 index 000000000..49fcd8324 --- /dev/null +++ b/test/profiles/ignore2.profile | |||
@@ -0,0 +1,3 @@ | |||
1 | ignore seccomp | ||
2 | private | ||
3 | seccomp | ||
diff --git a/test/profiles/profiles.sh b/test/profiles/profiles.sh index a20ed5432..e3adc8a4f 100755 --- a/test/profiles/profiles.sh +++ b/test/profiles/profiles.sh | |||
@@ -14,9 +14,12 @@ do | |||
14 | ./test-profile.exp $PROFILE | 14 | ./test-profile.exp $PROFILE |
15 | done | 15 | done |
16 | 16 | ||
17 | echo "TESTING: profile syntax (profiles/profile_syntax.exp)" | 17 | echo "TESTING: profile syntax (test/profiles/profile_syntax.exp)" |
18 | ./profile_syntax.exp | 18 | ./profile_syntax.exp |
19 | 19 | ||
20 | echo "TESTING: profile syntax 2 (profiles/profile_syntax2.exp)" | 20 | echo "TESTING: profile syntax 2 (test/profiles/profile_syntax2.exp)" |
21 | ./profile_syntax2.exp | 21 | ./profile_syntax2.exp |
22 | 22 | ||
23 | echo "TESTING: ignore command (test/profiles/ignore.exp)" | ||
24 | ./ignore.exp | ||
25 | |||