aboutsummaryrefslogtreecommitdiffstats
path: root/test/environment
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2017-10-29 16:05:23 -0400
committerLibravatar netblue30 <netblue30@yahoo.com>2017-10-29 16:08:00 -0400
commit6ae4d342bdc0b11ae6966bd83a596d6ae77a7a5f (patch)
tree84572a5655239f39dbf180bbdde181cc15ea8c35 /test/environment
parentfix and harden various profiles (diff)
downloadfirejail-6ae4d342bdc0b11ae6966bd83a596d6ae77a7a5f.tar.gz
firejail-6ae4d342bdc0b11ae6966bd83a596d6ae77a7a5f.tar.zst
firejail-6ae4d342bdc0b11ae6966bd83a596d6ae77a7a5f.zip
--timeout testing and fixes (#1614)
Diffstat (limited to 'test/environment')
-rwxr-xr-xtest/environment/environment.sh3
-rwxr-xr-xtest/environment/timeout.exp31
2 files changed, 34 insertions, 0 deletions
diff --git a/test/environment/environment.sh b/test/environment/environment.sh
index 308d99871..844e90cb8 100755
--- a/test/environment/environment.sh
+++ b/test/environment/environment.sh
@@ -7,6 +7,9 @@ export MALLOC_CHECK_=3
7export MALLOC_PERTURB_=$(($RANDOM % 255 + 1)) 7export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))
8 8
9 9
10echo "TESTING: timeout (test/environment/timeout.exp)"
11./timeout.exp
12
10echo "TESTING: DNS (test/environment/dns.exp)" 13echo "TESTING: DNS (test/environment/dns.exp)"
11./dns.exp 14./dns.exp
12 15
diff --git a/test/environment/timeout.exp b/test/environment/timeout.exp
new file mode 100755
index 000000000..ac29c57ba
--- /dev/null
+++ b/test/environment/timeout.exp
@@ -0,0 +1,31 @@
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
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "time firejail --timeout=00:00:05\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 "Child process initialized"
14}
15sleep 1
16
17sleep 3
18send -- "env\r"
19expect {
20 timeout {puts "TESTING ERROR 1\n";exit}
21 "container=firejail"
22}
23
24expect {
25 timeout {puts "TESTING ERROR 2\n";exit}
26 "m5." {puts "5 seconds"}
27 "m6." {puts "6 seconds"}
28 "m7." {puts "7 seconds"}
29}
30
31puts "\nall done\n"