aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2016-11-07 14:52:37 -0500
committerLibravatar netblue30 <netblue30@yahoo.com>2016-11-07 14:52:37 -0500
commitc0b5b9acf0324db45a8a60f490e1a29c4ccd0cb1 (patch)
tree589023cc9372bc082123b143e2dd11be3894b9af /test
parentgcov support (diff)
downloadfirejail-c0b5b9acf0324db45a8a60f490e1a29c4ccd0cb1.tar.gz
firejail-c0b5b9acf0324db45a8a60f490e1a29c4ccd0cb1.tar.zst
firejail-c0b5b9acf0324db45a8a60f490e1a29c4ccd0cb1.zip
testing
Diffstat (limited to 'test')
-rw-r--r--test/arguments/Makefile13
-rwxr-xr-xtest/arguments/arguments.sh4
-rwxr-xr-xtest/arguments/bashrun.sh12
-rwxr-xr-xtest/arguments/joinrun.sh12
-rw-r--r--test/arguments/main.c31
-rwxr-xr-xtest/arguments/outrun.sh12
-rw-r--r--test/arguments/readme9
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 @@
1all: argtest
2
3argtest: main.c
4 gcc -o argtest main.c
5
6clean:; rm -f argtest; rm -fr symtest; rm -f out out.*
7
8install:;install -c -m 0755 argtest /usr/local/bin/argtest
9
10uninstall:; rm -f /usr/local/bin/argtest
11
12
13test:; ./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
5echo "TESTING: 1. regular bash session" 5echo "TESTING: 1. regular bash session"
6./bashrun.exp 6./bashrun.exp
7sleep 1
7 8
8echo "TESTING: 2. symbolic link to firejail" 9echo "TESTING: 2. symbolic link to firejail"
9./symrun.exp 10./symrun.exp
11rm -fr symtest
12sleep 1
10 13
11echo "TESTING: 3. --join option" 14echo "TESTING: 3. --join option"
12./joinrun.exp 15./joinrun.exp
16sleep 1
13 17
14echo "TESTING: 4. --output option" 18echo "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
3echo "TESTING: 1.1 - simple args" 3echo "TESTING: 1.1 - simple args"
4firejail --quiet ./argtest arg1 arg2 4firejail --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
7echo "TESTING: 1.2 - args with space and \"" 7echo "TESTING: 1.2 - args with space and \""
8firejail --quiet ./argtest "arg1 tail" "arg2 tail" 8firejail --env=FIREJAIL_TEST_ARGUMENTS=yes --quiet /usr/lib/firejail/faudit "arg1 tail" "arg2 tail"
9 9
10echo "TESTING: 1.3 - args with space and '" 10echo "TESTING: 1.3 - args with space and '"
11firejail --quiet ./argtest 'arg1 tail' 'arg2 tail' 11firejail --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
14echo "TESTING: 1.4 - args with space and \\" 14echo "TESTING: 1.4 - args with space and \\"
15firejail --quiet ./argtest arg1\ tail arg2\ tail 15firejail --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
18echo "TESTING: 1.5 - args with & and \"" 18echo "TESTING: 1.5 - args with & and \""
19firejail --quiet ./argtest "arg1&tail" "arg2&tail" 19firejail --env=FIREJAIL_TEST_ARGUMENTS=yes --quiet /usr/lib/firejail/faudit "arg1&tail" "arg2&tail"
20 20
21echo "TESTING: 1.6 - args with & and '" 21echo "TESTING: 1.6 - args with & and '"
22firejail --quiet ./argtest 'arg1&tail' 'arg2&tail' 22firejail --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
3echo "TESTING: 3.1 - simple args" 3echo "TESTING: 3.1 - simple args"
4firejail --join=joinrun ./argtest arg1 arg2 4firejail --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
7echo "TESTING: 3.2 - args with space and \"" 7echo "TESTING: 3.2 - args with space and \""
8firejail --quiet ./argtest "arg1 tail" "arg2 tail" 8firejail--env=FIREJAIL_TEST_ARGUMENTS=yes --quiet /usr/lib/firejail/faudit "arg1 tail" "arg2 tail"
9 9
10echo "TESTING: 3.3 - args with space and '" 10echo "TESTING: 3.3 - args with space and '"
11firejail --quiet ./argtest 'arg1 tail' 'arg2 tail' 11firejail --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
14echo "TESTING: 3.4 - args with space and \\" 14echo "TESTING: 3.4 - args with space and \\"
15firejail --quiet ./argtest arg1\ tail arg2\ tail 15firejail--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
18echo "TESTING: 3.5 - args with & and \"" 18echo "TESTING: 3.5 - args with & and \""
19firejail --quiet ./argtest "arg1&tail" "arg2&tail" 19firejail --env=FIREJAIL_TEST_ARGUMENTS=yes --quiet /usr/lib/firejail/faudit "arg1&tail" "arg2&tail"
20 20
21echo "TESTING: 3.6 - args with & and '" 21echo "TESTING: 3.6 - args with & and '"
22firejail --quiet ./argtest 'arg1&tail' 'arg2&tail' 22firejail --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
22int 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
3echo "TESTING: 4.1 - simple args" 3echo "TESTING: 4.1 - simple args"
4firejail --output=out ./argtest arg1 arg2 4firejail --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
7echo "TESTING: 4.2 - args with space and \"" 7echo "TESTING: 4.2 - args with space and \""
8firejail --output=out ./argtest "arg1 tail" "arg2 tail" 8firejail --env=FIREJAIL_TEST_ARGUMENTS=yes --output=out /usr/lib/firejail/faudit "arg1 tail" "arg2 tail"
9 9
10echo "TESTING: 4.3 - args with space and '" 10echo "TESTING: 4.3 - args with space and '"
11firejail --output=out ./argtest 'arg1 tail' 'arg2 tail' 11firejail--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
14echo "TESTING: 4.4 - args with space and \\" 14echo "TESTING: 4.4 - args with space and \\"
15firejail --output=out ./argtest arg1\ tail arg2\ tail 15firejail--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
18echo "TESTING: 4.5 - args with & and \"" 18echo "TESTING: 4.5 - args with & and \""
19firejail --output=out ./argtest "arg1&tail" "arg2&tail" 19firejail --env=FIREJAIL_TEST_ARGUMENTS=yes --output=out /usr/lib/firejail/faudit "arg1&tail" "arg2&tail"
20 20
21echo "TESTING: 4.6 - args with & and '" 21echo "TESTING: 4.6 - args with & and '"
22firejail --output=out ./argtest 'arg1&tail' 'arg2&tail' 22firejail--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 @@
1Argument testing fremework for Firejail.
2
3A small test program, argtest, is compiled and installed in /usr/local/bin directory.
4Run "make && sudo make install" to install it.
5
6Run "make test" to run the tests.
7
8Run "sudo make uninstall" to remove the test program.
9