aboutsummaryrefslogtreecommitdiffstats
path: root/test/fs/fs_var_lock.exp
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2016-05-05 10:22:18 -0400
committerLibravatar netblue30 <netblue30@yahoo.com>2016-05-05 10:22:18 -0400
commit37a5a3545ef6d8d03dad8bbd888f53e13274c9e5 (patch)
tree5d56a4b0a0933963d97eb0a88dd00fec9ea58bf2 /test/fs/fs_var_lock.exp
parentrename generic.profile as default.profile (diff)
downloadfirejail-37a5a3545ef6d8d03dad8bbd888f53e13274c9e5.tar.gz
firejail-37a5a3545ef6d8d03dad8bbd888f53e13274c9e5.tar.zst
firejail-37a5a3545ef6d8d03dad8bbd888f53e13274c9e5.zip
testing
Diffstat (limited to 'test/fs/fs_var_lock.exp')
-rwxr-xr-xtest/fs/fs_var_lock.exp90
1 files changed, 90 insertions, 0 deletions
diff --git a/test/fs/fs_var_lock.exp b/test/fs/fs_var_lock.exp
new file mode 100755
index 000000000..0e2b3181a
--- /dev/null
+++ b/test/fs/fs_var_lock.exp
@@ -0,0 +1,90 @@
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
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10# testing read-write /var/lock
11send -- "firejail\r"
12expect {
13 timeout {puts "TESTING ERROR 0\n";exit}
14 "Child process initialized"
15}
16sleep 1
17
18send -- "echo mytest > /var/lock/ttt;echo done\r"
19expect {
20 timeout {puts "TESTING ERROR 1\n";exit}
21 "done"
22}
23
24send -- "cat /var/lock/ttt;echo done\r"
25expect {
26 timeout {puts "TESTING ERROR 2\n";exit}
27 "mytest"
28}
29expect {
30 timeout {puts "TESTING ERROR 3\n";exit}
31 "done"
32}
33
34send -- "rm /var/lock/ttt;echo done\r"
35expect {
36 timeout {puts "TESTING ERROR 4\n";exit}
37 "done"
38}
39
40send -- "cat /var/lock/ttt;echo done\r"
41expect {
42 timeout {puts "TESTING ERROR 5\n";exit}
43 "mytest" {puts "TESTING ERROR 6\n";exit}
44 "done"
45}
46
47sleep 1
48send -- "exit\r"
49sleep 1
50
51# redo the test with --private
52send -- "firejail\r"
53expect {
54 timeout {puts "TESTING ERROR 7\n";exit}
55 "Child process initialized"
56}
57sleep 1
58
59send -- "echo mytest > /var/lock/ttt;echo done\r"
60expect {
61 timeout {puts "TESTING ERROR 8\n";exit}
62 "done"
63}
64
65send -- "cat /var/lock/ttt;echo done\r"
66expect {
67 timeout {puts "TESTING ERROR 9\n";exit}
68 "mytest"
69}
70expect {
71 timeout {puts "TESTING ERROR 10\n";exit}
72 "done"
73}
74
75send -- "rm /var/lock/ttt;echo done\r"
76expect {
77 timeout {puts "TESTING ERROR 11\n";exit}
78 "done"
79}
80
81send -- "cat /var/lock/ttt;echo done\r"
82expect {
83 timeout {puts "TESTING ERROR 12\n";exit}
84 "mytest" {puts "TESTING ERROR 13\n";exit}
85 "done"
86}
87
88sleep 1
89
90puts "\nall done\n"