firejail/test/tty.exp
2016-03-09 09:51:47 -05:00

97 lines
1.4 KiB
Text
Executable file

#!/usr/bin/expect -f
set timeout 10
spawn $env(SHELL)
match_max 100000
send -- "firejail\r"
expect {
timeout {puts "TESTING ERROR 0\n";exit}
"Child process initialized"
}
sleep 2
send -- "xterm &\r"
sleep 2
send -- "urxvt &\r"
sleep 2
send -- "rxvt &\r"
sleep 2
send -- "ps aux\r"
expect {
timeout {puts "TESTING ERROR 1\n";exit}
"USER"
}
expect {
timeout {puts "TESTING ERROR 2\n";exit}
"xterm"
}
expect {
timeout {puts "TESTING ERROR 3\n";exit}
"urxvt"
}
expect {
timeout {puts "TESTING ERROR 4\n";exit}
"rxvt"
}
expect {
timeout {puts "TESTING ERROR 5\n";exit}
"ps aux"
}
send -- "pkill xterm\r"
sleep 1
send -- "pkill urxvt\r"
sleep 1
send -- "pkill rxvt\r"
sleep 1
send -- "exit\r"
sleep 2
send -- "firejail --private-dev\r"
expect {
timeout {puts "TESTING ERROR 10\n";exit}
"Child process initialized"
}
sleep 2
send -- "xterm &\r"
sleep 2
send -- "urxvt &\r"
sleep 2
send -- "rxvt &\r"
sleep 2
send -- "ps aux\r"
expect {
timeout {puts "TESTING ERROR 11\n";exit}
"USER"
}
expect {
timeout {puts "TESTING ERROR 12\n";exit}
"xterm"
}
expect {
timeout {puts "TESTING ERROR 13\n";exit}
"urxvt"
}
expect {
timeout {puts "TESTING ERROR 14\n";exit}
"rxvt"
}
expect {
timeout {puts "TESTING ERROR 15\n";exit}
"ps aux"
}
send -- "pkill xterm\r"
sleep 1
send -- "pkill urxvt\r"
sleep 1
send -- "pkill rxvt\r"
sleep 1
send -- "exit\r"
sleep 2
puts "\n"