diff options
Diffstat (limited to 'test/arguments')
-rw-r--r-- | test/arguments/Makefile | 13 | ||||
-rwxr-xr-x | test/arguments/arguments.sh | 4 | ||||
-rwxr-xr-x | test/arguments/bashrun.sh | 12 | ||||
-rwxr-xr-x | test/arguments/joinrun.sh | 12 | ||||
-rw-r--r-- | test/arguments/main.c | 31 | ||||
-rwxr-xr-x | test/arguments/outrun.sh | 12 | ||||
-rw-r--r-- | test/arguments/readme | 9 |
7 files changed, 22 insertions, 71 deletions
diff --git a/test/arguments/Makefile b/test/arguments/Makefile deleted file mode 100644 index 3ccab3702..000000000 --- a/test/arguments/Makefile +++ /dev/null | |||
@@ -1,13 +0,0 @@ | |||
1 | all: argtest | ||
2 | |||
3 | argtest: main.c | ||
4 | gcc -o argtest main.c | ||
5 | |||
6 | clean:; rm -f argtest; rm -fr symtest; rm -f out out.* | ||
7 | |||
8 | install:;install -c -m 0755 argtest /usr/local/bin/argtest | ||
9 | |||
10 | uninstall:; rm -f /usr/local/bin/argtest | ||
11 | |||
12 | |||
13 | test:; ./arguments.sh | grep TESTING | ||
diff --git a/test/arguments/arguments.sh b/test/arguments/arguments.sh index 2f53eb3fa..db4c9b472 100755 --- a/test/arguments/arguments.sh +++ b/test/arguments/arguments.sh | |||
@@ -4,12 +4,16 @@ | |||
4 | 4 | ||
5 | echo "TESTING: 1. regular bash session" | 5 | echo "TESTING: 1. regular bash session" |
6 | ./bashrun.exp | 6 | ./bashrun.exp |
7 | sleep 1 | ||
7 | 8 | ||
8 | echo "TESTING: 2. symbolic link to firejail" | 9 | echo "TESTING: 2. symbolic link to firejail" |
9 | ./symrun.exp | 10 | ./symrun.exp |
11 | rm -fr symtest | ||
12 | sleep 1 | ||
10 | 13 | ||
11 | echo "TESTING: 3. --join option" | 14 | echo "TESTING: 3. --join option" |
12 | ./joinrun.exp | 15 | ./joinrun.exp |
16 | sleep 1 | ||
13 | 17 | ||
14 | echo "TESTING: 4. --output option" | 18 | echo "TESTING: 4. --output option" |
15 | ./outrun.exp | 19 | ./outrun.exp |
diff --git a/test/arguments/bashrun.sh b/test/arguments/bashrun.sh index c2f209548..0797c92c2 100755 --- a/test/arguments/bashrun.sh +++ b/test/arguments/bashrun.sh | |||
@@ -1,22 +1,22 @@ | |||
1 | #!/bin/bash | 1 | #!/bin/bash |
2 | 2 | ||
3 | echo "TESTING: 1.1 - simple args" | 3 | echo "TESTING: 1.1 - simple args" |
4 | firejail --quiet ./argtest arg1 arg2 | 4 | firejail --env=FIREJAIL_TEST_ARGUMENTS=yes --quiet /usr/lib/firejail/faudit arg1 arg2 |
5 | 5 | ||
6 | # simple quotes, testing spaces in file names | 6 | # simple quotes, testing spaces in file names |
7 | echo "TESTING: 1.2 - args with space and \"" | 7 | echo "TESTING: 1.2 - args with space and \"" |
8 | firejail --quiet ./argtest "arg1 tail" "arg2 tail" | 8 | firejail --env=FIREJAIL_TEST_ARGUMENTS=yes --quiet /usr/lib/firejail/faudit "arg1 tail" "arg2 tail" |
9 | 9 | ||
10 | echo "TESTING: 1.3 - args with space and '" | 10 | echo "TESTING: 1.3 - args with space and '" |
11 | firejail --quiet ./argtest 'arg1 tail' 'arg2 tail' | 11 | firejail --env=FIREJAIL_TEST_ARGUMENTS=yes --quiet /usr/lib/firejail/faudit 'arg1 tail' 'arg2 tail' |
12 | 12 | ||
13 | # escaped space in file names | 13 | # escaped space in file names |
14 | echo "TESTING: 1.4 - args with space and \\" | 14 | echo "TESTING: 1.4 - args with space and \\" |
15 | firejail --quiet ./argtest arg1\ tail arg2\ tail | 15 | firejail --env=FIREJAIL_TEST_ARGUMENTS=yes --quiet /usr/lib/firejail/faudit arg1\ tail arg2\ tail |
16 | 16 | ||
17 | # & char appears in URLs - URLs should be quoted | 17 | # & char appears in URLs - URLs should be quoted |
18 | echo "TESTING: 1.5 - args with & and \"" | 18 | echo "TESTING: 1.5 - args with & and \"" |
19 | firejail --quiet ./argtest "arg1&tail" "arg2&tail" | 19 | firejail --env=FIREJAIL_TEST_ARGUMENTS=yes --quiet /usr/lib/firejail/faudit "arg1&tail" "arg2&tail" |
20 | 20 | ||
21 | echo "TESTING: 1.6 - args with & and '" | 21 | echo "TESTING: 1.6 - args with & and '" |
22 | firejail --quiet ./argtest 'arg1&tail' 'arg2&tail' | 22 | firejail --env=FIREJAIL_TEST_ARGUMENTS=yes --quiet /usr/lib/firejail/faudit 'arg1&tail' 'arg2&tail' |
diff --git a/test/arguments/joinrun.sh b/test/arguments/joinrun.sh index f6c2b2e22..2743d823e 100755 --- a/test/arguments/joinrun.sh +++ b/test/arguments/joinrun.sh | |||
@@ -1,22 +1,22 @@ | |||
1 | #!/bin/bash | 1 | #!/bin/bash |
2 | 2 | ||
3 | echo "TESTING: 3.1 - simple args" | 3 | echo "TESTING: 3.1 - simple args" |
4 | firejail --join=joinrun ./argtest arg1 arg2 | 4 | firejail --env=FIREJAIL_TEST_ARGUMENTS=yes --join=joinrun /usr/lib/firejail/faudit arg1 arg2 |
5 | 5 | ||
6 | # simple quotes, testing spaces in file names | 6 | # simple quotes, testing spaces in file names |
7 | echo "TESTING: 3.2 - args with space and \"" | 7 | echo "TESTING: 3.2 - args with space and \"" |
8 | firejail --quiet ./argtest "arg1 tail" "arg2 tail" | 8 | firejail--env=FIREJAIL_TEST_ARGUMENTS=yes --quiet /usr/lib/firejail/faudit "arg1 tail" "arg2 tail" |
9 | 9 | ||
10 | echo "TESTING: 3.3 - args with space and '" | 10 | echo "TESTING: 3.3 - args with space and '" |
11 | firejail --quiet ./argtest 'arg1 tail' 'arg2 tail' | 11 | firejail --env=FIREJAIL_TEST_ARGUMENTS=yes --quiet /usr/lib/firejail/faudit 'arg1 tail' 'arg2 tail' |
12 | 12 | ||
13 | # escaped space in file names | 13 | # escaped space in file names |
14 | echo "TESTING: 3.4 - args with space and \\" | 14 | echo "TESTING: 3.4 - args with space and \\" |
15 | firejail --quiet ./argtest arg1\ tail arg2\ tail | 15 | firejail--env=FIREJAIL_TEST_ARGUMENTS=yes --quiet /usr/lib/firejail/faudit arg1\ tail arg2\ tail |
16 | 16 | ||
17 | # & char appears in URLs - URLs should be quoted | 17 | # & char appears in URLs - URLs should be quoted |
18 | echo "TESTING: 3.5 - args with & and \"" | 18 | echo "TESTING: 3.5 - args with & and \"" |
19 | firejail --quiet ./argtest "arg1&tail" "arg2&tail" | 19 | firejail --env=FIREJAIL_TEST_ARGUMENTS=yes --quiet /usr/lib/firejail/faudit "arg1&tail" "arg2&tail" |
20 | 20 | ||
21 | echo "TESTING: 3.6 - args with & and '" | 21 | echo "TESTING: 3.6 - args with & and '" |
22 | firejail --quiet ./argtest 'arg1&tail' 'arg2&tail' | 22 | firejail --env=FIREJAIL_TEST_ARGUMENTS=yes --quiet /usr/lib/firejail/faudit 'arg1&tail' 'arg2&tail' |
diff --git a/test/arguments/main.c b/test/arguments/main.c deleted file mode 100644 index 75bdca715..000000000 --- a/test/arguments/main.c +++ /dev/null | |||
@@ -1,31 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2014-2016 Firejail Authors | ||
3 | * | ||
4 | * This file is part of firejail project | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License along | ||
17 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
19 | */ | ||
20 | #include <stdio.h> | ||
21 | |||
22 | int main(int argc, char **argv) { | ||
23 | printf("Arguments:\n"); | ||
24 | |||
25 | int i; | ||
26 | for (i = 0; i < argc; i++) { | ||
27 | printf("#%s#\n", argv[i]); | ||
28 | } | ||
29 | |||
30 | return 0; | ||
31 | } | ||
diff --git a/test/arguments/outrun.sh b/test/arguments/outrun.sh index cfd8e684c..a21243873 100755 --- a/test/arguments/outrun.sh +++ b/test/arguments/outrun.sh | |||
@@ -1,22 +1,22 @@ | |||
1 | #!/bin/bash | 1 | #!/bin/bash |
2 | 2 | ||
3 | echo "TESTING: 4.1 - simple args" | 3 | echo "TESTING: 4.1 - simple args" |
4 | firejail --output=out ./argtest arg1 arg2 | 4 | firejail --env=FIREJAIL_TEST_ARGUMENTS=yes --output=out /usr/lib/firejail/faudit arg1 arg2 |
5 | 5 | ||
6 | # simple quotes, testing spaces in file names | 6 | # simple quotes, testing spaces in file names |
7 | echo "TESTING: 4.2 - args with space and \"" | 7 | echo "TESTING: 4.2 - args with space and \"" |
8 | firejail --output=out ./argtest "arg1 tail" "arg2 tail" | 8 | firejail --env=FIREJAIL_TEST_ARGUMENTS=yes --output=out /usr/lib/firejail/faudit "arg1 tail" "arg2 tail" |
9 | 9 | ||
10 | echo "TESTING: 4.3 - args with space and '" | 10 | echo "TESTING: 4.3 - args with space and '" |
11 | firejail --output=out ./argtest 'arg1 tail' 'arg2 tail' | 11 | firejail--env=FIREJAIL_TEST_ARGUMENTS=yes --output=out /usr/lib/firejail/faudit 'arg1 tail' 'arg2 tail' |
12 | 12 | ||
13 | # escaped space in file names | 13 | # escaped space in file names |
14 | echo "TESTING: 4.4 - args with space and \\" | 14 | echo "TESTING: 4.4 - args with space and \\" |
15 | firejail --output=out ./argtest arg1\ tail arg2\ tail | 15 | firejail--env=FIREJAIL_TEST_ARGUMENTS=yes --output=out /usr/lib/firejail/faudit arg1\ tail arg2\ tail |
16 | 16 | ||
17 | # & char appears in URLs - URLs should be quoted | 17 | # & char appears in URLs - URLs should be quoted |
18 | echo "TESTING: 4.5 - args with & and \"" | 18 | echo "TESTING: 4.5 - args with & and \"" |
19 | firejail --output=out ./argtest "arg1&tail" "arg2&tail" | 19 | firejail --env=FIREJAIL_TEST_ARGUMENTS=yes --output=out /usr/lib/firejail/faudit "arg1&tail" "arg2&tail" |
20 | 20 | ||
21 | echo "TESTING: 4.6 - args with & and '" | 21 | echo "TESTING: 4.6 - args with & and '" |
22 | firejail --output=out ./argtest 'arg1&tail' 'arg2&tail' | 22 | firejail--env=FIREJAIL_TEST_ARGUMENTS=yes --output=out /usr/lib/firejail/faudit 'arg1&tail' 'arg2&tail' |
diff --git a/test/arguments/readme b/test/arguments/readme deleted file mode 100644 index c28461478..000000000 --- a/test/arguments/readme +++ /dev/null | |||
@@ -1,9 +0,0 @@ | |||
1 | Argument testing fremework for Firejail. | ||
2 | |||
3 | A small test program, argtest, is compiled and installed in /usr/local/bin directory. | ||
4 | Run "make && sudo make install" to install it. | ||
5 | |||
6 | Run "make test" to run the tests. | ||
7 | |||
8 | Run "sudo make uninstall" to remove the test program. | ||
9 | |||