mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-21 06:45:29 -06:00
54 lines
1 KiB
Text
Executable file
54 lines
1 KiB
Text
Executable file
#!/usr/bin/expect -f
|
|
|
|
set timeout 10
|
|
spawn $env(SHELL)
|
|
match_max 100000
|
|
|
|
# testing private
|
|
send -- "firejail --profile=private.profile\r"
|
|
expect {
|
|
timeout {puts "TESTING ERROR 0\n";exit}
|
|
"Child process initialized"
|
|
}
|
|
sleep 1
|
|
|
|
send -- "ls -al;pwd\r"
|
|
expect {
|
|
timeout {puts "TESTING ERROR 0.1\n";exit}
|
|
"bashrc"
|
|
}
|
|
expect {
|
|
timeout {puts "TESTING ERROR 0.2\n";exit}
|
|
"home"
|
|
}
|
|
send -- "ls -al;pwd\r"
|
|
expect {
|
|
timeout {
|
|
# OpenSUSE doesn't use .Xauthority from user home directory
|
|
send -- "env | grep XAUTHORITY\r"
|
|
|
|
expect {
|
|
timeout {puts "TESTING ERROR 0.3\n";exit}
|
|
"/run/lightdm/netblue/xauthority"
|
|
}
|
|
}
|
|
".Xauthority"
|
|
}
|
|
expect {
|
|
timeout {puts "TESTING ERROR 0.4\n";exit}
|
|
[lindex $argv 0]
|
|
}
|
|
|
|
send -- "ls -al | wc -l;pwd\r"
|
|
expect {
|
|
timeout {puts "TESTING ERROR 1\n";exit}
|
|
"6" {puts "normal system\n";}
|
|
"5" {puts "OpenSUSE\n";}
|
|
}
|
|
expect {
|
|
timeout {puts "TESTING ERROR 2\n";exit}
|
|
"home"
|
|
}
|
|
|
|
puts "\nall done\n"
|
|
|