diff options
author | startx2017 <vradu.startx@yandex.com> | 2018-05-14 09:34:21 -0400 |
---|---|---|
committer | startx2017 <vradu.startx@yandex.com> | 2018-05-14 09:34:21 -0400 |
commit | 2626263c69d8b0e9628da7cbc06b635b4bf2ef06 (patch) | |
tree | 7ec6da512b60f68705b97cc614b05c43a5b1610c /test | |
parent | krita.profile: allow python (diff) | |
download | firejail-2626263c69d8b0e9628da7cbc06b635b4bf2ef06.tar.gz firejail-2626263c69d8b0e9628da7cbc06b635b4bf2ef06.tar.zst firejail-2626263c69d8b0e9628da7cbc06b635b4bf2ef06.zip |
remove unused files
Diffstat (limited to 'test')
-rwxr-xr-x | test/chk_config.exp | 85 | ||||
-rwxr-xr-x | test/configure | 69 | ||||
-rwxr-xr-x | test/firemon-cgroup.exp | 39 | ||||
-rwxr-xr-x | test/fs_chroot_asroot.exp | 90 | ||||
-rwxr-xr-x | test/fs_home_sanitize.exp | 32 | ||||
-rwxr-xr-x | test/fs_sys.exp | 33 | ||||
-rwxr-xr-x | test/fscheck-blacklist.exp | 13 | ||||
-rwxr-xr-x | test/fscheck-chroot.exp | 77 | ||||
-rwxr-xr-x | test/fscheck-netfilter.exp | 69 | ||||
-rwxr-xr-x | test/fscheck-output.exp | 104 | ||||
-rwxr-xr-x | test/fscheck-privatekeep.exp | 93 | ||||
-rwxr-xr-x | test/fscheck-profile.exp | 69 | ||||
-rwxr-xr-x | test/fscheck-shell.exp | 69 | ||||
-rwxr-xr-x | test/fscheck.sh | 39 | ||||
-rwxr-xr-x | test/option_chroot_overlay.exp | 22 | ||||
-rwxr-xr-x | test/option_readonly.exp | 25 | ||||
-rw-r--r-- | test/private-keep.profile | 1 | ||||
-rw-r--r-- | test/private.profile | 1 | ||||
-rwxr-xr-x | test/private_dir.exp | 53 | ||||
-rwxr-xr-x | test/private_dir_profile.exp | 53 | ||||
-rw-r--r-- | test/test.rv | 49 | ||||
-rwxr-xr-x | test/test.sh | 69 | ||||
-rwxr-xr-x | test/tty.exp | 96 |
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 | |||
3 | set timeout 10 | ||
4 | spawn $env(SHELL) | ||
5 | match_max 100000 | ||
6 | |||
7 | # check br0 | ||
8 | send -- "/sbin/ifconfig;pwd\r" | ||
9 | expect { | ||
10 | timeout {puts "TESTING ERROR 0 - please run ./configure\n";exit} | ||
11 | "br0" | ||
12 | } | ||
13 | expect { | ||
14 | timeout {puts "TESTING ERROR 0 - please run ./configure\n";exit} | ||
15 | "10.10.20.1" | ||
16 | } | ||
17 | expect { | ||
18 | timeout {puts "TESTING ERROR 0 - please run ./configure\n";exit} | ||
19 | "home" | ||
20 | } | ||
21 | |||
22 | # check br1 | ||
23 | send -- "/sbin/ifconfig;pwd\r" | ||
24 | expect { | ||
25 | timeout {puts "TESTING ERROR 1\n";exit} | ||
26 | "br1" | ||
27 | } | ||
28 | expect { | ||
29 | timeout {puts "TESTING ERROR 1\n";exit} | ||
30 | "10.10.30.1" | ||
31 | } | ||
32 | expect { | ||
33 | timeout {puts "TESTING ERROR 1\n";exit} | ||
34 | "home" | ||
35 | } | ||
36 | |||
37 | # check br2 | ||
38 | send -- "/sbin/ifconfig;pwd\r" | ||
39 | expect { | ||
40 | timeout {puts "TESTING ERROR 2\n";exit} | ||
41 | "br2" | ||
42 | } | ||
43 | expect { | ||
44 | timeout {puts "TESTING ERROR 2\n";exit} | ||
45 | "10.10.40.1" | ||
46 | } | ||
47 | expect { | ||
48 | timeout {puts "TESTING ERROR 2\n";exit} | ||
49 | "home" | ||
50 | } | ||
51 | |||
52 | # check br3 | ||
53 | send -- "/sbin/ifconfig;pwd\r" | ||
54 | expect { | ||
55 | timeout {puts "TESTING ERROR 3\n";exit} | ||
56 | "br3" | ||
57 | } | ||
58 | expect { | ||
59 | timeout {puts "TESTING ERROR 3\n";exit} | ||
60 | "10.10.50.1" | ||
61 | } | ||
62 | expect { | ||
63 | timeout {puts "TESTING ERROR 3\n";exit} | ||
64 | "home" | ||
65 | } | ||
66 | |||
67 | # start a sandbox and check MALLOC_PERTURB | ||
68 | send -- "firejail\r" | ||
69 | expect { | ||
70 | timeout {puts "TESTING ERROR 4\n";exit} | ||
71 | "Child process initialized" | ||
72 | } | ||
73 | sleep 1 | ||
74 | |||
75 | set timeout 2 | ||
76 | send -- "env | grep MALLOC;pwd\r" | ||
77 | expect { | ||
78 | timeout {puts "\nTESTING: MALLOC_PERTURB_ disabled\n"} | ||
79 | "MALLOC_PERTURB_" {puts "\nTESTING: MALLOC_PERTURB_ enabled\n"} | ||
80 | } | ||
81 | expect { | ||
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 | |||
3 | brctl addbr br0 | ||
4 | ifconfig br0 10.10.20.1/29 up | ||
5 | # NAT masquerade | ||
6 | iptables -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 | |||
10 | brctl addbr br1 | ||
11 | ifconfig br1 10.10.30.1/24 up | ||
12 | brctl addbr br2 | ||
13 | ifconfig br2 10.10.40.1/24 up | ||
14 | brctl addbr br3 | ||
15 | ifconfig br3 10.10.50.1/24 up | ||
16 | brctl addbr br4 | ||
17 | ifconfig br4 10.10.60.1/24 up | ||
18 | ip link add link eth0 name eth0.5 type vlan id 5 | ||
19 | /sbin/ifconfig eth0.5 10.10.205.10/24 up | ||
20 | ip link add link eth0 name eth0.6 type vlan id 6 | ||
21 | /sbin/ifconfig eth0.6 10.10.206.10/24 up | ||
22 | ip 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 | ||
27 | ROOTDIR="/tmp/chroot" # default chroot directory | ||
28 | DEFAULT_FILES="/bin/bash /bin/sh " # basic chroot files | ||
29 | DEFAULT_FILES+="/etc/passwd /etc/nsswitch.conf /etc/group " | ||
30 | DEFAULT_FILES+=`find /lib -name libnss*` # files required by glibc | ||
31 | DEFAULT_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 | |||
33 | rm -fr $ROOTDIR | ||
34 | mkdir -p $ROOTDIR/{root,bin,lib,lib64,usr,home,etc,dev/shm,tmp,var/run,var/tmp,var/lock,var/log,proc} | ||
35 | chmod 777 $ROOTDIR/tmp | ||
36 | mkdir -p $ROOTDIR/etc/firejail | ||
37 | mkdir -p $ROOTDIR/home/netblue/.config/firejail | ||
38 | chown netblue:netblue $ROOTDIR/home/netblue | ||
39 | chown netblue:netblue $ROOTDIR/home/netblue/.config | ||
40 | cp /home/netblue/.Xauthority $ROOTDIR/home/netblue/. | ||
41 | cp -a /etc/skel $ROOTDIR/etc/. | ||
42 | mkdir $ROOTDIR/home/someotheruser | ||
43 | mkdir $ROOTDIR/boot | ||
44 | mkdir $ROOTDIR/selinux | ||
45 | cp /etc/passwd $ROOTDIR/etc/. | ||
46 | cp /etc/group $ROOTDIR/etc/. | ||
47 | cp /etc/hosts $ROOTDIR/etc/. | ||
48 | cp /etc/hostname $ROOTDIR/etc/. | ||
49 | mkdir -p $ROOTDIR/usr/lib/x86_64-linux-gnu | ||
50 | cp -a /usr/lib/x86_64-linux-gnu/openssl-1.0.0 $ROOTDIR/usr/lib/x86_64-linux-gnu/. | ||
51 | cp -a /usr/lib/ssl $ROOTDIR/usr/lib/. | ||
52 | touch $ROOTDIR/var/log/syslog | ||
53 | touch $ROOTDIR/var/tmp/somefile | ||
54 | SORTED=`for FILE in $* $DEFAULT_FILES; do echo " $FILE "; ldd $FILE | grep -v dynamic | cut -d " " -f 3; done | sort -u` | ||
55 | for FILE in $SORTED | ||
56 | do | ||
57 | cp --parents $FILE $ROOTDIR | ||
58 | done | ||
59 | cp --parents /lib64/ld-linux-x86-64.so.2 $ROOTDIR | ||
60 | cp --parents /lib/ld-linux.so.2 $ROOTDIR | ||
61 | cp ../src/tools/unchroot $ROOTDIR/. | ||
62 | touch $ROOTDIR/this-is-my-chroot | ||
63 | |||
64 | cd $ROOTDIR; find . | ||
65 | mkdir -p usr/lib/firejail/ | ||
66 | cp /usr/lib/firejail/libtrace.so usr/lib/firejail/. | ||
67 | |||
68 | |||
69 | echo "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 | |||
3 | set timeout 10 | ||
4 | spawn $env(SHELL) | ||
5 | match_max 100000 | ||
6 | |||
7 | send -- "firejail --name=bingo1 --cgroup=/sys/fs/cgroup/g1/tasks\r" | ||
8 | expect { | ||
9 | timeout {puts "TESTING ERROR 0\n";exit} | ||
10 | "Child process initialized" | ||
11 | } | ||
12 | sleep 1 | ||
13 | |||
14 | spawn $env(SHELL) | ||
15 | send -- "firejail --name=bingo2\r" | ||
16 | expect { | ||
17 | timeout {puts "TESTING ERROR 0\n";exit} | ||
18 | "Child process initialized" | ||
19 | } | ||
20 | sleep 1 | ||
21 | |||
22 | |||
23 | spawn $env(SHELL) | ||
24 | send -- "firemon --cgroup\r" | ||
25 | expect { | ||
26 | timeout {puts "TESTING ERROR 1\n";exit} | ||
27 | "bingo1" | ||
28 | } | ||
29 | expect { | ||
30 | timeout {puts "TESTING ERROR 2\n";exit} | ||
31 | ":/g1" | ||
32 | } | ||
33 | expect { | ||
34 | timeout {puts "TESTING ERROR 3\n";exit} | ||
35 | "bingo2" | ||
36 | } | ||
37 | sleep 1 | ||
38 | |||
39 | puts "\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 | |||
3 | set timeout 10 | ||
4 | spawn $env(SHELL) | ||
5 | match_max 100000 | ||
6 | |||
7 | send -- "firejail --chroot=/tmp/chroot\r" | ||
8 | expect { | ||
9 | timeout {puts "TESTING ERROR 0\n";exit} | ||
10 | "Child process initialized" | ||
11 | } | ||
12 | sleep 1 | ||
13 | |||
14 | send -- "cd /home;pwd\r" | ||
15 | expect { | ||
16 | timeout {puts "TESTING ERROR 0.1\n";exit} | ||
17 | "home" | ||
18 | } | ||
19 | sleep 1 | ||
20 | send -- "bash\r" | ||
21 | sleep 1 | ||
22 | send -- "ls /; pwd\r" | ||
23 | expect { | ||
24 | timeout {puts "TESTING ERROR 0.2\n";exit} | ||
25 | "this-is-my-chroot" | ||
26 | } | ||
27 | expect { | ||
28 | timeout {puts "TESTING ERROR 0.3\n";exit} | ||
29 | "home" | ||
30 | } | ||
31 | |||
32 | send -- "umount /boot; pwd\r" | ||
33 | expect { | ||
34 | timeout {puts "TESTING ERROR 0.4\n";exit} | ||
35 | "Bad system call" | ||
36 | } | ||
37 | expect { | ||
38 | timeout {puts "TESTING ERROR 0.5\n";exit} | ||
39 | "home" | ||
40 | } | ||
41 | |||
42 | send -- "/unchroot; pwd\r" | ||
43 | expect { | ||
44 | timeout {puts "TESTING ERROR 0.6\n";exit} | ||
45 | "Bad system call" | ||
46 | } | ||
47 | expect { | ||
48 | timeout {puts "TESTING ERROR 0.7\n";exit} | ||
49 | "home" | ||
50 | } | ||
51 | |||
52 | |||
53 | |||
54 | |||
55 | |||
56 | send -- "ps aux; pwd\r" | ||
57 | expect { | ||
58 | timeout {puts "TESTING ERROR 1\n";exit} | ||
59 | "/bin/bash" | ||
60 | } | ||
61 | expect { | ||
62 | timeout {puts "TESTING ERROR 2\n";exit} | ||
63 | "bash" | ||
64 | } | ||
65 | expect { | ||
66 | timeout {puts "TESTING ERROR 3\n";exit} | ||
67 | "ps aux" | ||
68 | } | ||
69 | expect { | ||
70 | timeout {puts "TESTING ERROR 4\n";exit} | ||
71 | "home" | ||
72 | } | ||
73 | sleep 1 | ||
74 | |||
75 | |||
76 | send -- "ps aux |wc -l; pwd\r" | ||
77 | expect { | ||
78 | timeout {puts "TESTING ERROR 5\n";exit} | ||
79 | "6" | ||
80 | } | ||
81 | expect { | ||
82 | timeout {puts "TESTING ERROR 6\n";exit} | ||
83 | "home" | ||
84 | } | ||
85 | sleep 1 | ||
86 | |||
87 | |||
88 | |||
89 | |||
90 | puts "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 | |||
3 | set timeout 10 | ||
4 | spawn $env(SHELL) | ||
5 | match_max 100000 | ||
6 | |||
7 | send -- "firejail\r" | ||
8 | expect { | ||
9 | timeout {puts "TESTING ERROR 0\n";exit} | ||
10 | "Child process initialized" | ||
11 | } | ||
12 | sleep 1 | ||
13 | |||
14 | send -- "ls /home;pwd\r" | ||
15 | expect { | ||
16 | timeout {puts "TESTING ERROR 1\n";exit} | ||
17 | "bingo" | ||
18 | } | ||
19 | expect { | ||
20 | timeout {puts "TESTING ERROR 2\n";exit} | ||
21 | "home" | ||
22 | } | ||
23 | sleep 1 | ||
24 | |||
25 | send -- "ls /home/bingo;pwd\r" | ||
26 | expect { | ||
27 | timeout {puts "TESTING ERROR 3\n";exit} | ||
28 | "cannot open directory" | ||
29 | } | ||
30 | sleep 1 | ||
31 | |||
32 | puts "\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 | |||
3 | set timeout 10 | ||
4 | spawn $env(SHELL) | ||
5 | match_max 100000 | ||
6 | |||
7 | send -- "firejail --net=br0\r" | ||
8 | expect { | ||
9 | timeout {puts "TESTING ERROR 1\n";exit} | ||
10 | "Child process initialized" | ||
11 | } | ||
12 | sleep 1 | ||
13 | |||
14 | send -- "find /sys | grep --color=never eth0;pwd\r" | ||
15 | expect { | ||
16 | timeout {puts "TESTING ERROR 2\n";exit} | ||
17 | "/sys/class/net/eth0" | ||
18 | } | ||
19 | expect { | ||
20 | timeout {puts "TESTING ERROR 3\n";exit} | ||
21 | "home" | ||
22 | } | ||
23 | sleep 1 | ||
24 | |||
25 | send -- "find /sys | grep --color=never br0;pwd\r" | ||
26 | expect { | ||
27 | timeout {puts "TESTING ERROR 4\n";exit} | ||
28 | "/sys/class/net/br0" {puts "TESTING ERROR 5\n";exit} | ||
29 | "home" | ||
30 | } | ||
31 | sleep 1 | ||
32 | |||
33 | puts "\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 | |||
3 | set timeout 10 | ||
4 | spawn $env(SHELL) | ||
5 | match_max 100000 | ||
6 | |||
7 | # dir | ||
8 | send -- "firejail --net=br0 --blacklist=../test/fscheck-dir\r" | ||
9 | expect { | ||
10 | timeout {puts "TESTING ERROR 0\n";exit} | ||
11 | "Error" | ||
12 | } | ||
13 | after 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 | |||
3 | set timeout 10 | ||
4 | spawn $env(SHELL) | ||
5 | match_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 | # .. | ||
16 | send -- "firejail --net=br0 --chroot=../test/fscheck-dir\r" | ||
17 | expect { | ||
18 | timeout {puts "TESTING ERROR 0.1\n";exit} | ||
19 | "Error" | ||
20 | } | ||
21 | after 100 | ||
22 | |||
23 | # dir link | ||
24 | send -- "firejail --net=br0 --chroot=fscheck-dir-link\r" | ||
25 | expect { | ||
26 | timeout {puts "TESTING ERROR 1\n";exit} | ||
27 | "Error" | ||
28 | } | ||
29 | after 100 | ||
30 | |||
31 | # .. | ||
32 | send -- "firejail --net=br0 --chroot=../test/fscheck-dir-link\r" | ||
33 | expect { | ||
34 | timeout {puts "TESTING ERROR 1.1\n";exit} | ||
35 | "Error" | ||
36 | } | ||
37 | after 100 | ||
38 | |||
39 | # file link | ||
40 | send -- "firejail --net=br0 --chroot=fscheck-file-link\r" | ||
41 | expect { | ||
42 | timeout {puts "TESTING ERROR 2\n";exit} | ||
43 | "Error" | ||
44 | } | ||
45 | after 100 | ||
46 | |||
47 | # file | ||
48 | send -- "firejail --net=br0 --chroot=fscheck-file\r" | ||
49 | expect { | ||
50 | timeout {puts "TESTING ERROR 2.1\n";exit} | ||
51 | "Error" | ||
52 | } | ||
53 | after 100 | ||
54 | |||
55 | # .. | ||
56 | send -- "firejail --net=br0 --chroot=../test/fscheck-file\r" | ||
57 | expect { | ||
58 | timeout {puts "TESTING ERROR 2.2\n";exit} | ||
59 | "Error" | ||
60 | } | ||
61 | after 100 | ||
62 | |||
63 | # no file | ||
64 | send -- "firejail --net=br0 --chroot=../test/nodir\r" | ||
65 | expect { | ||
66 | timeout {puts "TESTING ERROR 3\n";exit} | ||
67 | "Error" | ||
68 | } | ||
69 | after 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 | |||
3 | set timeout 10 | ||
4 | spawn $env(SHELL) | ||
5 | match_max 100000 | ||
6 | |||
7 | # dir | ||
8 | send -- "firejail --net=br0 --netfilter=fscheck-dir\r" | ||
9 | expect { | ||
10 | timeout {puts "TESTING ERROR 0\n";exit} | ||
11 | "Error" | ||
12 | } | ||
13 | after 100 | ||
14 | |||
15 | # .. | ||
16 | send -- "firejail --net=br0 --netfilter=../test/fscheck-dir\r" | ||
17 | expect { | ||
18 | timeout {puts "TESTING ERROR 0.1\n";exit} | ||
19 | "Error" | ||
20 | } | ||
21 | after 100 | ||
22 | |||
23 | # dir link | ||
24 | send -- "firejail --net=br0 --netfilter=fscheck-dir-link\r" | ||
25 | expect { | ||
26 | timeout {puts "TESTING ERROR 1\n";exit} | ||
27 | "Error" | ||
28 | } | ||
29 | after 100 | ||
30 | |||
31 | # .. | ||
32 | send -- "firejail --net=br0 --netfilter=../test/fscheck-dir-link\r" | ||
33 | expect { | ||
34 | timeout {puts "TESTING ERROR 1.1\n";exit} | ||
35 | "Error" | ||
36 | } | ||
37 | after 100 | ||
38 | |||
39 | # file link | ||
40 | send -- "firejail --net=br0 --netfilter=fscheck-file-link\r" | ||
41 | expect { | ||
42 | timeout {puts "TESTING ERROR 2\n";exit} | ||
43 | "Error" | ||
44 | } | ||
45 | after 100 | ||
46 | |||
47 | # .. | ||
48 | send -- "firejail --net=br0 --netfilter=../test/fscheck-file-link\r" | ||
49 | expect { | ||
50 | timeout {puts "TESTING ERROR 2\n";exit} | ||
51 | "Error" | ||
52 | } | ||
53 | after 100 | ||
54 | |||
55 | # no file | ||
56 | send -- "firejail --net=br0 --netfilter=../test/nofile\r" | ||
57 | expect { | ||
58 | timeout {puts "TESTING ERROR 3\n";exit} | ||
59 | "Error" | ||
60 | } | ||
61 | after 100 | ||
62 | |||
63 | # real GID/UID | ||
64 | send -- "firejail --net=br0 --netfilter=/etc/shadow\r" | ||
65 | expect { | ||
66 | timeout {puts "TESTING ERROR 4\n";exit} | ||
67 | "Error" | ||
68 | } | ||
69 | after 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 | |||
3 | set timeout 10 | ||
4 | spawn $env(SHELL) | ||
5 | match_max 100000 | ||
6 | |||
7 | # dir | ||
8 | send -- "firejail --net=br0 --output=fscheck-dir\r" | ||
9 | expect { | ||
10 | timeout {puts "TESTING ERROR 0\n";exit} | ||
11 | "Error" | ||
12 | } | ||
13 | after 100 | ||
14 | |||
15 | # .. | ||
16 | send -- "firejail --net=br0 --output=../test/fscheck-dir\r" | ||
17 | expect { | ||
18 | timeout {puts "TESTING ERROR 0.1\n";exit} | ||
19 | "Error" | ||
20 | } | ||
21 | after 100 | ||
22 | |||
23 | # dir link | ||
24 | send -- "firejail --net=br0 --output=fscheck-dir-link\r" | ||
25 | expect { | ||
26 | timeout {puts "TESTING ERROR 1\n";exit} | ||
27 | "Error" | ||
28 | } | ||
29 | after 100 | ||
30 | |||
31 | # .. | ||
32 | send -- "firejail --net=br0 --output=../test/fscheck-dir-link\r" | ||
33 | expect { | ||
34 | timeout {puts "TESTING ERROR 1.1\n";exit} | ||
35 | "Error" | ||
36 | } | ||
37 | after 100 | ||
38 | |||
39 | # file link | ||
40 | send -- "firejail --net=br0 --output=fscheck-file-link\r" | ||
41 | expect { | ||
42 | timeout {puts "TESTING ERROR 2\n";exit} | ||
43 | "Error" | ||
44 | } | ||
45 | after 100 | ||
46 | |||
47 | # .. | ||
48 | send -- "firejail --net=br0 --output=../test/fscheck-file-link\r" | ||
49 | expect { | ||
50 | timeout {puts "TESTING ERROR 2.1\n";exit} | ||
51 | "Error" | ||
52 | } | ||
53 | after 100 | ||
54 | |||
55 | # hard link1 | ||
56 | send -- "firejail --net=br0 --output=fscheck-file-hard1\r" | ||
57 | expect { | ||
58 | timeout {puts "TESTING ERROR 2.2\n";exit} | ||
59 | "Error" | ||
60 | } | ||
61 | after 100 | ||
62 | |||
63 | # hard link2 | ||
64 | send -- "firejail --net=br0 --output=fscheck-file-hard2\r" | ||
65 | expect { | ||
66 | timeout {puts "TESTING ERROR 2.3\n";exit} | ||
67 | "Error" | ||
68 | } | ||
69 | after 100 | ||
70 | |||
71 | # .. | ||
72 | send -- "firejail --net=br0 --output=../test/fscheck-file-hard1\r" | ||
73 | expect { | ||
74 | timeout {puts "TESTING ERROR 2.4\n";exit} | ||
75 | "Error" | ||
76 | } | ||
77 | after 100 | ||
78 | |||
79 | # .. | ||
80 | send -- "firejail --net=br0 --output=../test/fscheck-file-hard2\r" | ||
81 | expect { | ||
82 | timeout {puts "TESTING ERROR 2.5\n";exit} | ||
83 | "Error" | ||
84 | } | ||
85 | after 100 | ||
86 | |||
87 | |||
88 | |||
89 | |||
90 | # no file | ||
91 | send -- "firejail --net=br0 --output=../test/nofile\r" | ||
92 | expect { | ||
93 | timeout {puts "TESTING ERROR 3\n";exit} | ||
94 | "Error" | ||
95 | } | ||
96 | after 100 | ||
97 | |||
98 | # real GID/UID | ||
99 | send -- "firejail --net=br0 --output=/etc/shadow\r" | ||
100 | expect { | ||
101 | timeout {puts "TESTING ERROR 4\n";exit} | ||
102 | "Error" | ||
103 | } | ||
104 | after 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 | |||
3 | set timeout 10 | ||
4 | spawn $env(SHELL) | ||
5 | match_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 | # .. | ||
16 | send -- "firejail --net=br0 --private-home=../test/fscheck-dir\r" | ||
17 | expect { | ||
18 | timeout {puts "TESTING ERROR 0.1\n";exit} | ||
19 | "Error" | ||
20 | } | ||
21 | after 100 | ||
22 | |||
23 | # dir link | ||
24 | send -- "firejail --net=br0 --private-home=fscheck-dir-link\r" | ||
25 | expect { | ||
26 | timeout {puts "TESTING ERROR 1\n";exit} | ||
27 | "Error" | ||
28 | } | ||
29 | after 100 | ||
30 | |||
31 | # .. | ||
32 | send -- "firejail --net=br0 --private-home=../test/fscheck-dir-link\r" | ||
33 | expect { | ||
34 | timeout {puts "TESTING ERROR 1.1\n";exit} | ||
35 | "Error" | ||
36 | } | ||
37 | after 100 | ||
38 | |||
39 | # file link | ||
40 | send -- "firejail --net=br0 --private-home=fscheck-file-link\r" | ||
41 | expect { | ||
42 | timeout {puts "TESTING ERROR 2\n";exit} | ||
43 | "Error" | ||
44 | } | ||
45 | after 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 | # .. | ||
56 | send -- "firejail --net=br0 --private-home=../test/fscheck-file\r" | ||
57 | expect { | ||
58 | timeout {puts "TESTING ERROR 2.2\n";exit} | ||
59 | "Error" | ||
60 | } | ||
61 | after 100 | ||
62 | |||
63 | # no dir | ||
64 | send -- "firejail --net=br0 --private-home=../test/nodir\r" | ||
65 | expect { | ||
66 | timeout {puts "TESTING ERROR 3\n";exit} | ||
67 | "Error" | ||
68 | } | ||
69 | after 100 | ||
70 | |||
71 | # no file | ||
72 | send -- "firejail --net=br0 --private-home=../test/nofile\r" | ||
73 | expect { | ||
74 | timeout {puts "TESTING ERROR 3.1\n";exit} | ||
75 | "Error" | ||
76 | } | ||
77 | after 100 | ||
78 | |||
79 | # same owner | ||
80 | send -- "firejail --net=br0 --private=/etc\r" | ||
81 | expect { | ||
82 | timeout {puts "TESTING ERROR 4\n";exit} | ||
83 | "Error" | ||
84 | } | ||
85 | after 100 | ||
86 | |||
87 | # same owner | ||
88 | send -- "firejail --net=br0 --private=/etc/shadow\r" | ||
89 | expect { | ||
90 | timeout {puts "TESTING ERROR 4\n";exit} | ||
91 | "Error" | ||
92 | } | ||
93 | after 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 | |||
3 | set timeout 10 | ||
4 | spawn $env(SHELL) | ||
5 | match_max 100000 | ||
6 | |||
7 | # dir | ||
8 | send -- "firejail --net=br0 --profile=fscheck-dir\r" | ||
9 | expect { | ||
10 | timeout {puts "TESTING ERROR 0\n";exit} | ||
11 | "Error" | ||
12 | } | ||
13 | after 100 | ||
14 | |||
15 | # .. | ||
16 | send -- "firejail --net=br0 --profile=../test/fscheck-dir\r" | ||
17 | expect { | ||
18 | timeout {puts "TESTING ERROR 0.1\n";exit} | ||
19 | "Error" | ||
20 | } | ||
21 | after 100 | ||
22 | |||
23 | # dir link | ||
24 | send -- "firejail --net=br0 --profile=fscheck-dir-link\r" | ||
25 | expect { | ||
26 | timeout {puts "TESTING ERROR 1\n";exit} | ||
27 | "Error" | ||
28 | } | ||
29 | after 100 | ||
30 | |||
31 | # .. | ||
32 | send -- "firejail --net=br0 --profile=../test/fscheck-dir-link\r" | ||
33 | expect { | ||
34 | timeout {puts "TESTING ERROR 1.1\n";exit} | ||
35 | "Error" | ||
36 | } | ||
37 | after 100 | ||
38 | |||
39 | # file link | ||
40 | send -- "firejail --net=br0 --profile=fscheck-file-link\r" | ||
41 | expect { | ||
42 | timeout {puts "TESTING ERROR 2\n";exit} | ||
43 | "Error" | ||
44 | } | ||
45 | after 100 | ||
46 | |||
47 | # .. | ||
48 | send -- "firejail --net=br0 --profile=../test/fscheck-file-link\r" | ||
49 | expect { | ||
50 | timeout {puts "TESTING ERROR 2\n";exit} | ||
51 | "Error" | ||
52 | } | ||
53 | after 100 | ||
54 | |||
55 | # no file | ||
56 | send -- "firejail --net=br0 --profile=../test/nofile\r" | ||
57 | expect { | ||
58 | timeout {puts "TESTING ERROR 3\n";exit} | ||
59 | "Error" | ||
60 | } | ||
61 | after 100 | ||
62 | |||
63 | # real GID/UID | ||
64 | send -- "firejail --net=br0 --profile=/etc/shadow\r" | ||
65 | expect { | ||
66 | timeout {puts "TESTING ERROR 4\n";exit} | ||
67 | "Error" | ||
68 | } | ||
69 | after 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 | |||
3 | set timeout 10 | ||
4 | spawn $env(SHELL) | ||
5 | match_max 100000 | ||
6 | |||
7 | # dir | ||
8 | send -- "firejail --net=br0 --shell=fscheck-dir\r" | ||
9 | expect { | ||
10 | timeout {puts "TESTING ERROR 0\n";exit} | ||
11 | "Error" | ||
12 | } | ||
13 | after 100 | ||
14 | |||
15 | # .. | ||
16 | send -- "firejail --net=br0 --shell=../test/fscheck-dir\r" | ||
17 | expect { | ||
18 | timeout {puts "TESTING ERROR 1\n";exit} | ||
19 | "Error" | ||
20 | } | ||
21 | after 100 | ||
22 | |||
23 | # dir link | ||
24 | send -- "firejail --net=br0 --shell=fscheck-dir-link\r" | ||
25 | expect { | ||
26 | timeout {puts "TESTING ERROR 2\n";exit} | ||
27 | "Error" | ||
28 | } | ||
29 | after 100 | ||
30 | |||
31 | # .. | ||
32 | send -- "firejail --net=br0 --shell=../test/fscheck-dir-link\r" | ||
33 | expect { | ||
34 | timeout {puts "TESTING ERROR 3\n";exit} | ||
35 | "Error" | ||
36 | } | ||
37 | after 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 | # .. | ||
48 | send -- "firejail --net=br0 --shell=../test/fscheck-file-link\r" | ||
49 | expect { | ||
50 | timeout {puts "TESTING ERROR 5\n";exit} | ||
51 | "Error" | ||
52 | } | ||
53 | after 100 | ||
54 | |||
55 | # no file | ||
56 | send -- "firejail --net=br0 --shell=../test/nofile\r" | ||
57 | expect { | ||
58 | timeout {puts "TESTING ERROR 6\n";exit} | ||
59 | "Error" | ||
60 | } | ||
61 | after 100 | ||
62 | |||
63 | # real GID/UID | ||
64 | send -- "firejail --net=br0 --shell=/etc/shadow\r" | ||
65 | expect { | ||
66 | timeout {puts "TESTING ERROR 7\n";exit} | ||
67 | "Error" | ||
68 | } | ||
69 | after 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 | |||
3 | mkdir fscheck-dir | ||
4 | ln -s fscheck-dir fscheck-dir-link | ||
5 | touch fscheck-file | ||
6 | ln -s fscheck-file fscheck-file-link | ||
7 | touch fscheck-file-hard1 | ||
8 | ln fscheck-file-hard1 fscheck-file-hard2 | ||
9 | |||
10 | echo "TESTING: fscheck netfilter" | ||
11 | ./fscheck-netfilter.exp | ||
12 | echo "TESTING: fscheck shell" | ||
13 | ./fscheck-shell.exp | ||
14 | echo "TESTING: fscheck private" | ||
15 | ./fscheck-private.exp | ||
16 | echo "TESTING: fscheck private keep" | ||
17 | ./fscheck-privatekeep.exp | ||
18 | echo "TESTING: fscheck profile" | ||
19 | ./fscheck-profile.exp | ||
20 | echo "TESTING: fscheck chroot" | ||
21 | ./fscheck-chroot.exp | ||
22 | echo "TESTING: fscheck output" | ||
23 | ./fscheck-output.exp | ||
24 | echo "TESTING: fscheck bind nonroot" | ||
25 | ./fscheck-bindnoroot.exp | ||
26 | echo "TESTING: fscheck tmpfs" | ||
27 | ./fscheck-tmpfs.exp | ||
28 | echo "TESTING: fscheck readonly" | ||
29 | ./fscheck-readonly.exp | ||
30 | echo "TESTING: fscheck blacklist" | ||
31 | ./fscheck-blacklist.exp | ||
32 | |||
33 | |||
34 | rm -fr fscheck-dir | ||
35 | rm -fr fscheck-dir-link | ||
36 | rm -fr fscheck-file-link | ||
37 | rm -fr fscheck-file | ||
38 | rm -fr fscheck-file-hard1 | ||
39 | rm -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 | |||
3 | set timeout 10 | ||
4 | spawn $env(SHELL) | ||
5 | match_max 100000 | ||
6 | |||
7 | send -- "firejail --chroot=/tmp/chroot --overlay\r" | ||
8 | expect { | ||
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 | } | ||
13 | sleep 1 | ||
14 | |||
15 | send -- "firejail --overlay --chroot=/tmp/chroot\r" | ||
16 | expect { | ||
17 | timeout {puts "TESTING ERROR 0\n";exit} | ||
18 | "mutually exclusive" | ||
19 | } | ||
20 | sleep 1 | ||
21 | |||
22 | puts "\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 | |||
3 | set timeout 10 | ||
4 | spawn $env(SHELL) | ||
5 | match_max 100000 | ||
6 | |||
7 | send -- "firejail --read-only=tmpreadonly\r" | ||
8 | expect { | ||
9 | timeout {puts "TESTING ERROR 0\n";exit} | ||
10 | "Child process initialized" | ||
11 | } | ||
12 | sleep 1 | ||
13 | |||
14 | send -- "touch tmpreadonly;pwd\r" | ||
15 | expect { | ||
16 | timeout {puts "TESTING ERROR 1\n";exit} | ||
17 | "Read-only file system" | ||
18 | } | ||
19 | expect { | ||
20 | timeout {puts "TESTING ERROR 2\n";exit} | ||
21 | "home" | ||
22 | } | ||
23 | sleep 1 | ||
24 | |||
25 | puts "\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 @@ | |||
1 | private-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 @@ | |||
1 | private ./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 | |||
3 | set timeout 10 | ||
4 | spawn $env(SHELL) | ||
5 | match_max 100000 | ||
6 | |||
7 | # testing private | ||
8 | send -- "firejail --private=./dirprivate\r" | ||
9 | expect { | ||
10 | timeout {puts "TESTING ERROR 0\n";exit} | ||
11 | "Child process initialized" | ||
12 | } | ||
13 | sleep 1 | ||
14 | |||
15 | send -- "ls -al;pwd\r" | ||
16 | expect { | ||
17 | timeout {puts "TESTING ERROR 0.1\n";exit} | ||
18 | "bashrc" | ||
19 | } | ||
20 | expect { | ||
21 | timeout {puts "TESTING ERROR 0.2\n";exit} | ||
22 | "home" | ||
23 | } | ||
24 | send -- "ls -al;pwd\r" | ||
25 | expect { | ||
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 | } | ||
37 | expect { | ||
38 | timeout {puts "TESTING ERROR 0.4\n";exit} | ||
39 | [lindex $argv 0] | ||
40 | } | ||
41 | |||
42 | send -- "ls -al | wc -l;pwd\r" | ||
43 | expect { | ||
44 | timeout {puts "TESTING ERROR 1\n";exit} | ||
45 | "6" {puts "normal system\n";} | ||
46 | "5" {puts "OpenSUSE\n";} | ||
47 | } | ||
48 | expect { | ||
49 | timeout {puts "TESTING ERROR 2\n";exit} | ||
50 | "home" | ||
51 | } | ||
52 | |||
53 | puts "\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 | |||
3 | set timeout 10 | ||
4 | spawn $env(SHELL) | ||
5 | match_max 100000 | ||
6 | |||
7 | # testing private | ||
8 | send -- "firejail --profile=private.profile\r" | ||
9 | expect { | ||
10 | timeout {puts "TESTING ERROR 0\n";exit} | ||
11 | "Child process initialized" | ||
12 | } | ||
13 | sleep 1 | ||
14 | |||
15 | send -- "ls -al;pwd\r" | ||
16 | expect { | ||
17 | timeout {puts "TESTING ERROR 0.1\n";exit} | ||
18 | "bashrc" | ||
19 | } | ||
20 | expect { | ||
21 | timeout {puts "TESTING ERROR 0.2\n";exit} | ||
22 | "home" | ||
23 | } | ||
24 | send -- "ls -al;pwd\r" | ||
25 | expect { | ||
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 | } | ||
37 | expect { | ||
38 | timeout {puts "TESTING ERROR 0.4\n";exit} | ||
39 | [lindex $argv 0] | ||
40 | } | ||
41 | |||
42 | send -- "ls -al | wc -l;pwd\r" | ||
43 | expect { | ||
44 | timeout {puts "TESTING ERROR 1\n";exit} | ||
45 | "6" {puts "normal system\n";} | ||
46 | "5" {puts "OpenSUSE\n";} | ||
47 | } | ||
48 | expect { | ||
49 | timeout {puts "TESTING ERROR 2\n";exit} | ||
50 | "home" | ||
51 | } | ||
52 | |||
53 | puts "\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 | ||
7 | 1 firejail -blablabla | ||
8 | 1 firejail --blablabla | ||
9 | 1 firejail --debug --blablabla | ||
10 | |||
11 | # misc options | ||
12 | 0 firejail --help | ||
13 | 0 firejail --list | ||
14 | |||
15 | # network testing | ||
16 | 0 firejail --net=none exit | ||
17 | 1 firejail --ip=none --net=none exit # noip requires at least one network | ||
18 | 0 firejail --net=br0 exit | ||
19 | 1 firejail --net=none --net=br0 exit # --net and --net=none are mutually exclusive | ||
20 | 1 firejail --ip=none exit # noip requires at least one network | ||
21 | 1 firejail --defaultgw=10.10.20.1 # no bridge configured | ||
22 | 0 firejail --net=br0 --ip=10.10.20.6 exit | ||
23 | 1 firejail --net=br0 --ip=192.168.5.6 exit # interface range | ||
24 | 1 firejail --net=br0 --ip=10.10 # bad ip | ||
25 | 1 firejail --net=br0 --ip=asdf #bad ip | ||
26 | 1 firejail --ip=asdf # no bridge configured | ||
27 | 0 firejail --net=br0 --defaultgw=10.10.20.1 exit | ||
28 | 1 firejail --net=br0 --defaultgw=10.10.20 exit # invalid ip address | ||
29 | 1 firejail --net=br0 --defaultgw=asdf exit # invalid ip address | ||
30 | 0 firejail --net=br0 --ip=10.10.20.2 --defaultgw=10.10.20.1 exit | ||
31 | 0 firejail --net=br0 --net=br1 --net=br2 --net=br3 exit | ||
32 | 1 firejail --net | ||
33 | 1 firejail --net= | ||
34 | 1 firejail --net=bingo | ||
35 | 1 firejail --net=loopback | ||
36 | 1 firejail --net=lo #invalid network device | ||
37 | 1 firejail --net=/br0 exit | ||
38 | 1 firejail --net=br0 --net=br1 --net=br2 --net=br3 --net=br4 exit # only 4 networks allowed | ||
39 | 0 firejail --net=eth0 exit | ||
40 | 1 firejail --net=/dev/eth0 exit | ||
41 | 1 firejail --net=br0 --net=br1 --net=/dev/eth0 exit | ||
42 | 0 firejail --net=br0 --net=br0 exit # same device twice | ||
43 | 0 firejail --net=eth0 --net=br2 --net=br3 --net=eth0 exit # same device twice | ||
44 | 0 firejail --net=eth0 --net=br0 exit | ||
45 | |||
46 | # private mode | ||
47 | 0 firejail --private exit | ||
48 | 1 firejail --private=/etc sleep 1 | ||
49 | 1 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 | |||
10 | echo "TESTING: tty (tty.exp)" | ||
11 | ./tty.exp | ||
12 | |||
13 | sleep 1 | ||
14 | rm -fr dir\ with\ space | ||
15 | mkdir dir\ with\ space | ||
16 | echo "TESTING: blacklist (blacklist.exp)" | ||
17 | ./blacklist.exp | ||
18 | sleep 1 | ||
19 | rm -fr dir\ with\ space | ||
20 | |||
21 | ln -s auto auto2 | ||
22 | ln -s /bin auto3 | ||
23 | ln -s /usr/bin auto4 | ||
24 | echo "TESTING: blacklist directory link (blacklist-link.exp)" | ||
25 | ./blacklist-link.exp | ||
26 | rm -fr auto2 | ||
27 | rm -fr auto3 | ||
28 | rm -fr auto4 | ||
29 | |||
30 | echo "TESTING: chroot overlay (option_chroot_overlay.exp)" | ||
31 | ./option_chroot_overlay.exp | ||
32 | |||
33 | echo "TESTING: chroot as user (fs_chroot.exp)" | ||
34 | ./fs_chroot.exp | ||
35 | |||
36 | echo "TESTING: /sys (fs_sys.exp)" | ||
37 | ./fs_sys.exp | ||
38 | |||
39 | echo "TESTING: readonly (option_readonly.exp)" | ||
40 | ls -al > tmpreadonly | ||
41 | ./option_readonly.exp | ||
42 | sleep 5 | ||
43 | rm -f tmpreadonly | ||
44 | |||
45 | |||
46 | |||
47 | echo "TESTING: private directory (private_dir.exp)" | ||
48 | rm -fr dirprivate | ||
49 | mkdir dirprivate | ||
50 | ./private_dir.exp | ||
51 | rm -fr dirprivate | ||
52 | |||
53 | echo "TESTING: private directory profile (private_dir_profile.exp)" | ||
54 | rm -fr dirprivate | ||
55 | mkdir dirprivate | ||
56 | ./private_dir_profile.exp | ||
57 | rm -fr dirprivate | ||
58 | |||
59 | echo "TESTING: overlayfs (fs_overlay.exp)" | ||
60 | ./fs_overlay.exp | ||
61 | |||
62 | echo "TESTING: login SSH (login_ssh.exp)" | ||
63 | ./login_ssh.exp | ||
64 | |||
65 | echo "TESTING: firemon --arp (firemon-arp.exp)" | ||
66 | ./firemon-arp.exp | ||
67 | |||
68 | echo "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 | |||
3 | set timeout 10 | ||
4 | spawn $env(SHELL) | ||
5 | match_max 100000 | ||
6 | |||
7 | send -- "firejail\r" | ||
8 | expect { | ||
9 | timeout {puts "TESTING ERROR 0\n";exit} | ||
10 | "Child process initialized" | ||
11 | } | ||
12 | sleep 2 | ||
13 | send -- "xterm &\r" | ||
14 | sleep 2 | ||
15 | send -- "urxvt &\r" | ||
16 | sleep 2 | ||
17 | send -- "rxvt &\r" | ||
18 | sleep 2 | ||
19 | |||
20 | send -- "ps aux\r" | ||
21 | expect { | ||
22 | timeout {puts "TESTING ERROR 1\n";exit} | ||
23 | "USER" | ||
24 | } | ||
25 | expect { | ||
26 | timeout {puts "TESTING ERROR 2\n";exit} | ||
27 | "xterm" | ||
28 | } | ||
29 | expect { | ||
30 | timeout {puts "TESTING ERROR 3\n";exit} | ||
31 | "urxvt" | ||
32 | } | ||
33 | expect { | ||
34 | timeout {puts "TESTING ERROR 4\n";exit} | ||
35 | "rxvt" | ||
36 | } | ||
37 | expect { | ||
38 | timeout {puts "TESTING ERROR 5\n";exit} | ||
39 | "ps aux" | ||
40 | } | ||
41 | |||
42 | send -- "pkill xterm\r" | ||
43 | sleep 1 | ||
44 | send -- "pkill urxvt\r" | ||
45 | sleep 1 | ||
46 | send -- "pkill rxvt\r" | ||
47 | sleep 1 | ||
48 | send -- "exit\r" | ||
49 | sleep 2 | ||
50 | |||
51 | |||
52 | send -- "firejail --private-dev\r" | ||
53 | expect { | ||
54 | timeout {puts "TESTING ERROR 10\n";exit} | ||
55 | "Child process initialized" | ||
56 | } | ||
57 | sleep 2 | ||
58 | send -- "xterm &\r" | ||
59 | sleep 2 | ||
60 | send -- "urxvt &\r" | ||
61 | sleep 2 | ||
62 | send -- "rxvt &\r" | ||
63 | sleep 2 | ||
64 | |||
65 | send -- "ps aux\r" | ||
66 | expect { | ||
67 | timeout {puts "TESTING ERROR 11\n";exit} | ||
68 | "USER" | ||
69 | } | ||
70 | expect { | ||
71 | timeout {puts "TESTING ERROR 12\n";exit} | ||
72 | "xterm" | ||
73 | } | ||
74 | expect { | ||
75 | timeout {puts "TESTING ERROR 13\n";exit} | ||
76 | "urxvt" | ||
77 | } | ||
78 | expect { | ||
79 | timeout {puts "TESTING ERROR 14\n";exit} | ||
80 | "rxvt" | ||
81 | } | ||
82 | expect { | ||
83 | timeout {puts "TESTING ERROR 15\n";exit} | ||
84 | "ps aux" | ||
85 | } | ||
86 | |||
87 | send -- "pkill xterm\r" | ||
88 | sleep 1 | ||
89 | send -- "pkill urxvt\r" | ||
90 | sleep 1 | ||
91 | send -- "pkill rxvt\r" | ||
92 | sleep 1 | ||
93 | send -- "exit\r" | ||
94 | sleep 2 | ||
95 | |||
96 | puts "\n" | ||