diff options
Diffstat (limited to 'test')
-rwxr-xr-x | test/nice.exp | 80 | ||||
-rw-r--r-- | test/nice.profile | 1 | ||||
-rwxr-xr-x | test/test.sh | 3 |
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 | |||
3 | set timeout 10 | ||
4 | spawn $env(SHELL) | ||
5 | match_max 100000 | ||
6 | |||
7 | send -- "firejail --nice=15\r" | ||
8 | expect { | ||
9 | timeout {puts "TESTING ERROR 0\n";exit} | ||
10 | "Child process initialized" | ||
11 | } | ||
12 | sleep 1 | ||
13 | |||
14 | send -- "top -b -n 1\r" | ||
15 | expect { | ||
16 | timeout {puts "TESTING ERROR 1\n";exit} | ||
17 | "netblue" | ||
18 | } | ||
19 | expect { | ||
20 | timeout {puts "TESTING ERROR 2\n";exit} | ||
21 | "15" | ||
22 | } | ||
23 | expect { | ||
24 | timeout {puts "TESTING ERROR 3\n";exit} | ||
25 | "bash" | ||
26 | } | ||
27 | expect { | ||
28 | timeout {puts "TESTING ERROR 4\n";exit} | ||
29 | "netblu" | ||
30 | } | ||
31 | expect { | ||
32 | timeout {puts "TESTING ERROR 5\n";exit} | ||
33 | "15" | ||
34 | } | ||
35 | expect { | ||
36 | timeout {puts "TESTING ERROR 6\n";exit} | ||
37 | "top" | ||
38 | } | ||
39 | |||
40 | sleep 1 | ||
41 | send -- "exit\r" | ||
42 | sleep 1 | ||
43 | |||
44 | send -- "firejail --profile=nice.profile\r" | ||
45 | expect { | ||
46 | timeout {puts "TESTING ERROR 10\n";exit} | ||
47 | "Child process initialized" | ||
48 | } | ||
49 | sleep 1 | ||
50 | |||
51 | send -- "top -b -n 1\r" | ||
52 | expect { | ||
53 | timeout {puts "TESTING ERROR 11\n";exit} | ||
54 | "netblue" | ||
55 | } | ||
56 | expect { | ||
57 | timeout {puts "TESTING ERROR 12\n";exit} | ||
58 | "15" | ||
59 | } | ||
60 | expect { | ||
61 | timeout {puts "TESTING ERROR 13\n";exit} | ||
62 | "bash" | ||
63 | } | ||
64 | expect { | ||
65 | timeout {puts "TESTING ERROR 14\n";exit} | ||
66 | "netblu" | ||
67 | } | ||
68 | expect { | ||
69 | timeout {puts "TESTING ERROR 15\n";exit} | ||
70 | "15" | ||
71 | } | ||
72 | expect { | ||
73 | timeout {puts "TESTING ERROR 16\n";exit} | ||
74 | "top" | ||
75 | } | ||
76 | |||
77 | |||
78 | |||
79 | puts "\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 | ||
9 | echo "TESTING: nice" | ||
10 | ./nice.exp | ||
11 | |||
9 | echo "TESTING: protocol" | 12 | echo "TESTING: protocol" |
10 | ./protocol.exp | 13 | ./protocol.exp |
11 | 14 | ||