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/conditional.exp | |
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/conditional.exp')
-rwxr-xr-x | test/profiles/conditional.exp | 47 |
1 files changed, 47 insertions, 0 deletions
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" | ||