whitelist-empty.exp 960 Bytes
Newer Older
netblue30's avatar
netblue30 committed
1
#!/usr/bin/expect -f
netblue30's avatar
netblue30 committed
2
# This file is part of Firejail project
3
# Copyright (C) 2014-2019 Firejail Authors
netblue30's avatar
netblue30 committed
4
# License GPL v2
netblue30's avatar
netblue30 committed
5 6 7 8 9 10 11 12 13 14 15 16

set timeout 30
spawn $env(SHELL)
match_max 100000

send -- "firejail --whitelist=~/blablabla --whitelist=/tmp/blablabla --whitelist=/media/blablabla --whitelist=/var/blablabla --whitelist=/dev/blablabla --whitelist=/opt/blablabla\r"
expect {
	timeout {puts "TESTING ERROR 0\n";exit}
	"Child process initialized"
}
sleep 1

17
send -- "ls -l ~\r"
netblue30's avatar
netblue30 committed
18 19 20 21 22
expect {
	timeout {puts "TESTING ERROR 1\n";exit}
	"0"
}

23
send -- "ls -l /tmp\r"
netblue30's avatar
netblue30 committed
24 25 26 27 28
expect {
	timeout {puts "TESTING ERROR 2\n";exit}
	"0"
}

29
send -- "ls -l /media\r"
netblue30's avatar
netblue30 committed
30 31 32 33 34
expect {
	timeout {puts "TESTING ERROR 3\n";exit}
	"0"
}

35
send -- "ls -l /var\r"
netblue30's avatar
netblue30 committed
36 37 38 39 40
expect {
	timeout {puts "TESTING ERROR 4\n";exit}
	"0"
}

41
send -- "ls -l /dev\r"
netblue30's avatar
netblue30 committed
42 43 44 45
expect {
	timeout {puts "TESTING ERROR 5\n";exit}
	"0"
}
46
send -- "ls -l /opt\r"
netblue30's avatar
netblue30 committed
47 48 49 50 51
expect {
	timeout {puts "TESTING ERROR 6\n";exit}
	"0"
}

netblue30's avatar
netblue30 committed
52
after 100
netblue30's avatar
netblue30 committed
53 54

puts "\nall done\n"