aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2016-02-11 09:03:35 -0500
committerLibravatar netblue30 <netblue30@yahoo.com>2016-02-11 09:03:35 -0500
commit8fdc4029ad9bd2489aa0266bbbcaefac4fb239d1 (patch)
tree24b29e51104c6bda6700f1771becf7f41cdcaba0 /test
parentfix problem with relative path in storage_find function (diff)
downloadfirejail-8fdc4029ad9bd2489aa0266bbbcaefac4fb239d1.tar.gz
firejail-8fdc4029ad9bd2489aa0266bbbcaefac4fb239d1.tar.zst
firejail-8fdc4029ad9bd2489aa0266bbbcaefac4fb239d1.zip
set sandbox nice value
Diffstat (limited to 'test')
-rwxr-xr-xtest/nice.exp80
-rw-r--r--test/nice.profile1
-rwxr-xr-xtest/test.sh3
3 files changed, 84 insertions, 0 deletions
diff --git a/test/nice.exp b/test/nice.exp
new file mode 100755
index 000000000..f4afb547d
--- /dev/null
+++ b/test/nice.exp
@@ -0,0 +1,80 @@
1#!/usr/bin/expect -f
2
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7send -- "firejail --nice=15\r"
8expect {
9 timeout {puts "TESTING ERROR 0\n";exit}
10 "Child process initialized"
11}
12sleep 1
13
14send -- "top -b -n 1\r"
15expect {
16 timeout {puts "TESTING ERROR 1\n";exit}
17 "netblue"
18}
19expect {
20 timeout {puts "TESTING ERROR 2\n";exit}
21 "15"
22}
23expect {
24 timeout {puts "TESTING ERROR 3\n";exit}
25 "bash"
26}
27expect {
28 timeout {puts "TESTING ERROR 4\n";exit}
29 "netblu"
30}
31expect {
32 timeout {puts "TESTING ERROR 5\n";exit}
33 "15"
34}
35expect {
36 timeout {puts "TESTING ERROR 6\n";exit}
37 "top"
38}
39
40sleep 1
41send -- "exit\r"
42sleep 1
43
44send -- "firejail --profile=nice.profile\r"
45expect {
46 timeout {puts "TESTING ERROR 10\n";exit}
47 "Child process initialized"
48}
49sleep 1
50
51send -- "top -b -n 1\r"
52expect {
53 timeout {puts "TESTING ERROR 11\n";exit}
54 "netblue"
55}
56expect {
57 timeout {puts "TESTING ERROR 12\n";exit}
58 "15"
59}
60expect {
61 timeout {puts "TESTING ERROR 13\n";exit}
62 "bash"
63}
64expect {
65 timeout {puts "TESTING ERROR 14\n";exit}
66 "netblu"
67}
68expect {
69 timeout {puts "TESTING ERROR 15\n";exit}
70 "15"
71}
72expect {
73 timeout {puts "TESTING ERROR 16\n";exit}
74 "top"
75}
76
77
78
79puts "\nall done\n"
80
diff --git a/test/nice.profile b/test/nice.profile
new file mode 100644
index 000000000..d02c8f58b
--- /dev/null
+++ b/test/nice.profile
@@ -0,0 +1 @@
nice 15
diff --git a/test/test.sh b/test/test.sh
index ca7152b55..923a9b390 100755
--- a/test/test.sh
+++ b/test/test.sh
@@ -6,6 +6,9 @@
6 6
7./fscheck.sh 7./fscheck.sh
8 8
9echo "TESTING: nice"
10./nice.exp
11
9echo "TESTING: protocol" 12echo "TESTING: protocol"
10./protocol.exp 13./protocol.exp
11 14