summaryrefslogtreecommitdiffstats
path: root/test/fs/private-cwd.exp
diff options
context:
space:
mode:
Diffstat (limited to 'test/fs/private-cwd.exp')
-rwxr-xr-xtest/fs/private-cwd.exp52
1 files changed, 52 insertions, 0 deletions
diff --git a/test/fs/private-cwd.exp b/test/fs/private-cwd.exp
new file mode 100755
index 000000000..0fa87a92f
--- /dev/null
+++ b/test/fs/private-cwd.exp
@@ -0,0 +1,52 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2019 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "cd /tmp\r"
11after 100
12
13# testing profile and private
14send -- "firejail --private-cwd\r"
15expect {
16 timeout {puts "TESTING ERROR 0\n";exit}
17 "Child process initialized"
18}
19sleep 1
20
21send -- "pwd\r"
22expect {
23 timeout {puts "TESTING ERROR 1\n";exit}
24 "$env(HOME)"
25}
26after 100
27
28send -- "exit\r"
29sleep 1
30
31send -- "cd /\r"
32after 100
33
34# testing profile and private
35send -- "firejail --private-cwd=/tmp\r"
36expect {
37 timeout {puts "TESTING ERROR 3\n";exit}
38 "Child process initialized"
39}
40sleep 1
41
42send -- "pwd\r"
43expect {
44 timeout {puts "TESTING ERROR 4\n";exit}
45 "/tmp"
46}
47after 100
48
49send -- "exit\r"
50sleep 1
51
52puts "all done\n"