aboutsummaryrefslogtreecommitdiffstats
path: root/test/environment
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2016-04-24 07:50:35 -0400
committerLibravatar netblue30 <netblue30@yahoo.com>2016-04-24 07:50:35 -0400
commita3207cdca569d78ee6a9723c7c0dfdf10cd15845 (patch)
treeb1925e299c26d57edc4b471a342f8e1d8accf186 /test/environment
parenttesting (diff)
downloadfirejail-a3207cdca569d78ee6a9723c7c0dfdf10cd15845.tar.gz
firejail-a3207cdca569d78ee6a9723c7c0dfdf10cd15845.tar.zst
firejail-a3207cdca569d78ee6a9723c7c0dfdf10cd15845.zip
testing
Diffstat (limited to 'test/environment')
-rwxr-xr-xtest/environment/environment.sh6
-rwxr-xr-xtest/environment/nice.exp83
-rw-r--r--test/environment/nice.profile1
-rwxr-xr-xtest/environment/sound.exp83
-rw-r--r--test/environment/sound.profile1
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
51echo "TESTING: firejail in firejail - force new sandbox (test/environment/firejail-in-firejail2.exp)" 51echo "TESTING: firejail in firejail - force new sandbox (test/environment/firejail-in-firejail2.exp)"
52./firejail-in-firejail2.exp 52./firejail-in-firejail2.exp
53
54echo "TESTING: sound (test/environment/sound.exp)"
55./sound.exp
56
57echo "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
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail --nice=15\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 "Child process initialized"
14}
15sleep 1
16
17send -- "top -b -n 1\r"
18expect {
19 timeout {puts "TESTING ERROR 1\n";exit}
20 "netblue"
21}
22expect {
23 timeout {puts "TESTING ERROR 2\n";exit}
24 "15"
25}
26expect {
27 timeout {puts "TESTING ERROR 3\n";exit}
28 "bash"
29}
30expect {
31 timeout {puts "TESTING ERROR 4\n";exit}
32 "netblu"
33}
34expect {
35 timeout {puts "TESTING ERROR 5\n";exit}
36 "15"
37}
38expect {
39 timeout {puts "TESTING ERROR 6\n";exit}
40 "top"
41}
42
43sleep 1
44send -- "exit\r"
45sleep 1
46
47send -- "firejail --profile=nice.profile\r"
48expect {
49 timeout {puts "TESTING ERROR 10\n";exit}
50 "Child process initialized"
51}
52sleep 1
53
54send -- "top -b -n 1\r"
55expect {
56 timeout {puts "TESTING ERROR 11\n";exit}
57 "netblue"
58}
59expect {
60 timeout {puts "TESTING ERROR 12\n";exit}
61 "15"
62}
63expect {
64 timeout {puts "TESTING ERROR 13\n";exit}
65 "bash"
66}
67expect {
68 timeout {puts "TESTING ERROR 14\n";exit}
69 "netblu"
70}
71expect {
72 timeout {puts "TESTING ERROR 15\n";exit}
73 "15"
74}
75expect {
76 timeout {puts "TESTING ERROR 16\n";exit}
77 "top"
78}
79
80
81
82puts "\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
7set timeout 10
8spawn $env(SHELL)
9match_max 100000
10
11send -- "firejail --nosound speaker-test\r"
12expect {
13 timeout {puts "TESTING ERROR 1\n";exit}
14 "Child process initialized"
15}
16expect {
17 timeout {puts "TESTING ERROR 2\n";exit}
18 "Parent is shutting down"
19}
20sleep 2
21
22send -- "firejail --nosound aplay -l\r"
23expect {
24 timeout {puts "TESTING ERROR 3\n";exit}
25 "Child process initialized"
26}
27expect {
28 timeout {puts "TESTING ERROR 4\n";exit}
29 "List of PLAYBACK" {puts "TESTING ERROR 3\n";exit}
30 "no soundcards found"
31}
32expect {
33 timeout {puts "TESTING ERROR 5\n";exit}
34 "Parent is shutting down"
35}
36sleep 2
37
38
39send -- "firejail --profile=sound.profile speaker-test\r"
40expect {
41 timeout {puts "TESTING ERROR 11\n";exit}
42 "Child process initialized"
43}
44expect {
45 timeout {puts "TESTING ERROR 12\n";exit}
46 "Parent is shutting down"
47}
48sleep 2
49
50send -- "firejail --profile=sound.profile aplay -l\r"
51expect {
52 timeout {puts "TESTING ERROR 13\n";exit}
53 "Child process initialized"
54}
55expect {
56 timeout {puts "TESTING ERROR 14\n";exit}
57 "List of PLAYBACK" {puts "TESTING ERROR 3\n";exit}
58 "no soundcards found"
59}
60expect {
61 timeout {puts "TESTING ERROR 15\n";exit}
62 "Parent is shutting down"
63}
64sleep 2
65
66
67send -- "firejail aplay -l\r"
68expect {
69 timeout {puts "TESTING ERROR 23\n";exit}
70 "Child process initialized"
71}
72expect {
73 timeout {puts "TESTING ERROR 24\n";exit}
74 "List of PLAYBACK"
75}
76expect {
77 timeout {puts "TESTING ERROR 25\n";exit}
78 "Parent is shutting down"
79}
80sleep 2
81
82puts "\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