diff options
author | netblue30 <netblue30@yahoo.com> | 2019-01-21 09:50:43 -0500 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2019-01-21 09:50:43 -0500 |
commit | 76a20bcedacdb7861b04a60e0cc5a35753ef2790 (patch) | |
tree | fc34cfc1173273597e4483afa2d4c07e74924530 /test/profiles | |
parent | release 0.9.58-rc1 (diff) | |
download | firejail-76a20bcedacdb7861b04a60e0cc5a35753ef2790.tar.gz firejail-76a20bcedacdb7861b04a60e0cc5a35753ef2790.tar.zst firejail-76a20bcedacdb7861b04a60e0cc5a35753ef2790.zip |
conditional testing0.9.58-rc1
Diffstat (limited to 'test/profiles')
-rw-r--r-- | test/profiles/cond1.profile | 1 | ||||
-rw-r--r-- | test/profiles/cond2.profile | 1 | ||||
-rw-r--r-- | test/profiles/cond3.profile | 1 | ||||
-rwxr-xr-x | test/profiles/conditional.exp | 47 | ||||
-rwxr-xr-x | test/profiles/profiles.sh | 3 |
5 files changed, 53 insertions, 0 deletions
diff --git a/test/profiles/cond1.profile b/test/profiles/cond1.profile new file mode 100644 index 000000000..207914d66 --- /dev/null +++ b/test/profiles/cond1.profile | |||
@@ -0,0 +1 @@ | |||
?HAS_NODBUS: private | |||
diff --git a/test/profiles/cond2.profile b/test/profiles/cond2.profile new file mode 100644 index 000000000..078efe161 --- /dev/null +++ b/test/profiles/cond2.profile | |||
@@ -0,0 +1 @@ | |||
?HAS_NODBUSprivate | |||
diff --git a/test/profiles/cond3.profile b/test/profiles/cond3.profile new file mode 100644 index 000000000..7cc9ac1e0 --- /dev/null +++ b/test/profiles/cond3.profile | |||
@@ -0,0 +1 @@ | |||
?HAS_NODBUS | |||
diff --git a/test/profiles/conditional.exp b/test/profiles/conditional.exp new file mode 100755 index 000000000..537fb361e --- /dev/null +++ b/test/profiles/conditional.exp | |||
@@ -0,0 +1,47 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2018 Firejail Authors | ||
4 | # License GPL v2 | ||
5 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | send -- "firejail --debug --nodbus --profile=cond1.profile\r" | ||
11 | expect { | ||
12 | timeout {puts "TESTING ERROR 0\n";exit} | ||
13 | "conditional HAS_NODBUS, private" | ||
14 | } | ||
15 | expect { | ||
16 | timeout {puts "TESTING ERROR 1\n";exit} | ||
17 | "Child process initialized" | ||
18 | } | ||
19 | after 100 | ||
20 | send -- "exit\r" | ||
21 | sleep 1 | ||
22 | |||
23 | send -- "firejail --debug --profile=cond1.profile\r" | ||
24 | expect { | ||
25 | timeout {puts "TESTING ERROR 2\n";exit} | ||
26 | "conditional HAS_NODBUS, private" {puts "TESTING ERROR 3\n";exit} | ||
27 | "Child process initialized" | ||
28 | } | ||
29 | after 100 | ||
30 | send -- "exit\r" | ||
31 | sleep 1 | ||
32 | |||
33 | send -- "firejail --profile=cond2.profile\r" | ||
34 | expect { | ||
35 | timeout {puts "TESTING ERROR 4\n";exit} | ||
36 | "invalid conditional syntax" | ||
37 | } | ||
38 | after 100 | ||
39 | |||
40 | send -- "firejail --profile=cond3.profile\r" | ||
41 | expect { | ||
42 | timeout {puts "TESTING ERROR 5\n";exit} | ||
43 | "invalid conditional syntax" | ||
44 | } | ||
45 | after 100 | ||
46 | |||
47 | puts "\nall done\n" | ||
diff --git a/test/profiles/profiles.sh b/test/profiles/profiles.sh index a3d24ac0c..33729927c 100755 --- a/test/profiles/profiles.sh +++ b/test/profiles/profiles.sh | |||
@@ -6,6 +6,9 @@ | |||
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 | echo "TESTING: profile conditional (test/profiles/conditional.exp)" | ||
10 | ./conditional.exp | ||
11 | |||
9 | echo "TESTING: profile recursivity (test/profiles/profile_recursivity.exp)" | 12 | echo "TESTING: profile recursivity (test/profiles/profile_recursivity.exp)" |
10 | ./profile_recursivity.exp | 13 | ./profile_recursivity.exp |
11 | 14 | ||