summaryrefslogtreecommitdiffstats
path: root/test/fs/private-home.exp
blob: de5a88dead79e7c18120b2fcb13107c68d26503d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/expect -f
# This file is part of Firejail project
# Copyright (C) 2014-2016 Firejail Authors
# License GPL v2

set timeout 10
spawn $env(SHELL)
match_max 100000

# create some test files in user home directory
send -- "touch ~/_firejail_test_file1\r"
send -- "touch ~/_firejail_test_file2\r"
send -- "mkdir ~/_firejail_test_dir1\r"
send -- "mkdir ~/_firejail_test_dir1/_firejail_test_dir2\r"
send -- "touch ~/_firejail_test_dir1/_firejail_test_dir2/_firejail_test_file3\r"
after 100

send -- "firejail --private-home=_firejail_test_file1,_firejail_test_file2,_firejail_test_dir1\r"
expect {
	timeout {puts "TESTING ERROR 1\n";exit}
	"Child process initialized"
}
after 100

send -- "find ~\r"
expect {
	timeout {puts "TESTING ERROR 2\n";exit}
	"_firejail_test_file3"
}
expect {
	timeout {puts "TESTING ERROR 3\n";exit}
	"_firejail_test_file2"
}
expect {
	timeout {puts "TESTING ERROR 4\n";exit}
	"_firejail_test_file1"
}
after 100

send -- "rm -f ~/_firejail_test_file*\r"
send -- "rm -fr ~/_firejail_test_dir*\r"
after 100

puts "\nall done\n"