diff options
Diffstat (limited to 'test/environment/env.exp')
-rwxr-xr-x | test/environment/env.exp | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/test/environment/env.exp b/test/environment/env.exp new file mode 100755 index 000000000..a09c3f9c5 --- /dev/null +++ b/test/environment/env.exp | |||
@@ -0,0 +1,58 @@ | |||
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 | #*********************************************** | ||
11 | send -- "firejail --env=ENV1=env1 --env=ENV2=env2 --env=ENV3=env3\r" | ||
12 | expect { | ||
13 | timeout {puts "TESTING ERROR 0\n";exit} | ||
14 | "Child process initialized" | ||
15 | } | ||
16 | sleep 1 | ||
17 | |||
18 | send -- "env | grep ENV1\r" | ||
19 | expect { | ||
20 | timeout {puts "TESTING ERROR 1\n";exit} | ||
21 | "ENV1" | ||
22 | } | ||
23 | send -- "env | grep ENV2\r" | ||
24 | expect { | ||
25 | timeout {puts "TESTING ERROR 2\n";exit} | ||
26 | "ENV2" | ||
27 | } | ||
28 | send -- "env | grep ENV3\r" | ||
29 | expect { | ||
30 | timeout {puts "TESTING ERROR 3\n";exit} | ||
31 | "ENV3" | ||
32 | } | ||
33 | send -- "exit\r" | ||
34 | sleep 1 | ||
35 | |||
36 | #*********************************************** | ||
37 | send -- "firejail --profile=env.profile\r" | ||
38 | expect { | ||
39 | timeout {puts "TESTING ERROR 4\n";exit} | ||
40 | "Child process initialized" | ||
41 | } | ||
42 | sleep 1 | ||
43 | send -- "env | grep LD_LIBRARY_PATH\r" | ||
44 | expect { | ||
45 | timeout {puts "TESTING ERROR 5\n";exit} | ||
46 | "/opt/test/lib" | ||
47 | } | ||
48 | send -- "env | grep CFLAGS\r" | ||
49 | expect { | ||
50 | timeout {puts "TESTING ERROR 6\n";exit} | ||
51 | "Wall" | ||
52 | } | ||
53 | expect { | ||
54 | timeout {puts "TESTING ERROR 7\n";exit} | ||
55 | "Werror" | ||
56 | } | ||
57 | |||
58 | puts "\nall done\n" | ||