diff options
author | netblue30 <netblue30@yahoo.com> | 2016-03-09 09:51:47 -0500 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2016-03-09 09:51:47 -0500 |
commit | dc3564b18f1eafde1ccf46e722f8c2a9c1ee8555 (patch) | |
tree | 6178c2c6fc5912a63f5d54b1e3562d7049270418 /test | |
parent | fs work (diff) | |
download | firejail-dc3564b18f1eafde1ccf46e722f8c2a9c1ee8555.tar.gz firejail-dc3564b18f1eafde1ccf46e722f8c2a9c1ee8555.tar.zst firejail-dc3564b18f1eafde1ccf46e722f8c2a9c1ee8555.zip |
fixes
Diffstat (limited to 'test')
-rwxr-xr-x | test/test.sh | 3 | ||||
-rwxr-xr-x | test/tty.exp | 97 |
2 files changed, 100 insertions, 0 deletions
diff --git a/test/test.sh b/test/test.sh index d7e9e2aed..0ef816717 100755 --- a/test/test.sh +++ b/test/test.sh | |||
@@ -9,6 +9,9 @@ | |||
9 | echo "TESTING: nice (nice.exp)" | 9 | echo "TESTING: nice (nice.exp)" |
10 | ./nice.exp | 10 | ./nice.exp |
11 | 11 | ||
12 | echo "TESTING: tty (tty.exp)" | ||
13 | ./tty.exp | ||
14 | |||
12 | echo "TESTING: protocol (protocol.exp)" | 15 | echo "TESTING: protocol (protocol.exp)" |
13 | ./protocol.exp | 16 | ./protocol.exp |
14 | 17 | ||
diff --git a/test/tty.exp b/test/tty.exp new file mode 100755 index 000000000..116f297b2 --- /dev/null +++ b/test/tty.exp | |||
@@ -0,0 +1,97 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | |||
3 | set timeout 10 | ||
4 | spawn $env(SHELL) | ||
5 | match_max 100000 | ||
6 | |||
7 | send -- "firejail\r" | ||
8 | expect { | ||
9 | timeout {puts "TESTING ERROR 0\n";exit} | ||
10 | "Child process initialized" | ||
11 | } | ||
12 | sleep 2 | ||
13 | send -- "xterm &\r" | ||
14 | sleep 2 | ||
15 | send -- "urxvt &\r" | ||
16 | sleep 2 | ||
17 | send -- "rxvt &\r" | ||
18 | sleep 2 | ||
19 | |||
20 | send -- "ps aux\r" | ||
21 | expect { | ||
22 | timeout {puts "TESTING ERROR 1\n";exit} | ||
23 | "USER" | ||
24 | } | ||
25 | expect { | ||
26 | timeout {puts "TESTING ERROR 2\n";exit} | ||
27 | "xterm" | ||
28 | } | ||
29 | expect { | ||
30 | timeout {puts "TESTING ERROR 3\n";exit} | ||
31 | "urxvt" | ||
32 | } | ||
33 | expect { | ||
34 | timeout {puts "TESTING ERROR 4\n";exit} | ||
35 | "rxvt" | ||
36 | } | ||
37 | expect { | ||
38 | timeout {puts "TESTING ERROR 5\n";exit} | ||
39 | "ps aux" | ||
40 | } | ||
41 | |||
42 | send -- "pkill xterm\r" | ||
43 | sleep 1 | ||
44 | send -- "pkill urxvt\r" | ||
45 | sleep 1 | ||
46 | send -- "pkill rxvt\r" | ||
47 | sleep 1 | ||
48 | send -- "exit\r" | ||
49 | sleep 2 | ||
50 | |||
51 | |||
52 | send -- "firejail --private-dev\r" | ||
53 | expect { | ||
54 | timeout {puts "TESTING ERROR 10\n";exit} | ||
55 | "Child process initialized" | ||
56 | } | ||
57 | sleep 2 | ||
58 | send -- "xterm &\r" | ||
59 | sleep 2 | ||
60 | send -- "urxvt &\r" | ||
61 | sleep 2 | ||
62 | send -- "rxvt &\r" | ||
63 | sleep 2 | ||
64 | |||
65 | send -- "ps aux\r" | ||
66 | expect { | ||
67 | timeout {puts "TESTING ERROR 11\n";exit} | ||
68 | "USER" | ||
69 | } | ||
70 | expect { | ||
71 | timeout {puts "TESTING ERROR 12\n";exit} | ||
72 | "xterm" | ||
73 | } | ||
74 | expect { | ||
75 | timeout {puts "TESTING ERROR 13\n";exit} | ||
76 | "urxvt" | ||
77 | } | ||
78 | expect { | ||
79 | timeout {puts "TESTING ERROR 14\n";exit} | ||
80 | "rxvt" | ||
81 | } | ||
82 | expect { | ||
83 | timeout {puts "TESTING ERROR 15\n";exit} | ||
84 | "ps aux" | ||
85 | } | ||
86 | |||
87 | send -- "pkill xterm\r" | ||
88 | sleep 1 | ||
89 | send -- "pkill urxvt\r" | ||
90 | sleep 1 | ||
91 | send -- "pkill rxvt\r" | ||
92 | sleep 1 | ||
93 | send -- "exit\r" | ||
94 | sleep 2 | ||
95 | |||
96 | puts "\n" | ||
97 | |||