aboutsummaryrefslogtreecommitdiffstats
path: root/test/root/cgroup.exp
diff options
context:
space:
mode:
authorLibravatar root <root@debian>2017-03-24 09:39:24 -0400
committerLibravatar root <root@debian>2017-03-24 09:39:24 -0400
commite7fbd682f8ab04f3f505c1bcfa165295739e06dc (patch)
tree59ae7cdbeb3fbc9a5573b26a328d2adf8056a57b /test/root/cgroup.exp
parenttesting (diff)
downloadfirejail-e7fbd682f8ab04f3f505c1bcfa165295739e06dc.tar.gz
firejail-e7fbd682f8ab04f3f505c1bcfa165295739e06dc.tar.zst
firejail-e7fbd682f8ab04f3f505c1bcfa165295739e06dc.zip
testing
Diffstat (limited to 'test/root/cgroup.exp')
-rwxr-xr-xtest/root/cgroup.exp61
1 files changed, 61 insertions, 0 deletions
diff --git a/test/root/cgroup.exp b/test/root/cgroup.exp
new file mode 100755
index 000000000..4b07183a1
--- /dev/null
+++ b/test/root/cgroup.exp
@@ -0,0 +1,61 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors
4# License GPL v2
5
6set timeout 10
7cd /home
8spawn $env(SHELL)
9match_max 100000
10
11
12send -- "mkdir /sys/fs/cgroup/systemd/firejail\r"
13sleep 1
14send -- "ls /sys/fs/cgroup/systemd/firejail\r"
15expect {
16 timeout {puts "TESTING ERROR 0\n";exit}
17 "tasks"
18}
19
20send -- "firejail --name=\"join testing\" --cgroup=/sys/fs/cgroup/systemd/firejail/tasks\r"
21expect {
22 timeout {puts "TESTING ERROR 1\n";exit}
23 "Child process initialized"
24}
25sleep 2
26
27spawn $env(SHELL)
28send -- "wc -l /sys/fs/cgroup/systemd/firejail/tasks\r"
29expect {
30 timeout {puts "TESTING ERROR 2\n";exit}
31 "3"
32}
33
34spawn $env(SHELL)
35send -- "firejail --join=\"join testing\"\r"
36expect {
37 timeout {puts "TESTING ERROR 3\n";exit}
38 "Switching to pid"
39}
40sleep 1
41send -- "ps aux\r"
42expect {
43 timeout {puts "TESTING ERROR 4\n";exit}
44 "/bin/bash"
45}
46expect {
47 timeout {puts "TESTING ERROR 5\n";exit}
48 "/bin/bash"
49}
50
51after 100
52
53spawn $env(SHELL)
54send -- "wc -l /sys/fs/cgroup/systemd/firejail/tasks\r"
55expect {
56 timeout {puts "TESTING ERROR 6\n";exit}
57 "3"
58}
59after 100
60
61puts "\nall done\n"