diff options
author | netblue30 <netblue30@yahoo.com> | 2016-04-24 07:50:35 -0400 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2016-04-24 07:50:35 -0400 |
commit | a3207cdca569d78ee6a9723c7c0dfdf10cd15845 (patch) | |
tree | b1925e299c26d57edc4b471a342f8e1d8accf186 /test/environment | |
parent | testing (diff) | |
download | firejail-a3207cdca569d78ee6a9723c7c0dfdf10cd15845.tar.gz firejail-a3207cdca569d78ee6a9723c7c0dfdf10cd15845.tar.zst firejail-a3207cdca569d78ee6a9723c7c0dfdf10cd15845.zip |
testing
Diffstat (limited to 'test/environment')
-rwxr-xr-x | test/environment/environment.sh | 6 | ||||
-rwxr-xr-x | test/environment/nice.exp | 83 | ||||
-rw-r--r-- | test/environment/nice.profile | 1 | ||||
-rwxr-xr-x | test/environment/sound.exp | 83 | ||||
-rw-r--r-- | test/environment/sound.profile | 1 |
5 files changed, 174 insertions, 0 deletions
diff --git a/test/environment/environment.sh b/test/environment/environment.sh index ef9b49d64..f737d284b 100755 --- a/test/environment/environment.sh +++ b/test/environment/environment.sh | |||
@@ -50,3 +50,9 @@ echo "TESTING: firejail in firejail - single sandbox (test/environment/firejail- | |||
50 | 50 | ||
51 | echo "TESTING: firejail in firejail - force new sandbox (test/environment/firejail-in-firejail2.exp)" | 51 | echo "TESTING: firejail in firejail - force new sandbox (test/environment/firejail-in-firejail2.exp)" |
52 | ./firejail-in-firejail2.exp | 52 | ./firejail-in-firejail2.exp |
53 | |||
54 | echo "TESTING: sound (test/environment/sound.exp)" | ||
55 | ./sound.exp | ||
56 | |||
57 | echo "TESTING: nice ((test/environment/nice.exp)" | ||
58 | ./nice.exp | ||
diff --git a/test/environment/nice.exp b/test/environment/nice.exp new file mode 100755 index 000000000..7e5731c63 --- /dev/null +++ b/test/environment/nice.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 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | send -- "firejail --nice=15\r" | ||
11 | expect { | ||
12 | timeout {puts "TESTING ERROR 0\n";exit} | ||
13 | "Child process initialized" | ||
14 | } | ||
15 | sleep 1 | ||
16 | |||
17 | send -- "top -b -n 1\r" | ||
18 | expect { | ||
19 | timeout {puts "TESTING ERROR 1\n";exit} | ||
20 | "netblue" | ||
21 | } | ||
22 | expect { | ||
23 | timeout {puts "TESTING ERROR 2\n";exit} | ||
24 | "15" | ||
25 | } | ||
26 | expect { | ||
27 | timeout {puts "TESTING ERROR 3\n";exit} | ||
28 | "bash" | ||
29 | } | ||
30 | expect { | ||
31 | timeout {puts "TESTING ERROR 4\n";exit} | ||
32 | "netblu" | ||
33 | } | ||
34 | expect { | ||
35 | timeout {puts "TESTING ERROR 5\n";exit} | ||
36 | "15" | ||
37 | } | ||
38 | expect { | ||
39 | timeout {puts "TESTING ERROR 6\n";exit} | ||
40 | "top" | ||
41 | } | ||
42 | |||
43 | sleep 1 | ||
44 | send -- "exit\r" | ||
45 | sleep 1 | ||
46 | |||
47 | send -- "firejail --profile=nice.profile\r" | ||
48 | expect { | ||
49 | timeout {puts "TESTING ERROR 10\n";exit} | ||
50 | "Child process initialized" | ||
51 | } | ||
52 | sleep 1 | ||
53 | |||
54 | send -- "top -b -n 1\r" | ||
55 | expect { | ||
56 | timeout {puts "TESTING ERROR 11\n";exit} | ||
57 | "netblue" | ||
58 | } | ||
59 | expect { | ||
60 | timeout {puts "TESTING ERROR 12\n";exit} | ||
61 | "15" | ||
62 | } | ||
63 | expect { | ||
64 | timeout {puts "TESTING ERROR 13\n";exit} | ||
65 | "bash" | ||
66 | } | ||
67 | expect { | ||
68 | timeout {puts "TESTING ERROR 14\n";exit} | ||
69 | "netblu" | ||
70 | } | ||
71 | expect { | ||
72 | timeout {puts "TESTING ERROR 15\n";exit} | ||
73 | "15" | ||
74 | } | ||
75 | expect { | ||
76 | timeout {puts "TESTING ERROR 16\n";exit} | ||
77 | "top" | ||
78 | } | ||
79 | |||
80 | |||
81 | |||
82 | puts "\nall done\n" | ||
83 | |||
diff --git a/test/environment/nice.profile b/test/environment/nice.profile new file mode 100644 index 000000000..d02c8f58b --- /dev/null +++ b/test/environment/nice.profile | |||
@@ -0,0 +1 @@ | |||
nice 15 | |||
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 | |||
diff --git a/test/environment/sound.profile b/test/environment/sound.profile new file mode 100644 index 000000000..2f83a0bbb --- /dev/null +++ b/test/environment/sound.profile | |||
@@ -0,0 +1 @@ | |||
nosound | |||