aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile.in10
-rwxr-xr-xtest/arguments/arguments.sh30
-rwxr-xr-xtest/arguments/bashrun.exp89
-rwxr-xr-xtest/arguments/bashrun.sh25
-rwxr-xr-xtest/arguments/joinrun.exp92
-rwxr-xr-xtest/arguments/joinrun.sh25
-rwxr-xr-xtest/arguments/outrun.exp93
-rwxr-xr-xtest/arguments/outrun.sh25
-rwxr-xr-xtest/arguments/symrun.exp74
-rwxr-xr-xtest/arguments/symrun.sh34
10 files changed, 5 insertions, 492 deletions
diff --git a/Makefile.in b/Makefile.in
index dae2079b4..c9ebb7916 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -191,7 +191,7 @@ uninstall:
191 @echo "If you want to install a different version of firejail, you might also need to run 'rm -fr $(DESTDIR)$(sysconfdir)/firejail', see #2038." 191 @echo "If you want to install a different version of firejail, you might also need to run 'rm -fr $(DESTDIR)$(sysconfdir)/firejail', see #2038."
192 192
193DISTFILES = "src etc m4 platform contrib configure configure.ac Makefile.in install.sh mkman.sh mketc.sh mkdeb.sh.in COPYING README RELNOTES" 193DISTFILES = "src etc m4 platform contrib configure configure.ac Makefile.in install.sh mkman.sh mketc.sh mkdeb.sh.in COPYING README RELNOTES"
194DISTFILES_TEST = "test/Makefile.in test/apps test/apps-x11 test/apps-x11-xorg test/root test/private-lib test/fnetfilter test/fcopy test/environment test/profiles test/utils test/compile test/filters test/network test/arguments test/fs test/sysutils test/chroot" 194DISTFILES_TEST = "test/Makefile.in test/apps test/apps-x11 test/apps-x11-xorg test/root test/private-lib test/fnetfilter test/fcopy test/environment test/profiles test/utils test/compile test/filters test/network test/fs test/sysutils test/chroot"
195 195
196dist: 196dist:
197 mv config.status config.status.old 197 mv config.status config.status.old
@@ -237,19 +237,19 @@ scan-build: clean
237# make test 237# make test
238# 238#
239 239
240TESTS=profiles private-lib apps apps-x11 apps-x11-xorg sysutils utils environment filters arguments fs fcopy fnetfilter 240TESTS=profiles private-lib apps apps-x11 apps-x11-xorg sysutils utils environment filters fs fcopy fnetfilter
241TEST_TARGETS=$(patsubst %,test-%,$(TESTS)) 241TEST_TARGETS=$(patsubst %,test-%,$(TESTS))
242 242
243$(TEST_TARGETS): 243$(TEST_TARGETS):
244 $(MAKE) -C test $(subst test-,,$@) 244 $(MAKE) -C test $(subst test-,,$@)
245 245
246test: test-profiles test-private-lib test-fcopy test-fnetfilter test-fs test-utils test-sysutils test-environment test-apps test-apps-x11 test-apps-x11-xorg test-filters test-arguments 246test: test-profiles test-private-lib test-fcopy test-fnetfilter test-fs test-utils test-sysutils test-environment test-apps test-apps-x11 test-apps-x11-xorg test-filters
247 echo "TEST COMPLETE" 247 echo "TEST COMPLETE"
248 248
249test-noprofiles: test-private-lib test-fcopy test-fnetfilter test-fs test-utils test-sysutils test-environment test-apps test-apps-x11 test-apps-x11-xorg test-filters test-arguments 249test-noprofiles: test-private-lib test-fcopy test-fnetfilter test-fs test-utils test-sysutils test-environment test-apps test-apps-x11 test-apps-x11-xorg test-filters
250 echo "TEST COMPLETE" 250 echo "TEST COMPLETE"
251 251
252test-github: test-profiles test-fcopy test-fnetfilter test-fs test-utils test-sysutils test-environment test-arguments 252test-github: test-profiles test-fcopy test-fnetfilter test-fs test-utils test-sysutils test-environment
253 echo "TEST COMPLETE" 253 echo "TEST COMPLETE"
254 254
255########################################## 255##########################################
diff --git a/test/arguments/arguments.sh b/test/arguments/arguments.sh
deleted file mode 100755
index 749e1b500..000000000
--- a/test/arguments/arguments.sh
+++ /dev/null
@@ -1,30 +0,0 @@
1#!/bin/bash
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6export LC_ALL=C
7
8if [ -f /etc/debian_version ]; then
9 libdir=$(dirname "$(dpkg -L firejail | grep fcopy)")
10 export PATH="$PATH:$libdir"
11fi
12export PATH="$PATH:/usr/lib/firejail:/usr/lib64/firejail"
13
14echo "TESTING: 1. regular bash session"
15./bashrun.exp
16sleep 1
17
18echo "TESTING: 2. symbolic link to firejail"
19./symrun.exp
20rm -fr symtest
21sleep 1
22
23echo "TESTING: 3. --join option"
24./joinrun.exp
25sleep 1
26
27echo "TESTING: 4. --output option"
28./outrun.exp
29rm out
30rm out.*
diff --git a/test/arguments/bashrun.exp b/test/arguments/bashrun.exp
deleted file mode 100755
index 22c38bd4c..000000000
--- a/test/arguments/bashrun.exp
+++ /dev/null
@@ -1,89 +0,0 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "./bashrun.sh\r"
11expect {
12 timeout {puts "TESTING ERROR 1.1.1\n";exit}
13 "Arguments:"
14}
15expect {
16 timeout {puts "TESTING ERROR 1.1.2\n";exit}
17 "#arg1#"
18}
19expect {
20 timeout {puts "TESTING ERROR 1.1.3\n";exit}
21 "#arg2#"
22}
23
24expect {
25 timeout {puts "TESTING ERROR 1.2.1\n";exit}
26 "Arguments:"
27}
28expect {
29 timeout {puts "TESTING ERROR 1.2.2\n";exit}
30 "#arg1 tail#"
31}
32expect {
33 timeout {puts "TESTING ERROR 1.2.3\n";exit}
34 "#arg2 tail#"
35}
36
37expect {
38 timeout {puts "TESTING ERROR 1.3.1\n";exit}
39 "Arguments:"
40}
41expect {
42 timeout {puts "TESTING ERROR 1.3.2\n";exit}
43 "#arg1 tail#"
44}
45expect {
46 timeout {puts "TESTING ERROR 1.3.3\n";exit}
47 "#arg2 tail#"
48}
49
50expect {
51 timeout {puts "TESTING ERROR 1.4.1\n";exit}
52 "Arguments:"
53}
54expect {
55 timeout {puts "TESTING ERROR 1.4.2\n";exit}
56 "#arg1 tail#"
57}
58expect {
59 timeout {puts "TESTING ERROR 1.4.3\n";exit}
60 "#arg2 tail#"
61}
62
63expect {
64 timeout {puts "TESTING ERROR 1.5.1\n";exit}
65 "Arguments:"
66}
67expect {
68 timeout {puts "TESTING ERROR 1.5.2\n";exit}
69 "#arg1&tail#"
70}
71expect {
72 timeout {puts "TESTING ERROR 1.5.3\n";exit}
73 "#arg2&tail#"
74}
75
76expect {
77 timeout {puts "TESTING ERROR 1.6.1\n";exit}
78 "Arguments:"
79}
80expect {
81 timeout {puts "TESTING ERROR 1.6.2\n";exit}
82 "#arg1&tail#"
83}
84expect {
85 timeout {puts "TESTING ERROR 1.6.3\n";exit}
86 "#arg2&tail#"
87}
88
89puts "\nall done\n"
diff --git a/test/arguments/bashrun.sh b/test/arguments/bashrun.sh
deleted file mode 100755
index ba4118cdd..000000000
--- a/test/arguments/bashrun.sh
+++ /dev/null
@@ -1,25 +0,0 @@
1#!/bin/bash
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6echo "TESTING: 1.1 - simple args"
7firejail --env=FIREJAIL_TEST_ARGUMENTS=yes --quiet faudit arg1 arg2
8
9# simple quotes, testing spaces in file names
10echo "TESTING: 1.2 - args with space and \""
11firejail --env=FIREJAIL_TEST_ARGUMENTS=yes --quiet faudit "arg1 tail" "arg2 tail"
12
13echo "TESTING: 1.3 - args with space and '"
14firejail --env=FIREJAIL_TEST_ARGUMENTS=yes --quiet faudit 'arg1 tail' 'arg2 tail'
15
16# escaped space in file names
17echo "TESTING: 1.4 - args with space and \\"
18firejail --env=FIREJAIL_TEST_ARGUMENTS=yes --quiet faudit arg1\ tail arg2\ tail
19
20# & char appears in URLs - URLs should be quoted
21echo "TESTING: 1.5 - args with & and \""
22firejail --env=FIREJAIL_TEST_ARGUMENTS=yes --quiet faudit "arg1&tail" "arg2&tail"
23
24echo "TESTING: 1.6 - args with & and '"
25firejail --env=FIREJAIL_TEST_ARGUMENTS=yes --quiet faudit 'arg1&tail' 'arg2&tail'
diff --git a/test/arguments/joinrun.exp b/test/arguments/joinrun.exp
deleted file mode 100755
index 6095f0e55..000000000
--- a/test/arguments/joinrun.exp
+++ /dev/null
@@ -1,92 +0,0 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10
11send -- "firejail --name=joinrun\r"
12sleep 2
13
14spawn $env(SHELL)
15send -- "./joinrun.sh\r"
16expect {
17 timeout {puts "TESTING ERROR 3.1.1\n";exit}
18 "Arguments:"
19}
20expect {
21 timeout {puts "TESTING ERROR 3.1.2\n";exit}
22 "#arg1#"
23}
24expect {
25 timeout {puts "TESTING ERROR 3.1.3\n";exit}
26 "#arg2#"
27}
28
29expect {
30 timeout {puts "TESTING ERROR 3.2.1\n";exit}
31 "Arguments:"
32}
33expect {
34 timeout {puts "TESTING ERROR 3.2.2\n";exit}
35 "#arg1 tail#"
36}
37expect {
38 timeout {puts "TESTING ERROR 3.2.3\n";exit}
39 "#arg2 tail#"
40}
41expect {
42 timeout {puts "TESTING ERROR 3.3.1\n";exit}
43 "Arguments:"
44}
45expect {
46 timeout {puts "TESTING ERROR 3.3.2\n";exit}
47 "#arg1 tail#"
48}
49expect {
50 timeout {puts "TESTING ERROR 3.3.3\n";exit}
51 "#arg2 tail#"
52}
53expect {
54 timeout {puts "TESTING ERROR 3.4.1\n";exit}
55 "Arguments:"
56}
57expect {
58 timeout {puts "TESTING ERROR 3.4.2\n";exit}
59 "#arg1 tail#"
60}
61expect {
62 timeout {puts "TESTING ERROR 3.4.3\n";exit}
63 "#arg2 tail#"
64}
65
66expect {
67 timeout {puts "TESTING ERROR 3.5.1\n";exit}
68 "Arguments:"
69}
70expect {
71 timeout {puts "TESTING ERROR 3.5.2\n";exit}
72 "#arg1&tail#"
73}
74expect {
75 timeout {puts "TESTING ERROR 3.5.3\n";exit}
76 "#arg2&tail#"
77}
78
79expect {
80 timeout {puts "TESTING ERROR 3.6.1\n";exit}
81 "Arguments:"
82}
83expect {
84 timeout {puts "TESTING ERROR 3.6.2\n";exit}
85 "#arg1&tail#"
86}
87expect {
88 timeout {puts "TESTING ERROR 3.6.3\n";exit}
89 "#arg2&tail#"
90}
91
92puts "\nall done\n"
diff --git a/test/arguments/joinrun.sh b/test/arguments/joinrun.sh
deleted file mode 100755
index c929f0879..000000000
--- a/test/arguments/joinrun.sh
+++ /dev/null
@@ -1,25 +0,0 @@
1#!/bin/bash
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6echo "TESTING: 3.1 - simple args"
7firejail --env=FIREJAIL_TEST_ARGUMENTS=yes --join=joinrun faudit arg1 arg2
8
9# simple quotes, testing spaces in file names
10echo "TESTING: 3.2 - args with space and \""
11firejail --env=FIREJAIL_TEST_ARGUMENTS=yes --join=joinrun faudit "arg1 tail" "arg2 tail"
12
13echo "TESTING: 3.3 - args with space and '"
14firejail --env=FIREJAIL_TEST_ARGUMENTS=yes --join=joinrun faudit 'arg1 tail' 'arg2 tail'
15
16# escaped space in file names
17echo "TESTING: 3.4 - args with space and \\"
18firejail --env=FIREJAIL_TEST_ARGUMENTS=yes --join=joinrun faudit arg1\ tail arg2\ tail
19
20# & char appears in URLs - URLs should be quoted
21echo "TESTING: 3.5 - args with & and \""
22firejail --env=FIREJAIL_TEST_ARGUMENTS=yes --join=joinrun faudit "arg1&tail" "arg2&tail"
23
24echo "TESTING: 3.6 - args with & and '"
25firejail --env=FIREJAIL_TEST_ARGUMENTS=yes --join=joinrun faudit 'arg1&tail' 'arg2&tail'
diff --git a/test/arguments/outrun.exp b/test/arguments/outrun.exp
deleted file mode 100755
index e727d44fb..000000000
--- a/test/arguments/outrun.exp
+++ /dev/null
@@ -1,93 +0,0 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "./outrun.sh\r"
11expect {
12 timeout {puts "TESTING ERROR 4.1.1\n";exit}
13 "Arguments:"
14}
15expect {
16 timeout {puts "TESTING ERROR 4.1.2\n";exit}
17 "#arg1#"
18}
19expect {
20 timeout {puts "TESTING ERROR 4.1.3\n";exit}
21 "#arg2#"
22}
23
24exit
25#***************************************************
26# breaking down from here on - bug to fix
27#***************************************************
28expect {
29 timeout {puts "TESTING ERROR 4.2.1\n";exit}
30 "Arguments:"
31}
32expect {
33 timeout {puts "TESTING ERROR 4.2.2\n";exit}
34 "#arg1 tail#"
35}
36expect {
37 timeout {puts "TESTING ERROR 4.2.3\n";exit}
38 "#arg2 tail#"
39}
40
41expect {
42 timeout {puts "TESTING ERROR 4.3.1\n";exit}
43 "Arguments:"
44}
45expect {
46 timeout {puts "TESTING ERROR 4.3.2\n";exit}
47 "#arg1 tail#"
48}
49expect {
50 timeout {puts "TESTING ERROR 4.3.3\n";exit}
51 "#arg2 tail#"
52}
53
54expect {
55 timeout {puts "TESTING ERROR 4.4.1\n";exit}
56 "Arguments:"
57}
58expect {
59 timeout {puts "TESTING ERROR 4.4.2\n";exit}
60 "#arg1 tail#"
61}
62expect {
63 timeout {puts "TESTING ERROR 4.4.3\n";exit}
64 "#arg2 tail#"
65}
66
67expect {
68 timeout {puts "TESTING ERROR 4.5.1\n";exit}
69 "Arguments:"
70}
71expect {
72 timeout {puts "TESTING ERROR 4.5.2\n";exit}
73 "#arg1&tail#"
74}
75expect {
76 timeout {puts "TESTING ERROR 4.5.3\n";exit}
77 "#arg2&tail#"
78}
79
80expect {
81 timeout {puts "TESTING ERROR 4.6.1\n";exit}
82 "Arguments:"
83}
84expect {
85 timeout {puts "TESTING ERROR 4.6.2\n";exit}
86 "#arg1&tail#"
87}
88expect {
89 timeout {puts "TESTING ERROR 4.6.3\n";exit}
90 "#arg2&tail#"
91}
92
93puts "\nall done\n"
diff --git a/test/arguments/outrun.sh b/test/arguments/outrun.sh
deleted file mode 100755
index b7870bb70..000000000
--- a/test/arguments/outrun.sh
+++ /dev/null
@@ -1,25 +0,0 @@
1#!/bin/bash
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6echo "TESTING: 4.1 - simple args"
7firejail --env=FIREJAIL_TEST_ARGUMENTS=yes --output=out faudit arg1 arg2
8
9# simple quotes, testing spaces in file names
10echo "TESTING: 4.2 - args with space and \""
11firejail --env=FIREJAIL_TEST_ARGUMENTS=yes --output=out faudit "arg1 tail" "arg2 tail"
12
13echo "TESTING: 4.3 - args with space and '"
14firejail --env=FIREJAIL_TEST_ARGUMENTS=yes --output=out faudit 'arg1 tail' 'arg2 tail'
15
16# escaped space in file names
17echo "TESTING: 4.4 - args with space and \\"
18firejail --env=FIREJAIL_TEST_ARGUMENTS=yes --output=out faudit arg1\ tail arg2\ tail
19
20# & char appears in URLs - URLs should be quoted
21echo "TESTING: 4.5 - args with & and \""
22firejail --env=FIREJAIL_TEST_ARGUMENTS=yes --output=out faudit "arg1&tail" "arg2&tail"
23
24echo "TESTING: 4.6 - args with & and '"
25firejail --env=FIREJAIL_TEST_ARGUMENTS=yes --output=out faudit 'arg1&tail' 'arg2&tail'
diff --git a/test/arguments/symrun.exp b/test/arguments/symrun.exp
deleted file mode 100755
index b1f660715..000000000
--- a/test/arguments/symrun.exp
+++ /dev/null
@@ -1,74 +0,0 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "./symrun.sh\r"
11expect {
12 timeout {puts "TESTING ERROR 2.1.1\n";exit}
13 "Arguments:"
14}
15expect {
16 timeout {puts "TESTING ERROR 2.1.2\n";exit}
17 "#arg1#"
18}
19expect {
20 timeout {puts "TESTING ERROR 2.1.3\n";exit}
21 "#arg2#"
22}
23
24expect {
25 timeout {puts "TESTING ERROR 2.3.1\n";exit}
26 "Arguments:"
27}
28expect {
29 timeout {puts "TESTING ERROR 2.3.2\n";exit}
30 "#arg1 tail#"
31}
32expect {
33 timeout {puts "TESTING ERROR 2.3.3\n";exit}
34 "#arg2 tail#"
35}
36
37expect {
38 timeout {puts "TESTING ERROR 2.4.1\n";exit}
39 "Arguments:"
40}
41expect {
42 timeout {puts "TESTING ERROR 2.4.2\n";exit}
43 "#arg1 tail#"
44}
45expect {
46 timeout {puts "TESTING ERROR 2.4.3\n";exit}
47 "#arg2 tail#"
48}
49
50expect {
51 timeout {puts "TESTING ERROR 2.5.1\n";exit}
52 "Arguments:"
53}
54expect {
55 timeout {puts "TESTING ERROR 2.5.2\n";exit}
56 "#arg1&tail#"
57}
58expect {
59 timeout {puts "TESTING ERROR 2.5.3\n";exit}
60 "#arg2&tail#"
61}
62
63expect {
64 timeout {puts "TESTING ERROR 2.6.1\n";exit}
65 "Arguments:"
66}
67expect {
68 timeout {puts "TESTING ERROR 2.6.2\n";exit}
69 "#arg1&tail#"
70}
71expect {
72 timeout {puts "TESTING ERROR 2.6.3\n";exit}
73 "#arg2&tail#"
74}
diff --git a/test/arguments/symrun.sh b/test/arguments/symrun.sh
deleted file mode 100755
index 7bc4d21cf..000000000
--- a/test/arguments/symrun.sh
+++ /dev/null
@@ -1,34 +0,0 @@
1#!/bin/bash
2# This file is part of Firejail project
3# Copyright (C) 2014-2021 Firejail Authors
4# License GPL v2
5
6mkdir symtest
7ln -s /usr/bin/firejail symtest/faudit
8
9# search for faudit in current directory
10export PATH=$PATH:.
11export FIREJAIL_TEST_ARGUMENTS=yes
12
13echo "TESTING: 2.1 - simple args"
14symtest/faudit arg1 arg2
15
16# simple quotes, testing spaces in file names
17echo "TESTING: 2.2 - args with space and \""
18symtest/faudit "arg1 tail" "arg2 tail"
19
20echo "TESTING: 2.3 - args with space and '"
21symtest/faudit 'arg1 tail' 'arg2 tail'
22
23# escaped space in file names
24echo "TESTING: 2.4 - args with space and \\"
25symtest/faudit arg1\ tail arg2\ tail
26
27# & char appears in URLs - URLs should be quoted
28echo "TESTING: 2.5 - args with & and \""
29symtest/faudit "arg1&tail" "arg2&tail"
30
31echo "TESTING: 2.6 - args with & and '"
32symtest/faudit 'arg1&tail' 'arg2&tail'
33
34rm -fr symtest