diff options
Diffstat (limited to 'test/environment/sound.exp')
-rwxr-xr-x | test/environment/sound.exp | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/test/environment/sound.exp b/test/environment/sound.exp new file mode 100755 index 000000000..e2e8fb610 --- /dev/null +++ b/test/environment/sound.exp | |||
@@ -0,0 +1,83 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2016 Firejail Authors | ||
4 | # License GPL v2 | ||
5 | |||
6 | |||
7 | set timeout 10 | ||
8 | spawn $env(SHELL) | ||
9 | match_max 100000 | ||
10 | |||
11 | send -- "firejail --nosound speaker-test\r" | ||
12 | expect { | ||
13 | timeout {puts "TESTING ERROR 1\n";exit} | ||
14 | "Child process initialized" | ||
15 | } | ||
16 | expect { | ||
17 | timeout {puts "TESTING ERROR 2\n";exit} | ||
18 | "Parent is shutting down" | ||
19 | } | ||
20 | sleep 2 | ||
21 | |||
22 | send -- "firejail --nosound aplay -l\r" | ||
23 | expect { | ||
24 | timeout {puts "TESTING ERROR 3\n";exit} | ||
25 | "Child process initialized" | ||
26 | } | ||
27 | expect { | ||
28 | timeout {puts "TESTING ERROR 4\n";exit} | ||
29 | "List of PLAYBACK" {puts "TESTING ERROR 3\n";exit} | ||
30 | "no soundcards found" | ||
31 | } | ||
32 | expect { | ||
33 | timeout {puts "TESTING ERROR 5\n";exit} | ||
34 | "Parent is shutting down" | ||
35 | } | ||
36 | sleep 2 | ||
37 | |||
38 | |||
39 | send -- "firejail --profile=sound.profile speaker-test\r" | ||
40 | expect { | ||
41 | timeout {puts "TESTING ERROR 11\n";exit} | ||
42 | "Child process initialized" | ||
43 | } | ||
44 | expect { | ||
45 | timeout {puts "TESTING ERROR 12\n";exit} | ||
46 | "Parent is shutting down" | ||
47 | } | ||
48 | sleep 2 | ||
49 | |||
50 | send -- "firejail --profile=sound.profile aplay -l\r" | ||
51 | expect { | ||
52 | timeout {puts "TESTING ERROR 13\n";exit} | ||
53 | "Child process initialized" | ||
54 | } | ||
55 | expect { | ||
56 | timeout {puts "TESTING ERROR 14\n";exit} | ||
57 | "List of PLAYBACK" {puts "TESTING ERROR 3\n";exit} | ||
58 | "no soundcards found" | ||
59 | } | ||
60 | expect { | ||
61 | timeout {puts "TESTING ERROR 15\n";exit} | ||
62 | "Parent is shutting down" | ||
63 | } | ||
64 | sleep 2 | ||
65 | |||
66 | |||
67 | send -- "firejail aplay -l\r" | ||
68 | expect { | ||
69 | timeout {puts "TESTING ERROR 23\n";exit} | ||
70 | "Child process initialized" | ||
71 | } | ||
72 | expect { | ||
73 | timeout {puts "TESTING ERROR 24\n";exit} | ||
74 | "List of PLAYBACK" | ||
75 | } | ||
76 | expect { | ||
77 | timeout {puts "TESTING ERROR 25\n";exit} | ||
78 | "Parent is shutting down" | ||
79 | } | ||
80 | sleep 2 | ||
81 | |||
82 | puts "\nall done\n" | ||
83 | |||