firejail/test/environment/sound.exp
2018-01-15 09:46:44 -05:00

82 lines
1.6 KiB
Text
Executable file

#!/usr/bin/expect -f
# This file is part of Firejail project
# Copyright (C) 2014-2018 Firejail Authors
# License GPL v2
set timeout 10
spawn $env(SHELL)
match_max 100000
send -- "firejail --nosound speaker-test\r"
expect {
timeout {puts "TESTING ERROR 1\n";exit}
"Child process initialized"
}
expect {
timeout {puts "TESTING ERROR 2\n";exit}
"Parent is shutting down"
}
sleep 2
send -- "firejail --nosound aplay -l\r"
expect {
timeout {puts "TESTING ERROR 3\n";exit}
"Child process initialized"
}
expect {
timeout {puts "TESTING ERROR 4\n";exit}
"List of PLAYBACK" {puts "TESTING ERROR 3\n";exit}
"no soundcards found"
}
expect {
timeout {puts "TESTING ERROR 5\n";exit}
"Parent is shutting down"
}
sleep 2
send -- "firejail --profile=sound.profile speaker-test\r"
expect {
timeout {puts "TESTING ERROR 11\n";exit}
"Child process initialized"
}
expect {
timeout {puts "TESTING ERROR 12\n";exit}
"Parent is shutting down"
}
sleep 2
send -- "firejail --profile=sound.profile aplay -l\r"
expect {
timeout {puts "TESTING ERROR 13\n";exit}
"Child process initialized"
}
expect {
timeout {puts "TESTING ERROR 14\n";exit}
"List of PLAYBACK" {puts "TESTING ERROR 3\n";exit}
"no soundcards found"
}
expect {
timeout {puts "TESTING ERROR 15\n";exit}
"Parent is shutting down"
}
sleep 2
send -- "firejail aplay -l\r"
expect {
timeout {puts "TESTING ERROR 23\n";exit}
"Child process initialized"
}
expect {
timeout {puts "TESTING ERROR 24\n";exit}
"List of PLAYBACK"
}
expect {
timeout {puts "TESTING ERROR 25\n";exit}
"Parent is shutting down"
}
after 100
puts "\nall done\n"