aboutsummaryrefslogtreecommitdiffstats
path: root/test/profiles/conditional.exp
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2019-01-21 09:50:43 -0500
committerLibravatar netblue30 <netblue30@yahoo.com>2019-01-21 09:50:43 -0500
commit76a20bcedacdb7861b04a60e0cc5a35753ef2790 (patch)
treefc34cfc1173273597e4483afa2d4c07e74924530 /test/profiles/conditional.exp
parentrelease 0.9.58-rc1 (diff)
downloadfirejail-76a20bcedacdb7861b04a60e0cc5a35753ef2790.tar.gz
firejail-76a20bcedacdb7861b04a60e0cc5a35753ef2790.tar.zst
firejail-76a20bcedacdb7861b04a60e0cc5a35753ef2790.zip
conditional testing0.9.58-rc1
Diffstat (limited to 'test/profiles/conditional.exp')
-rwxr-xr-xtest/profiles/conditional.exp47
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
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail --debug --nodbus --profile=cond1.profile\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 "conditional HAS_NODBUS, private"
14}
15expect {
16 timeout {puts "TESTING ERROR 1\n";exit}
17 "Child process initialized"
18}
19after 100
20send -- "exit\r"
21sleep 1
22
23send -- "firejail --debug --profile=cond1.profile\r"
24expect {
25 timeout {puts "TESTING ERROR 2\n";exit}
26 "conditional HAS_NODBUS, private" {puts "TESTING ERROR 3\n";exit}
27 "Child process initialized"
28}
29after 100
30send -- "exit\r"
31sleep 1
32
33send -- "firejail --profile=cond2.profile\r"
34expect {
35 timeout {puts "TESTING ERROR 4\n";exit}
36 "invalid conditional syntax"
37}
38after 100
39
40send -- "firejail --profile=cond3.profile\r"
41expect {
42 timeout {puts "TESTING ERROR 5\n";exit}
43 "invalid conditional syntax"
44}
45after 100
46
47puts "\nall done\n"