diff options
author | netblue30 <netblue30@yahoo.com> | 2015-08-08 19:12:30 -0400 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2015-08-08 19:12:30 -0400 |
commit | 1379851360349d6617ad32944a25ee5e2bb74fc2 (patch) | |
tree | f69b48e90708bfa3c2723d5a27ed3e024c827b43 /test/fs_var_lock.exp | |
parent | delete files (diff) | |
download | firejail-1379851360349d6617ad32944a25ee5e2bb74fc2.tar.gz firejail-1379851360349d6617ad32944a25ee5e2bb74fc2.tar.zst firejail-1379851360349d6617ad32944a25ee5e2bb74fc2.zip |
Baseline firejail 0.9.28
Diffstat (limited to 'test/fs_var_lock.exp')
-rwxr-xr-x | test/fs_var_lock.exp | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/test/fs_var_lock.exp b/test/fs_var_lock.exp new file mode 100755 index 000000000..dfcf571f4 --- /dev/null +++ b/test/fs_var_lock.exp | |||
@@ -0,0 +1,87 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | |||
3 | set timeout 10 | ||
4 | spawn $env(SHELL) | ||
5 | match_max 100000 | ||
6 | |||
7 | # testing read-write /var/lock | ||
8 | send -- "firejail\r" | ||
9 | expect { | ||
10 | timeout {puts "TESTING ERROR 0\n";exit} | ||
11 | "Child process initialized" | ||
12 | } | ||
13 | sleep 1 | ||
14 | |||
15 | send -- "echo mytest > /var/lock/ttt;pwd\r" | ||
16 | expect { | ||
17 | timeout {puts "TESTING ERROR 1\n";exit} | ||
18 | "home" | ||
19 | } | ||
20 | |||
21 | send -- "cat /var/lock/ttt;pwd\r" | ||
22 | expect { | ||
23 | timeout {puts "TESTING ERROR 2.1\n";exit} | ||
24 | "mytest" | ||
25 | } | ||
26 | expect { | ||
27 | timeout {puts "TESTING ERROR 2\n";exit} | ||
28 | "home" | ||
29 | } | ||
30 | |||
31 | send -- "rm /var/lock/ttt;pwd\r" | ||
32 | expect { | ||
33 | timeout {puts "TESTING ERROR 3\n";exit} | ||
34 | "home" | ||
35 | } | ||
36 | |||
37 | send -- "cat /var/lock/ttt;pwd\r" | ||
38 | expect { | ||
39 | timeout {puts "TESTING ERROR 4\n";exit} | ||
40 | "mytest" {puts "TESTING ERROR 4.1\n";exit} | ||
41 | "home" | ||
42 | } | ||
43 | |||
44 | sleep 1 | ||
45 | send -- "exit\r" | ||
46 | sleep 1 | ||
47 | |||
48 | # redo the test with --private | ||
49 | send -- "firejail\r" | ||
50 | expect { | ||
51 | timeout {puts "TESTING ERROR 10\n";exit} | ||
52 | "Child process initialized" | ||
53 | } | ||
54 | sleep 1 | ||
55 | |||
56 | send -- "echo mytest > /var/lock/ttt;pwd\r" | ||
57 | expect { | ||
58 | timeout {puts "TESTING ERROR 11\n";exit} | ||
59 | "home" | ||
60 | } | ||
61 | |||
62 | send -- "cat /var/lock/ttt;pwd\r" | ||
63 | expect { | ||
64 | timeout {puts "TESTING ERROR 12.1\n";exit} | ||
65 | "mytest" | ||
66 | } | ||
67 | expect { | ||
68 | timeout {puts "TESTING ERROR 12\n";exit} | ||
69 | "home" | ||
70 | } | ||
71 | |||
72 | send -- "rm /var/lock/ttt;pwd\r" | ||
73 | expect { | ||
74 | timeout {puts "TESTING ERROR 13\n";exit} | ||
75 | "home" | ||
76 | } | ||
77 | |||
78 | send -- "cat /var/lock/ttt;pwd\r" | ||
79 | expect { | ||
80 | timeout {puts "TESTING ERROR 14\n";exit} | ||
81 | "mytest" {puts "TESTING ERROR 14.1\n";exit} | ||
82 | "home" | ||
83 | } | ||
84 | |||
85 | sleep 1 | ||
86 | |||
87 | puts "\n" | ||