aboutsummaryrefslogtreecommitdiffstats
path: root/test/root
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
parenttesting (diff)
downloadfirejail-e7fbd682f8ab04f3f505c1bcfa165295739e06dc.tar.gz
firejail-e7fbd682f8ab04f3f505c1bcfa165295739e06dc.tar.zst
firejail-e7fbd682f8ab04f3f505c1bcfa165295739e06dc.zip
testing
Diffstat (limited to 'test/root')
-rwxr-xr-xtest/root/cgroup.exp61
-rwxr-xr-xtest/root/root.sh7
2 files changed, 66 insertions, 2 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"
diff --git a/test/root/root.sh b/test/root/root.sh
index 82fdc90b5..406e7dc4f 100755
--- a/test/root/root.sh
+++ b/test/root/root.sh
@@ -1,7 +1,7 @@
1#!/bin/bash 1#!/bin/bash
2 2
3# set a new firejail config file 3# set a new firejail config file
4cp firejail.config /etc/firejail/firejail.config 4#cp firejail.config /etc/firejail/firejail.config
5 5
6#******************************** 6#********************************
7# servers 7# servers
@@ -84,6 +84,9 @@ echo "TESTING: firejail configuration (test/root/checkcfg.exp)"
84./checkcfg.exp 84./checkcfg.exp
85cp ../../etc/firejail.config /etc/firejail/. 85cp ../../etc/firejail.config /etc/firejail/.
86 86
87echo "TESTING: cgroup (test/root/cgroup.exp)"
88./cgroup.exp
89
87echo "TESTING: tmpfs (test/root/option_tmpfs.exp)" 90echo "TESTING: tmpfs (test/root/option_tmpfs.exp)"
88./option_tmpfs.exp 91./option_tmpfs.exp
89 92
@@ -117,5 +120,5 @@ else
117fi 120fi
118 121
119# restore the default config file 122# restore the default config file
120cp ../../etc/firejail.config /etc/firejail/firejail.config 123#cp ../../etc/firejail.config /etc/firejail/firejail.config
121 124