diff options
Diffstat (limited to 'test')
-rwxr-xr-x | test/environment/environment.sh | 6 | ||||
-rw-r--r-- | test/environment/hostfile | 1 | ||||
-rwxr-xr-x | test/environment/hostfile.exp | 32 | ||||
-rwxr-xr-x | test/environment/machineid.exp | 25 |
4 files changed, 64 insertions, 0 deletions
diff --git a/test/environment/environment.sh b/test/environment/environment.sh index e2b9cb9d4..60ba7f245 100755 --- a/test/environment/environment.sh +++ b/test/environment/environment.sh | |||
@@ -10,6 +10,12 @@ export MALLOC_PERTURB_=$(($RANDOM % 255 + 1)) | |||
10 | echo "TESTING: DNS (test/environment/dns.exp)" | 10 | echo "TESTING: DNS (test/environment/dns.exp)" |
11 | ./dns.exp | 11 | ./dns.exp |
12 | 12 | ||
13 | echo "TESTING: machine-id (test/environment/machineid.exp)" | ||
14 | ./machineid.exp | ||
15 | |||
16 | echo "TESTING: hosts file (test/environment/hostfile.exp)" | ||
17 | ./hostfile.exp | ||
18 | |||
13 | echo "TESTING: doubledash (test/environment/doubledash.exp" | 19 | echo "TESTING: doubledash (test/environment/doubledash.exp" |
14 | mkdir -- -testdir | 20 | mkdir -- -testdir |
15 | touch -- -testdir/ttt | 21 | touch -- -testdir/ttt |
diff --git a/test/environment/hostfile b/test/environment/hostfile new file mode 100644 index 000000000..913f90c13 --- /dev/null +++ b/test/environment/hostfile | |||
@@ -0,0 +1 @@ | |||
hostfile test | |||
diff --git a/test/environment/hostfile.exp b/test/environment/hostfile.exp new file mode 100755 index 000000000..06003f744 --- /dev/null +++ b/test/environment/hostfile.exp | |||
@@ -0,0 +1,32 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2017 Firejail Authors | ||
4 | # License GPL v2 | ||
5 | |||
6 | |||
7 | set timeout 10 | ||
8 | spawn $env(SHELL) | ||
9 | match_max 100000 | ||
10 | |||
11 | send -- "firejail --debug --hosts-file=hostfile\r" | ||
12 | expect { | ||
13 | timeout {puts "TESTING ERROR 1\n";exit} | ||
14 | "Loading user hosts file" | ||
15 | } | ||
16 | expect { | ||
17 | timeout {puts "TESTING ERROR 2\n";exit} | ||
18 | "Child process initialized" | ||
19 | } | ||
20 | after 100 | ||
21 | |||
22 | send -- "cat /etc/hosts\r" | ||
23 | expect { | ||
24 | timeout {puts "TESTING ERROR 3\n";exit} | ||
25 | "hostfile test" | ||
26 | } | ||
27 | |||
28 | send -- "exit\r" | ||
29 | after 100 | ||
30 | |||
31 | puts "\nall done\n" | ||
32 | |||
diff --git a/test/environment/machineid.exp b/test/environment/machineid.exp new file mode 100755 index 000000000..85510247b --- /dev/null +++ b/test/environment/machineid.exp | |||
@@ -0,0 +1,25 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2017 Firejail Authors | ||
4 | # License GPL v2 | ||
5 | |||
6 | |||
7 | set timeout 10 | ||
8 | spawn $env(SHELL) | ||
9 | match_max 100000 | ||
10 | |||
11 | send -- "firejail --debug --machine-id\r" | ||
12 | expect { | ||
13 | timeout {puts "TESTING ERROR 1\n";exit} | ||
14 | "Generating a new machine-id" | ||
15 | } | ||
16 | expect { | ||
17 | timeout {puts "TESTING ERROR 1\n";exit} | ||
18 | "Child process initialized" | ||
19 | } | ||
20 | after 100 | ||
21 | send -- "exit\r" | ||
22 | after 100 | ||
23 | |||
24 | puts "\nall done\n" | ||
25 | |||