diff options
author | netblue30 <netblue30@yahoo.com> | 2016-11-11 13:14:13 -0500 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2016-11-11 13:14:13 -0500 |
commit | c40736899fc621946246297e5b1a3964f6172fdb (patch) | |
tree | 5ab5e0bfeb48b1573aaaa451b1acd542377791d3 /test/appimage | |
parent | hidepid part 5 (diff) | |
download | firejail-c40736899fc621946246297e5b1a3964f6172fdb.tar.gz firejail-c40736899fc621946246297e5b1a3964f6172fdb.tar.zst firejail-c40736899fc621946246297e5b1a3964f6172fdb.zip |
appimage testing
Diffstat (limited to 'test/appimage')
-rw-r--r-- | test/appimage/Leafpad-0.8.17-x86_64.AppImage | bin | 0 -> 786432 bytes | |||
-rw-r--r-- | test/appimage/Leafpad-0.8.18.1.glibc2.4-x86_64.AppImage | bin | 0 -> 231417 bytes | |||
-rwxr-xr-x | test/appimage/appimage-v1.exp | 81 | ||||
-rwxr-xr-x | test/appimage/appimage-v2.exp | 81 | ||||
-rwxr-xr-x | test/appimage/appimage.sh | 14 |
5 files changed, 176 insertions, 0 deletions
diff --git a/test/appimage/Leafpad-0.8.17-x86_64.AppImage b/test/appimage/Leafpad-0.8.17-x86_64.AppImage new file mode 100644 index 000000000..865f6b44c --- /dev/null +++ b/test/appimage/Leafpad-0.8.17-x86_64.AppImage | |||
Binary files differ | |||
diff --git a/test/appimage/Leafpad-0.8.18.1.glibc2.4-x86_64.AppImage b/test/appimage/Leafpad-0.8.18.1.glibc2.4-x86_64.AppImage new file mode 100644 index 000000000..d167431f3 --- /dev/null +++ b/test/appimage/Leafpad-0.8.18.1.glibc2.4-x86_64.AppImage | |||
Binary files differ | |||
diff --git a/test/appimage/appimage-v1.exp b/test/appimage/appimage-v1.exp new file mode 100755 index 000000000..88687ae2a --- /dev/null +++ b/test/appimage/appimage-v1.exp | |||
@@ -0,0 +1,81 @@ | |||
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 --appimage Leafpad-0.8.17-x86_64.AppImage\r" | ||
11 | expect { | ||
12 | timeout {puts "TESTING ERROR 1\n";exit} | ||
13 | "Child process initialized" | ||
14 | } | ||
15 | sleep 2 | ||
16 | |||
17 | spawn $env(SHELL) | ||
18 | send -- "firejail --list\r" | ||
19 | expect { | ||
20 | timeout {puts "TESTING ERROR 3\n";exit} | ||
21 | ":firejail" | ||
22 | } | ||
23 | expect { | ||
24 | timeout {puts "TESTING ERROR 3.1\n";exit} | ||
25 | "appimage Leafpad" | ||
26 | } | ||
27 | after 100 | ||
28 | |||
29 | # grsecurity exit | ||
30 | send -- "file /proc/sys/kernel/grsecurity\r" | ||
31 | expect { | ||
32 | timeout {puts "TESTING ERROR - grsecurity detection\n";exit} | ||
33 | "grsecurity: directory" {puts "grsecurity present, exiting...\n";exit} | ||
34 | "cannot open" {puts "grsecurity not present\n"} | ||
35 | } | ||
36 | |||
37 | |||
38 | send -- "firejail --name=blablabla\r" | ||
39 | expect { | ||
40 | timeout {puts "TESTING ERROR 4\n";exit} | ||
41 | "Child process initialized" | ||
42 | } | ||
43 | sleep 2 | ||
44 | |||
45 | spawn $env(SHELL) | ||
46 | send -- "firemon --seccomp\r" | ||
47 | expect { | ||
48 | timeout {puts "TESTING ERROR 5\n";exit} | ||
49 | "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit} | ||
50 | "appimage Leafpad" | ||
51 | } | ||
52 | expect { | ||
53 | timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit} | ||
54 | "Seccomp: 2" | ||
55 | } | ||
56 | expect { | ||
57 | timeout {puts "TESTING ERROR 5.1\n";exit} | ||
58 | "name=blablabla" | ||
59 | } | ||
60 | after 100 | ||
61 | send -- "firemon --caps\r" | ||
62 | expect { | ||
63 | timeout {puts "TESTING ERROR 6\n";exit} | ||
64 | "appimage Leafpad" | ||
65 | } | ||
66 | expect { | ||
67 | timeout {puts "TESTING ERROR 6.1\n";exit} | ||
68 | "CapBnd:" | ||
69 | } | ||
70 | expect { | ||
71 | timeout {puts "TESTING ERROR 6.2\n";exit} | ||
72 | "0000000000000000" | ||
73 | } | ||
74 | expect { | ||
75 | timeout {puts "TESTING ERROR 6.3\n";exit} | ||
76 | "name=blablabla" | ||
77 | } | ||
78 | after 100 | ||
79 | |||
80 | puts "\nall done\n" | ||
81 | |||
diff --git a/test/appimage/appimage-v2.exp b/test/appimage/appimage-v2.exp new file mode 100755 index 000000000..7b3bf4cbd --- /dev/null +++ b/test/appimage/appimage-v2.exp | |||
@@ -0,0 +1,81 @@ | |||
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 --appimage Leafpad-0.8.18.1.glibc2.4-x86_64.AppImage\r" | ||
11 | expect { | ||
12 | timeout {puts "TESTING ERROR 1\n";exit} | ||
13 | "Child process initialized" | ||
14 | } | ||
15 | sleep 2 | ||
16 | |||
17 | spawn $env(SHELL) | ||
18 | send -- "firejail --list\r" | ||
19 | expect { | ||
20 | timeout {puts "TESTING ERROR 3\n";exit} | ||
21 | ":firejail" | ||
22 | } | ||
23 | expect { | ||
24 | timeout {puts "TESTING ERROR 3.1\n";exit} | ||
25 | "appimage Leafpad" | ||
26 | } | ||
27 | after 100 | ||
28 | |||
29 | # grsecurity exit | ||
30 | send -- "file /proc/sys/kernel/grsecurity\r" | ||
31 | expect { | ||
32 | timeout {puts "TESTING ERROR - grsecurity detection\n";exit} | ||
33 | "grsecurity: directory" {puts "grsecurity present, exiting...\n";exit} | ||
34 | "cannot open" {puts "grsecurity not present\n"} | ||
35 | } | ||
36 | |||
37 | |||
38 | send -- "firejail --name=blablabla\r" | ||
39 | expect { | ||
40 | timeout {puts "TESTING ERROR 4\n";exit} | ||
41 | "Child process initialized" | ||
42 | } | ||
43 | sleep 2 | ||
44 | |||
45 | spawn $env(SHELL) | ||
46 | send -- "firemon --seccomp\r" | ||
47 | expect { | ||
48 | timeout {puts "TESTING ERROR 5\n";exit} | ||
49 | "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit} | ||
50 | "appimage Leafpad" | ||
51 | } | ||
52 | expect { | ||
53 | timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit} | ||
54 | "Seccomp: 2" | ||
55 | } | ||
56 | expect { | ||
57 | timeout {puts "TESTING ERROR 5.1\n";exit} | ||
58 | "name=blablabla" | ||
59 | } | ||
60 | after 100 | ||
61 | send -- "firemon --caps\r" | ||
62 | expect { | ||
63 | timeout {puts "TESTING ERROR 6\n";exit} | ||
64 | "appimage Leafpad" | ||
65 | } | ||
66 | expect { | ||
67 | timeout {puts "TESTING ERROR 6.1\n";exit} | ||
68 | "CapBnd:" | ||
69 | } | ||
70 | expect { | ||
71 | timeout {puts "TESTING ERROR 6.2\n";exit} | ||
72 | "0000000000000000" | ||
73 | } | ||
74 | expect { | ||
75 | timeout {puts "TESTING ERROR 6.3\n";exit} | ||
76 | "name=blablabla" | ||
77 | } | ||
78 | after 100 | ||
79 | |||
80 | puts "\nall done\n" | ||
81 | |||
diff --git a/test/appimage/appimage.sh b/test/appimage/appimage.sh new file mode 100755 index 000000000..6a73d0a7e --- /dev/null +++ b/test/appimage/appimage.sh | |||
@@ -0,0 +1,14 @@ | |||
1 | #!/bin/bash | ||
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2016 Firejail Authors | ||
4 | # License GPL v2 | ||
5 | |||
6 | export MALLOC_CHECK_=3 | ||
7 | export MALLOC_PERTURB_=$(($RANDOM % 255 + 1)) | ||
8 | |||
9 | echo "TESTING: AppImage v1 (test/appimage/appimage-v1.exp)" | ||
10 | ./appimage-v1.exp | ||
11 | |||
12 | echo "TESTING: AppImage v2 (test/appimage/appimage-v2.exp)" | ||
13 | ./appimage-v1.exp | ||
14 | |||