diff options
Diffstat (limited to 'test/environment/nice.exp')
-rwxr-xr-x | test/environment/nice.exp | 83 |
1 files changed, 83 insertions, 0 deletions
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 | |||