aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLibravatar startx2017 <vradu.startx@yandex.com>2018-05-14 09:34:21 -0400
committerLibravatar startx2017 <vradu.startx@yandex.com>2018-05-14 09:34:21 -0400
commit2626263c69d8b0e9628da7cbc06b635b4bf2ef06 (patch)
tree7ec6da512b60f68705b97cc614b05c43a5b1610c /test
parentkrita.profile: allow python (diff)
downloadfirejail-2626263c69d8b0e9628da7cbc06b635b4bf2ef06.tar.gz
firejail-2626263c69d8b0e9628da7cbc06b635b4bf2ef06.tar.zst
firejail-2626263c69d8b0e9628da7cbc06b635b4bf2ef06.zip
remove unused files
Diffstat (limited to 'test')
-rwxr-xr-xtest/chk_config.exp85
-rwxr-xr-xtest/configure69
-rwxr-xr-xtest/firemon-cgroup.exp39
-rwxr-xr-xtest/fs_chroot_asroot.exp90
-rwxr-xr-xtest/fs_home_sanitize.exp32
-rwxr-xr-xtest/fs_sys.exp33
-rwxr-xr-xtest/fscheck-blacklist.exp13
-rwxr-xr-xtest/fscheck-chroot.exp77
-rwxr-xr-xtest/fscheck-netfilter.exp69
-rwxr-xr-xtest/fscheck-output.exp104
-rwxr-xr-xtest/fscheck-privatekeep.exp93
-rwxr-xr-xtest/fscheck-profile.exp69
-rwxr-xr-xtest/fscheck-shell.exp69
-rwxr-xr-xtest/fscheck.sh39
-rwxr-xr-xtest/option_chroot_overlay.exp22
-rwxr-xr-xtest/option_readonly.exp25
-rw-r--r--test/private-keep.profile1
-rw-r--r--test/private.profile1
-rwxr-xr-xtest/private_dir.exp53
-rwxr-xr-xtest/private_dir_profile.exp53
-rw-r--r--test/test.rv49
-rwxr-xr-xtest/test.sh69
-rwxr-xr-xtest/tty.exp96
23 files changed, 0 insertions, 1250 deletions
diff --git a/test/chk_config.exp b/test/chk_config.exp
deleted file mode 100755
index f47fd0eee..000000000
--- a/test/chk_config.exp
+++ /dev/null
@@ -1,85 +0,0 @@
1#!/usr/bin/expect -f
2
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7# check br0
8send -- "/sbin/ifconfig;pwd\r"
9expect {
10 timeout {puts "TESTING ERROR 0 - please run ./configure\n";exit}
11 "br0"
12}
13expect {
14 timeout {puts "TESTING ERROR 0 - please run ./configure\n";exit}
15 "10.10.20.1"
16}
17expect {
18 timeout {puts "TESTING ERROR 0 - please run ./configure\n";exit}
19 "home"
20}
21
22# check br1
23send -- "/sbin/ifconfig;pwd\r"
24expect {
25 timeout {puts "TESTING ERROR 1\n";exit}
26 "br1"
27}
28expect {
29 timeout {puts "TESTING ERROR 1\n";exit}
30 "10.10.30.1"
31}
32expect {
33 timeout {puts "TESTING ERROR 1\n";exit}
34 "home"
35}
36
37# check br2
38send -- "/sbin/ifconfig;pwd\r"
39expect {
40 timeout {puts "TESTING ERROR 2\n";exit}
41 "br2"
42}
43expect {
44 timeout {puts "TESTING ERROR 2\n";exit}
45 "10.10.40.1"
46}
47expect {
48 timeout {puts "TESTING ERROR 2\n";exit}
49 "home"
50}
51
52# check br3
53send -- "/sbin/ifconfig;pwd\r"
54expect {
55 timeout {puts "TESTING ERROR 3\n";exit}
56 "br3"
57}
58expect {
59 timeout {puts "TESTING ERROR 3\n";exit}
60 "10.10.50.1"
61}
62expect {
63 timeout {puts "TESTING ERROR 3\n";exit}
64 "home"
65}
66
67# start a sandbox and check MALLOC_PERTURB
68send -- "firejail\r"
69expect {
70 timeout {puts "TESTING ERROR 4\n";exit}
71 "Child process initialized"
72}
73sleep 1
74
75set timeout 2
76send -- "env | grep MALLOC;pwd\r"
77expect {
78 timeout {puts "\nTESTING: MALLOC_PERTURB_ disabled\n"}
79 "MALLOC_PERTURB_" {puts "\nTESTING: MALLOC_PERTURB_ enabled\n"}
80}
81expect {
82 timeout {puts "TESTING ERROR 5\n";exit}
83 "home" {puts "regular user\n"}
84 "root" {puts "root user\n"}
85}
diff --git a/test/configure b/test/configure
deleted file mode 100755
index bb955670b..000000000
--- a/test/configure
+++ /dev/null
@@ -1,69 +0,0 @@
1#!/bin/bash
2
3brctl addbr br0
4ifconfig br0 10.10.20.1/29 up
5# NAT masquerade
6iptables -t nat -A POSTROUTING -o eth0 -s 10.10.20.0/29 -j MASQUERADE
7# port forwarding
8# iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to 10.10.20.2:80
9
10brctl addbr br1
11ifconfig br1 10.10.30.1/24 up
12brctl addbr br2
13ifconfig br2 10.10.40.1/24 up
14brctl addbr br3
15ifconfig br3 10.10.50.1/24 up
16brctl addbr br4
17ifconfig br4 10.10.60.1/24 up
18ip link add link eth0 name eth0.5 type vlan id 5
19/sbin/ifconfig eth0.5 10.10.205.10/24 up
20ip link add link eth0 name eth0.6 type vlan id 6
21/sbin/ifconfig eth0.6 10.10.206.10/24 up
22ip link add link eth0 name eth0.7 type vlan id 7
23/sbin/ifconfig eth0.7 10.10.207.10/24 up
24
25
26# build a very small chroot
27ROOTDIR="/tmp/chroot" # default chroot directory
28DEFAULT_FILES="/bin/bash /bin/sh " # basic chroot files
29DEFAULT_FILES+="/etc/passwd /etc/nsswitch.conf /etc/group "
30DEFAULT_FILES+=`find /lib -name libnss*` # files required by glibc
31DEFAULT_FILES+=" /bin/cp /bin/ls /bin/cat /bin/ps /bin/netstat /bin/ping /sbin/ifconfig /usr/bin/touch /bin/ip /bin/hostname /bin/grep /usr/bin/dig /usr/bin/openssl /usr/bin/id /usr/bin/getent /usr/bin/whoami /usr/bin/wc /usr/bin/wget /bin/umount"
32
33rm -fr $ROOTDIR
34mkdir -p $ROOTDIR/{root,bin,lib,lib64,usr,home,etc,dev/shm,tmp,var/run,var/tmp,var/lock,var/log,proc}
35chmod 777 $ROOTDIR/tmp
36mkdir -p $ROOTDIR/etc/firejail
37mkdir -p $ROOTDIR/home/netblue/.config/firejail
38chown netblue:netblue $ROOTDIR/home/netblue
39chown netblue:netblue $ROOTDIR/home/netblue/.config
40cp /home/netblue/.Xauthority $ROOTDIR/home/netblue/.
41cp -a /etc/skel $ROOTDIR/etc/.
42mkdir $ROOTDIR/home/someotheruser
43mkdir $ROOTDIR/boot
44mkdir $ROOTDIR/selinux
45cp /etc/passwd $ROOTDIR/etc/.
46cp /etc/group $ROOTDIR/etc/.
47cp /etc/hosts $ROOTDIR/etc/.
48cp /etc/hostname $ROOTDIR/etc/.
49mkdir -p $ROOTDIR/usr/lib/x86_64-linux-gnu
50cp -a /usr/lib/x86_64-linux-gnu/openssl-1.0.0 $ROOTDIR/usr/lib/x86_64-linux-gnu/.
51cp -a /usr/lib/ssl $ROOTDIR/usr/lib/.
52touch $ROOTDIR/var/log/syslog
53touch $ROOTDIR/var/tmp/somefile
54SORTED=`for FILE in $* $DEFAULT_FILES; do echo " $FILE "; ldd $FILE | grep -v dynamic | cut -d " " -f 3; done | sort -u`
55for FILE in $SORTED
56do
57 cp --parents $FILE $ROOTDIR
58done
59cp --parents /lib64/ld-linux-x86-64.so.2 $ROOTDIR
60cp --parents /lib/ld-linux.so.2 $ROOTDIR
61cp ../src/tools/unchroot $ROOTDIR/.
62touch $ROOTDIR/this-is-my-chroot
63
64cd $ROOTDIR; find .
65mkdir -p usr/lib/firejail/
66cp /usr/lib/firejail/libtrace.so usr/lib/firejail/.
67
68
69echo "To enter the chroot directory run: firejail --chroot=$ROOTDIR"
diff --git a/test/firemon-cgroup.exp b/test/firemon-cgroup.exp
deleted file mode 100755
index 482905bb3..000000000
--- a/test/firemon-cgroup.exp
+++ /dev/null
@@ -1,39 +0,0 @@
1#!/usr/bin/expect -f
2
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7send -- "firejail --name=bingo1 --cgroup=/sys/fs/cgroup/g1/tasks\r"
8expect {
9 timeout {puts "TESTING ERROR 0\n";exit}
10 "Child process initialized"
11}
12sleep 1
13
14spawn $env(SHELL)
15send -- "firejail --name=bingo2\r"
16expect {
17 timeout {puts "TESTING ERROR 0\n";exit}
18 "Child process initialized"
19}
20sleep 1
21
22
23spawn $env(SHELL)
24send -- "firemon --cgroup\r"
25expect {
26 timeout {puts "TESTING ERROR 1\n";exit}
27 "bingo1"
28}
29expect {
30 timeout {puts "TESTING ERROR 2\n";exit}
31 ":/g1"
32}
33expect {
34 timeout {puts "TESTING ERROR 3\n";exit}
35 "bingo2"
36}
37sleep 1
38
39puts "\n"
diff --git a/test/fs_chroot_asroot.exp b/test/fs_chroot_asroot.exp
deleted file mode 100755
index 000ce96f7..000000000
--- a/test/fs_chroot_asroot.exp
+++ /dev/null
@@ -1,90 +0,0 @@
1#!/usr/bin/expect -f
2
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7send -- "firejail --chroot=/tmp/chroot\r"
8expect {
9 timeout {puts "TESTING ERROR 0\n";exit}
10 "Child process initialized"
11}
12sleep 1
13
14send -- "cd /home;pwd\r"
15expect {
16 timeout {puts "TESTING ERROR 0.1\n";exit}
17 "home"
18}
19sleep 1
20send -- "bash\r"
21sleep 1
22send -- "ls /; pwd\r"
23expect {
24 timeout {puts "TESTING ERROR 0.2\n";exit}
25 "this-is-my-chroot"
26}
27expect {
28 timeout {puts "TESTING ERROR 0.3\n";exit}
29 "home"
30}
31
32send -- "umount /boot; pwd\r"
33expect {
34 timeout {puts "TESTING ERROR 0.4\n";exit}
35 "Bad system call"
36}
37expect {
38 timeout {puts "TESTING ERROR 0.5\n";exit}
39 "home"
40}
41
42send -- "/unchroot; pwd\r"
43expect {
44 timeout {puts "TESTING ERROR 0.6\n";exit}
45 "Bad system call"
46}
47expect {
48 timeout {puts "TESTING ERROR 0.7\n";exit}
49 "home"
50}
51
52
53
54
55
56send -- "ps aux; pwd\r"
57expect {
58 timeout {puts "TESTING ERROR 1\n";exit}
59 "/bin/bash"
60}
61expect {
62 timeout {puts "TESTING ERROR 2\n";exit}
63 "bash"
64}
65expect {
66 timeout {puts "TESTING ERROR 3\n";exit}
67 "ps aux"
68}
69expect {
70 timeout {puts "TESTING ERROR 4\n";exit}
71 "home"
72}
73sleep 1
74
75
76send -- "ps aux |wc -l; pwd\r"
77expect {
78 timeout {puts "TESTING ERROR 5\n";exit}
79 "6"
80}
81expect {
82 timeout {puts "TESTING ERROR 6\n";exit}
83 "home"
84}
85sleep 1
86
87
88
89
90puts "all done\n"
diff --git a/test/fs_home_sanitize.exp b/test/fs_home_sanitize.exp
deleted file mode 100755
index d661f9c7b..000000000
--- a/test/fs_home_sanitize.exp
+++ /dev/null
@@ -1,32 +0,0 @@
1#!/usr/bin/expect -f
2
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7send -- "firejail\r"
8expect {
9 timeout {puts "TESTING ERROR 0\n";exit}
10 "Child process initialized"
11}
12sleep 1
13
14send -- "ls /home;pwd\r"
15expect {
16 timeout {puts "TESTING ERROR 1\n";exit}
17 "bingo"
18}
19expect {
20 timeout {puts "TESTING ERROR 2\n";exit}
21 "home"
22}
23sleep 1
24
25send -- "ls /home/bingo;pwd\r"
26expect {
27 timeout {puts "TESTING ERROR 3\n";exit}
28 "cannot open directory"
29}
30sleep 1
31
32puts "\n"
diff --git a/test/fs_sys.exp b/test/fs_sys.exp
deleted file mode 100755
index 05023994c..000000000
--- a/test/fs_sys.exp
+++ /dev/null
@@ -1,33 +0,0 @@
1#!/usr/bin/expect -f
2
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7send -- "firejail --net=br0\r"
8expect {
9 timeout {puts "TESTING ERROR 1\n";exit}
10 "Child process initialized"
11}
12sleep 1
13
14send -- "find /sys | grep --color=never eth0;pwd\r"
15expect {
16 timeout {puts "TESTING ERROR 2\n";exit}
17 "/sys/class/net/eth0"
18}
19expect {
20 timeout {puts "TESTING ERROR 3\n";exit}
21 "home"
22}
23sleep 1
24
25send -- "find /sys | grep --color=never br0;pwd\r"
26expect {
27 timeout {puts "TESTING ERROR 4\n";exit}
28 "/sys/class/net/br0" {puts "TESTING ERROR 5\n";exit}
29 "home"
30}
31sleep 1
32
33puts "\n"
diff --git a/test/fscheck-blacklist.exp b/test/fscheck-blacklist.exp
deleted file mode 100755
index c71d1fdfd..000000000
--- a/test/fscheck-blacklist.exp
+++ /dev/null
@@ -1,13 +0,0 @@
1#!/usr/bin/expect -f
2
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7# dir
8send -- "firejail --net=br0 --blacklist=../test/fscheck-dir\r"
9expect {
10 timeout {puts "TESTING ERROR 0\n";exit}
11 "Error"
12}
13after 100
diff --git a/test/fscheck-chroot.exp b/test/fscheck-chroot.exp
deleted file mode 100755
index 00013e462..000000000
--- a/test/fscheck-chroot.exp
+++ /dev/null
@@ -1,77 +0,0 @@
1#!/usr/bin/expect -f
2
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7# dir
8#send -- "firejail --net=br0 --chroot=fscheck-dir\r"
9#expect {
10# timeout {puts "TESTING ERROR 0\n";exit}
11# "Error"
12#}
13#after 100
14
15# ..
16send -- "firejail --net=br0 --chroot=../test/fscheck-dir\r"
17expect {
18 timeout {puts "TESTING ERROR 0.1\n";exit}
19 "Error"
20}
21after 100
22
23# dir link
24send -- "firejail --net=br0 --chroot=fscheck-dir-link\r"
25expect {
26 timeout {puts "TESTING ERROR 1\n";exit}
27 "Error"
28}
29after 100
30
31# ..
32send -- "firejail --net=br0 --chroot=../test/fscheck-dir-link\r"
33expect {
34 timeout {puts "TESTING ERROR 1.1\n";exit}
35 "Error"
36}
37after 100
38
39# file link
40send -- "firejail --net=br0 --chroot=fscheck-file-link\r"
41expect {
42 timeout {puts "TESTING ERROR 2\n";exit}
43 "Error"
44}
45after 100
46
47# file
48send -- "firejail --net=br0 --chroot=fscheck-file\r"
49expect {
50 timeout {puts "TESTING ERROR 2.1\n";exit}
51 "Error"
52}
53after 100
54
55# ..
56send -- "firejail --net=br0 --chroot=../test/fscheck-file\r"
57expect {
58 timeout {puts "TESTING ERROR 2.2\n";exit}
59 "Error"
60}
61after 100
62
63# no file
64send -- "firejail --net=br0 --chroot=../test/nodir\r"
65expect {
66 timeout {puts "TESTING ERROR 3\n";exit}
67 "Error"
68}
69after 100
70
71# same owner
72#send -- "firejail --net=br0 --chroot=/etc\r"
73#expect {
74# timeout {puts "TESTING ERROR 4\n";exit}
75# "Error"
76#}
77#after 100
diff --git a/test/fscheck-netfilter.exp b/test/fscheck-netfilter.exp
deleted file mode 100755
index d2339c8b9..000000000
--- a/test/fscheck-netfilter.exp
+++ /dev/null
@@ -1,69 +0,0 @@
1#!/usr/bin/expect -f
2
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7# dir
8send -- "firejail --net=br0 --netfilter=fscheck-dir\r"
9expect {
10 timeout {puts "TESTING ERROR 0\n";exit}
11 "Error"
12}
13after 100
14
15# ..
16send -- "firejail --net=br0 --netfilter=../test/fscheck-dir\r"
17expect {
18 timeout {puts "TESTING ERROR 0.1\n";exit}
19 "Error"
20}
21after 100
22
23# dir link
24send -- "firejail --net=br0 --netfilter=fscheck-dir-link\r"
25expect {
26 timeout {puts "TESTING ERROR 1\n";exit}
27 "Error"
28}
29after 100
30
31# ..
32send -- "firejail --net=br0 --netfilter=../test/fscheck-dir-link\r"
33expect {
34 timeout {puts "TESTING ERROR 1.1\n";exit}
35 "Error"
36}
37after 100
38
39# file link
40send -- "firejail --net=br0 --netfilter=fscheck-file-link\r"
41expect {
42 timeout {puts "TESTING ERROR 2\n";exit}
43 "Error"
44}
45after 100
46
47# ..
48send -- "firejail --net=br0 --netfilter=../test/fscheck-file-link\r"
49expect {
50 timeout {puts "TESTING ERROR 2\n";exit}
51 "Error"
52}
53after 100
54
55# no file
56send -- "firejail --net=br0 --netfilter=../test/nofile\r"
57expect {
58 timeout {puts "TESTING ERROR 3\n";exit}
59 "Error"
60}
61after 100
62
63# real GID/UID
64send -- "firejail --net=br0 --netfilter=/etc/shadow\r"
65expect {
66 timeout {puts "TESTING ERROR 4\n";exit}
67 "Error"
68}
69after 100
diff --git a/test/fscheck-output.exp b/test/fscheck-output.exp
deleted file mode 100755
index 0b444d6ba..000000000
--- a/test/fscheck-output.exp
+++ /dev/null
@@ -1,104 +0,0 @@
1#!/usr/bin/expect -f
2
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7# dir
8send -- "firejail --net=br0 --output=fscheck-dir\r"
9expect {
10 timeout {puts "TESTING ERROR 0\n";exit}
11 "Error"
12}
13after 100
14
15# ..
16send -- "firejail --net=br0 --output=../test/fscheck-dir\r"
17expect {
18 timeout {puts "TESTING ERROR 0.1\n";exit}
19 "Error"
20}
21after 100
22
23# dir link
24send -- "firejail --net=br0 --output=fscheck-dir-link\r"
25expect {
26 timeout {puts "TESTING ERROR 1\n";exit}
27 "Error"
28}
29after 100
30
31# ..
32send -- "firejail --net=br0 --output=../test/fscheck-dir-link\r"
33expect {
34 timeout {puts "TESTING ERROR 1.1\n";exit}
35 "Error"
36}
37after 100
38
39# file link
40send -- "firejail --net=br0 --output=fscheck-file-link\r"
41expect {
42 timeout {puts "TESTING ERROR 2\n";exit}
43 "Error"
44}
45after 100
46
47# ..
48send -- "firejail --net=br0 --output=../test/fscheck-file-link\r"
49expect {
50 timeout {puts "TESTING ERROR 2.1\n";exit}
51 "Error"
52}
53after 100
54
55# hard link1
56send -- "firejail --net=br0 --output=fscheck-file-hard1\r"
57expect {
58 timeout {puts "TESTING ERROR 2.2\n";exit}
59 "Error"
60}
61after 100
62
63# hard link2
64send -- "firejail --net=br0 --output=fscheck-file-hard2\r"
65expect {
66 timeout {puts "TESTING ERROR 2.3\n";exit}
67 "Error"
68}
69after 100
70
71# ..
72send -- "firejail --net=br0 --output=../test/fscheck-file-hard1\r"
73expect {
74 timeout {puts "TESTING ERROR 2.4\n";exit}
75 "Error"
76}
77after 100
78
79# ..
80send -- "firejail --net=br0 --output=../test/fscheck-file-hard2\r"
81expect {
82 timeout {puts "TESTING ERROR 2.5\n";exit}
83 "Error"
84}
85after 100
86
87
88
89
90# no file
91send -- "firejail --net=br0 --output=../test/nofile\r"
92expect {
93 timeout {puts "TESTING ERROR 3\n";exit}
94 "Error"
95}
96after 100
97
98# real GID/UID
99send -- "firejail --net=br0 --output=/etc/shadow\r"
100expect {
101 timeout {puts "TESTING ERROR 4\n";exit}
102 "Error"
103}
104after 100
diff --git a/test/fscheck-privatekeep.exp b/test/fscheck-privatekeep.exp
deleted file mode 100755
index 6cbf98d96..000000000
--- a/test/fscheck-privatekeep.exp
+++ /dev/null
@@ -1,93 +0,0 @@
1#!/usr/bin/expect -f
2
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7# dir
8#send -- "firejail --net=br0 --private-home=fscheck-dir\r"
9#expect {
10# timeout {puts "TESTING ERROR 0\n";exit}
11# "Error"
12#}
13#after 100
14
15# ..
16send -- "firejail --net=br0 --private-home=../test/fscheck-dir\r"
17expect {
18 timeout {puts "TESTING ERROR 0.1\n";exit}
19 "Error"
20}
21after 100
22
23# dir link
24send -- "firejail --net=br0 --private-home=fscheck-dir-link\r"
25expect {
26 timeout {puts "TESTING ERROR 1\n";exit}
27 "Error"
28}
29after 100
30
31# ..
32send -- "firejail --net=br0 --private-home=../test/fscheck-dir-link\r"
33expect {
34 timeout {puts "TESTING ERROR 1.1\n";exit}
35 "Error"
36}
37after 100
38
39# file link
40send -- "firejail --net=br0 --private-home=fscheck-file-link\r"
41expect {
42 timeout {puts "TESTING ERROR 2\n";exit}
43 "Error"
44}
45after 100
46
47# file
48#send -- "firejail --net=br0 --private-home=fscheck-file\r"
49#expect {
50# timeout {puts "TESTING ERROR 2.1\n";exit}
51# "Error"
52#}
53#after 100
54
55# ..
56send -- "firejail --net=br0 --private-home=../test/fscheck-file\r"
57expect {
58 timeout {puts "TESTING ERROR 2.2\n";exit}
59 "Error"
60}
61after 100
62
63# no dir
64send -- "firejail --net=br0 --private-home=../test/nodir\r"
65expect {
66 timeout {puts "TESTING ERROR 3\n";exit}
67 "Error"
68}
69after 100
70
71# no file
72send -- "firejail --net=br0 --private-home=../test/nofile\r"
73expect {
74 timeout {puts "TESTING ERROR 3.1\n";exit}
75 "Error"
76}
77after 100
78
79# same owner
80send -- "firejail --net=br0 --private=/etc\r"
81expect {
82 timeout {puts "TESTING ERROR 4\n";exit}
83 "Error"
84}
85after 100
86
87# same owner
88send -- "firejail --net=br0 --private=/etc/shadow\r"
89expect {
90 timeout {puts "TESTING ERROR 4\n";exit}
91 "Error"
92}
93after 100
diff --git a/test/fscheck-profile.exp b/test/fscheck-profile.exp
deleted file mode 100755
index d7d7c7cd1..000000000
--- a/test/fscheck-profile.exp
+++ /dev/null
@@ -1,69 +0,0 @@
1#!/usr/bin/expect -f
2
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7# dir
8send -- "firejail --net=br0 --profile=fscheck-dir\r"
9expect {
10 timeout {puts "TESTING ERROR 0\n";exit}
11 "Error"
12}
13after 100
14
15# ..
16send -- "firejail --net=br0 --profile=../test/fscheck-dir\r"
17expect {
18 timeout {puts "TESTING ERROR 0.1\n";exit}
19 "Error"
20}
21after 100
22
23# dir link
24send -- "firejail --net=br0 --profile=fscheck-dir-link\r"
25expect {
26 timeout {puts "TESTING ERROR 1\n";exit}
27 "Error"
28}
29after 100
30
31# ..
32send -- "firejail --net=br0 --profile=../test/fscheck-dir-link\r"
33expect {
34 timeout {puts "TESTING ERROR 1.1\n";exit}
35 "Error"
36}
37after 100
38
39# file link
40send -- "firejail --net=br0 --profile=fscheck-file-link\r"
41expect {
42 timeout {puts "TESTING ERROR 2\n";exit}
43 "Error"
44}
45after 100
46
47# ..
48send -- "firejail --net=br0 --profile=../test/fscheck-file-link\r"
49expect {
50 timeout {puts "TESTING ERROR 2\n";exit}
51 "Error"
52}
53after 100
54
55# no file
56send -- "firejail --net=br0 --profile=../test/nofile\r"
57expect {
58 timeout {puts "TESTING ERROR 3\n";exit}
59 "Error"
60}
61after 100
62
63# real GID/UID
64send -- "firejail --net=br0 --profile=/etc/shadow\r"
65expect {
66 timeout {puts "TESTING ERROR 4\n";exit}
67 "Error"
68}
69after 100
diff --git a/test/fscheck-shell.exp b/test/fscheck-shell.exp
deleted file mode 100755
index 6a3b5829c..000000000
--- a/test/fscheck-shell.exp
+++ /dev/null
@@ -1,69 +0,0 @@
1#!/usr/bin/expect -f
2
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7# dir
8send -- "firejail --net=br0 --shell=fscheck-dir\r"
9expect {
10 timeout {puts "TESTING ERROR 0\n";exit}
11 "Error"
12}
13after 100
14
15# ..
16send -- "firejail --net=br0 --shell=../test/fscheck-dir\r"
17expect {
18 timeout {puts "TESTING ERROR 1\n";exit}
19 "Error"
20}
21after 100
22
23# dir link
24send -- "firejail --net=br0 --shell=fscheck-dir-link\r"
25expect {
26 timeout {puts "TESTING ERROR 2\n";exit}
27 "Error"
28}
29after 100
30
31# ..
32send -- "firejail --net=br0 --shell=../test/fscheck-dir-link\r"
33expect {
34 timeout {puts "TESTING ERROR 3\n";exit}
35 "Error"
36}
37after 100
38
39# file link
40#send -- "firejail --net=br0 --shell=fscheck-file-link\r"
41#expect {
42# timeout {puts "TESTING ERROR 4\n";exit}
43# "Error"
44#}
45#after 100
46
47# ..
48send -- "firejail --net=br0 --shell=../test/fscheck-file-link\r"
49expect {
50 timeout {puts "TESTING ERROR 5\n";exit}
51 "Error"
52}
53after 100
54
55# no file
56send -- "firejail --net=br0 --shell=../test/nofile\r"
57expect {
58 timeout {puts "TESTING ERROR 6\n";exit}
59 "Error"
60}
61after 100
62
63# real GID/UID
64send -- "firejail --net=br0 --shell=/etc/shadow\r"
65expect {
66 timeout {puts "TESTING ERROR 7\n";exit}
67 "Error"
68}
69after 100
diff --git a/test/fscheck.sh b/test/fscheck.sh
deleted file mode 100755
index 009f33043..000000000
--- a/test/fscheck.sh
+++ /dev/null
@@ -1,39 +0,0 @@
1#!/bin/bash
2
3mkdir fscheck-dir
4ln -s fscheck-dir fscheck-dir-link
5touch fscheck-file
6ln -s fscheck-file fscheck-file-link
7touch fscheck-file-hard1
8ln fscheck-file-hard1 fscheck-file-hard2
9
10echo "TESTING: fscheck netfilter"
11./fscheck-netfilter.exp
12echo "TESTING: fscheck shell"
13./fscheck-shell.exp
14echo "TESTING: fscheck private"
15./fscheck-private.exp
16echo "TESTING: fscheck private keep"
17./fscheck-privatekeep.exp
18echo "TESTING: fscheck profile"
19./fscheck-profile.exp
20echo "TESTING: fscheck chroot"
21./fscheck-chroot.exp
22echo "TESTING: fscheck output"
23./fscheck-output.exp
24echo "TESTING: fscheck bind nonroot"
25./fscheck-bindnoroot.exp
26echo "TESTING: fscheck tmpfs"
27./fscheck-tmpfs.exp
28echo "TESTING: fscheck readonly"
29./fscheck-readonly.exp
30echo "TESTING: fscheck blacklist"
31./fscheck-blacklist.exp
32
33
34rm -fr fscheck-dir
35rm -fr fscheck-dir-link
36rm -fr fscheck-file-link
37rm -fr fscheck-file
38rm -fr fscheck-file-hard1
39rm -fr fscheck-file-hard2
diff --git a/test/option_chroot_overlay.exp b/test/option_chroot_overlay.exp
deleted file mode 100755
index 08ffb1b43..000000000
--- a/test/option_chroot_overlay.exp
+++ /dev/null
@@ -1,22 +0,0 @@
1#!/usr/bin/expect -f
2
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7send -- "firejail --chroot=/tmp/chroot --overlay\r"
8expect {
9 timeout {puts "TESTING ERROR 0\n";exit}
10 "mutually exclusive" {puts "normal system\n"}
11 "Error: --chroot option is not available on Grsecurity systems" { puts "\nall done\n"; exit}
12}
13sleep 1
14
15send -- "firejail --overlay --chroot=/tmp/chroot\r"
16expect {
17 timeout {puts "TESTING ERROR 0\n";exit}
18 "mutually exclusive"
19}
20sleep 1
21
22puts "\n"
diff --git a/test/option_readonly.exp b/test/option_readonly.exp
deleted file mode 100755
index d776ed823..000000000
--- a/test/option_readonly.exp
+++ /dev/null
@@ -1,25 +0,0 @@
1#!/usr/bin/expect -f
2
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7send -- "firejail --read-only=tmpreadonly\r"
8expect {
9 timeout {puts "TESTING ERROR 0\n";exit}
10 "Child process initialized"
11}
12sleep 1
13
14send -- "touch tmpreadonly;pwd\r"
15expect {
16 timeout {puts "TESTING ERROR 1\n";exit}
17 "Read-only file system"
18}
19expect {
20 timeout {puts "TESTING ERROR 2\n";exit}
21 "home"
22}
23sleep 1
24
25puts "\n"
diff --git a/test/private-keep.profile b/test/private-keep.profile
deleted file mode 100644
index a968c4ce2..000000000
--- a/test/private-keep.profile
+++ /dev/null
@@ -1 +0,0 @@
1private-home .mozilla,.config/firejail
diff --git a/test/private.profile b/test/private.profile
deleted file mode 100644
index 1b947b6f7..000000000
--- a/test/private.profile
+++ /dev/null
@@ -1 +0,0 @@
1private ./dirprivate
diff --git a/test/private_dir.exp b/test/private_dir.exp
deleted file mode 100755
index a4beeba27..000000000
--- a/test/private_dir.exp
+++ /dev/null
@@ -1,53 +0,0 @@
1#!/usr/bin/expect -f
2
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7# testing private
8send -- "firejail --private=./dirprivate\r"
9expect {
10 timeout {puts "TESTING ERROR 0\n";exit}
11 "Child process initialized"
12}
13sleep 1
14
15send -- "ls -al;pwd\r"
16expect {
17 timeout {puts "TESTING ERROR 0.1\n";exit}
18 "bashrc"
19}
20expect {
21 timeout {puts "TESTING ERROR 0.2\n";exit}
22 "home"
23}
24send -- "ls -al;pwd\r"
25expect {
26 timeout {
27 # OpenSUSE doesn't use .Xauthority from user home directory
28 send -- "env | grep XAUTHORITY\r"
29
30 expect {
31 timeout {puts "TESTING ERROR 0.3\n";exit}
32 "/run/lightdm/netblue/xauthority"
33 }
34 }
35 ".Xauthority"
36}
37expect {
38 timeout {puts "TESTING ERROR 0.4\n";exit}
39 [lindex $argv 0]
40}
41
42send -- "ls -al | wc -l;pwd\r"
43expect {
44 timeout {puts "TESTING ERROR 1\n";exit}
45 "6" {puts "normal system\n";}
46 "5" {puts "OpenSUSE\n";}
47}
48expect {
49 timeout {puts "TESTING ERROR 2\n";exit}
50 "home"
51}
52
53puts "\n"
diff --git a/test/private_dir_profile.exp b/test/private_dir_profile.exp
deleted file mode 100755
index 7ba18aa69..000000000
--- a/test/private_dir_profile.exp
+++ /dev/null
@@ -1,53 +0,0 @@
1#!/usr/bin/expect -f
2
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7# testing private
8send -- "firejail --profile=private.profile\r"
9expect {
10 timeout {puts "TESTING ERROR 0\n";exit}
11 "Child process initialized"
12}
13sleep 1
14
15send -- "ls -al;pwd\r"
16expect {
17 timeout {puts "TESTING ERROR 0.1\n";exit}
18 "bashrc"
19}
20expect {
21 timeout {puts "TESTING ERROR 0.2\n";exit}
22 "home"
23}
24send -- "ls -al;pwd\r"
25expect {
26 timeout {
27 # OpenSUSE doesn't use .Xauthority from user home directory
28 send -- "env | grep XAUTHORITY\r"
29
30 expect {
31 timeout {puts "TESTING ERROR 0.3\n";exit}
32 "/run/lightdm/netblue/xauthority"
33 }
34 }
35 ".Xauthority"
36}
37expect {
38 timeout {puts "TESTING ERROR 0.4\n";exit}
39 [lindex $argv 0]
40}
41
42send -- "ls -al | wc -l;pwd\r"
43expect {
44 timeout {puts "TESTING ERROR 1\n";exit}
45 "6" {puts "normal system\n";}
46 "5" {puts "OpenSUSE\n";}
47}
48expect {
49 timeout {puts "TESTING ERROR 2\n";exit}
50 "home"
51}
52
53puts "\nall done\n"
diff --git a/test/test.rv b/test/test.rv
deleted file mode 100644
index 98a04fba2..000000000
--- a/test/test.rv
+++ /dev/null
@@ -1,49 +0,0 @@
1# run it as:
2# ../src/tools/rvtest test.rv 2>/dev/null | grep TESTING
3#
4
5
6# invalid options
71 firejail -blablabla
81 firejail --blablabla
91 firejail --debug --blablabla
10
11# misc options
120 firejail --help
130 firejail --list
14
15# network testing
160 firejail --net=none exit
171 firejail --ip=none --net=none exit # noip requires at least one network
180 firejail --net=br0 exit
191 firejail --net=none --net=br0 exit # --net and --net=none are mutually exclusive
201 firejail --ip=none exit # noip requires at least one network
211 firejail --defaultgw=10.10.20.1 # no bridge configured
220 firejail --net=br0 --ip=10.10.20.6 exit
231 firejail --net=br0 --ip=192.168.5.6 exit # interface range
241 firejail --net=br0 --ip=10.10 # bad ip
251 firejail --net=br0 --ip=asdf #bad ip
261 firejail --ip=asdf # no bridge configured
270 firejail --net=br0 --defaultgw=10.10.20.1 exit
281 firejail --net=br0 --defaultgw=10.10.20 exit # invalid ip address
291 firejail --net=br0 --defaultgw=asdf exit # invalid ip address
300 firejail --net=br0 --ip=10.10.20.2 --defaultgw=10.10.20.1 exit
310 firejail --net=br0 --net=br1 --net=br2 --net=br3 exit
321 firejail --net
331 firejail --net=
341 firejail --net=bingo
351 firejail --net=loopback
361 firejail --net=lo #invalid network device
371 firejail --net=/br0 exit
381 firejail --net=br0 --net=br1 --net=br2 --net=br3 --net=br4 exit # only 4 networks allowed
390 firejail --net=eth0 exit
401 firejail --net=/dev/eth0 exit
411 firejail --net=br0 --net=br1 --net=/dev/eth0 exit
420 firejail --net=br0 --net=br0 exit # same device twice
430 firejail --net=eth0 --net=br2 --net=br3 --net=eth0 exit # same device twice
440 firejail --net=eth0 --net=br0 exit
45
46# private mode
470 firejail --private exit
481 firejail --private=/etc sleep 1
491 firejail --private=bingo sleep 1
diff --git a/test/test.sh b/test/test.sh
deleted file mode 100755
index 756c25650..000000000
--- a/test/test.sh
+++ /dev/null
@@ -1,69 +0,0 @@
1#!/bin/bash
2# This file is part of Firejail project
3# Copyright (C) 2014-2018 Firejail Authors
4# License GPL v2
5
6./chk_config.exp
7
8./fscheck.sh
9
10echo "TESTING: tty (tty.exp)"
11./tty.exp
12
13sleep 1
14rm -fr dir\ with\ space
15mkdir dir\ with\ space
16echo "TESTING: blacklist (blacklist.exp)"
17./blacklist.exp
18sleep 1
19rm -fr dir\ with\ space
20
21ln -s auto auto2
22ln -s /bin auto3
23ln -s /usr/bin auto4
24echo "TESTING: blacklist directory link (blacklist-link.exp)"
25./blacklist-link.exp
26rm -fr auto2
27rm -fr auto3
28rm -fr auto4
29
30echo "TESTING: chroot overlay (option_chroot_overlay.exp)"
31./option_chroot_overlay.exp
32
33echo "TESTING: chroot as user (fs_chroot.exp)"
34./fs_chroot.exp
35
36echo "TESTING: /sys (fs_sys.exp)"
37./fs_sys.exp
38
39echo "TESTING: readonly (option_readonly.exp)"
40ls -al > tmpreadonly
41./option_readonly.exp
42sleep 5
43rm -f tmpreadonly
44
45
46
47echo "TESTING: private directory (private_dir.exp)"
48rm -fr dirprivate
49mkdir dirprivate
50./private_dir.exp
51rm -fr dirprivate
52
53echo "TESTING: private directory profile (private_dir_profile.exp)"
54rm -fr dirprivate
55mkdir dirprivate
56./private_dir_profile.exp
57rm -fr dirprivate
58
59echo "TESTING: overlayfs (fs_overlay.exp)"
60./fs_overlay.exp
61
62echo "TESTING: login SSH (login_ssh.exp)"
63./login_ssh.exp
64
65echo "TESTING: firemon --arp (firemon-arp.exp)"
66./firemon-arp.exp
67
68echo "TESTING: firemon --route (firemon-route.exp)"
69./firemon-route.exp
diff --git a/test/tty.exp b/test/tty.exp
deleted file mode 100755
index 0d66f5ce7..000000000
--- a/test/tty.exp
+++ /dev/null
@@ -1,96 +0,0 @@
1#!/usr/bin/expect -f
2
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7send -- "firejail\r"
8expect {
9 timeout {puts "TESTING ERROR 0\n";exit}
10 "Child process initialized"
11}
12sleep 2
13send -- "xterm &\r"
14sleep 2
15send -- "urxvt &\r"
16sleep 2
17send -- "rxvt &\r"
18sleep 2
19
20send -- "ps aux\r"
21expect {
22 timeout {puts "TESTING ERROR 1\n";exit}
23 "USER"
24}
25expect {
26 timeout {puts "TESTING ERROR 2\n";exit}
27 "xterm"
28}
29expect {
30 timeout {puts "TESTING ERROR 3\n";exit}
31 "urxvt"
32}
33expect {
34 timeout {puts "TESTING ERROR 4\n";exit}
35 "rxvt"
36}
37expect {
38 timeout {puts "TESTING ERROR 5\n";exit}
39 "ps aux"
40}
41
42send -- "pkill xterm\r"
43sleep 1
44send -- "pkill urxvt\r"
45sleep 1
46send -- "pkill rxvt\r"
47sleep 1
48send -- "exit\r"
49sleep 2
50
51
52send -- "firejail --private-dev\r"
53expect {
54 timeout {puts "TESTING ERROR 10\n";exit}
55 "Child process initialized"
56}
57sleep 2
58send -- "xterm &\r"
59sleep 2
60send -- "urxvt &\r"
61sleep 2
62send -- "rxvt &\r"
63sleep 2
64
65send -- "ps aux\r"
66expect {
67 timeout {puts "TESTING ERROR 11\n";exit}
68 "USER"
69}
70expect {
71 timeout {puts "TESTING ERROR 12\n";exit}
72 "xterm"
73}
74expect {
75 timeout {puts "TESTING ERROR 13\n";exit}
76 "urxvt"
77}
78expect {
79 timeout {puts "TESTING ERROR 14\n";exit}
80 "rxvt"
81}
82expect {
83 timeout {puts "TESTING ERROR 15\n";exit}
84 "ps aux"
85}
86
87send -- "pkill xterm\r"
88sleep 1
89send -- "pkill urxvt\r"
90sleep 1
91send -- "pkill rxvt\r"
92sleep 1
93send -- "exit\r"
94sleep 2
95
96puts "\n"