From c0b5b9acf0324db45a8a60f490e1a29c4ccd0cb1 Mon Sep 17 00:00:00 2001 From: netblue30 Date: Mon, 7 Nov 2016 14:52:37 -0500 Subject: testing --- test/arguments/Makefile | 13 ------------- test/arguments/arguments.sh | 4 ++++ test/arguments/bashrun.sh | 12 ++++++------ test/arguments/joinrun.sh | 12 ++++++------ test/arguments/main.c | 31 ------------------------------- test/arguments/outrun.sh | 12 ++++++------ test/arguments/readme | 9 --------- 7 files changed, 22 insertions(+), 71 deletions(-) delete mode 100644 test/arguments/Makefile delete mode 100644 test/arguments/main.c delete mode 100644 test/arguments/readme (limited to 'test') 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 @@ -all: argtest - -argtest: main.c - gcc -o argtest main.c - -clean:; rm -f argtest; rm -fr symtest; rm -f out out.* - -install:;install -c -m 0755 argtest /usr/local/bin/argtest - -uninstall:; rm -f /usr/local/bin/argtest - - -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 @@ echo "TESTING: 1. regular bash session" ./bashrun.exp +sleep 1 echo "TESTING: 2. symbolic link to firejail" ./symrun.exp +rm -fr symtest +sleep 1 echo "TESTING: 3. --join option" ./joinrun.exp +sleep 1 echo "TESTING: 4. --output option" ./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 @@ #!/bin/bash echo "TESTING: 1.1 - simple args" -firejail --quiet ./argtest arg1 arg2 +firejail --env=FIREJAIL_TEST_ARGUMENTS=yes --quiet /usr/lib/firejail/faudit arg1 arg2 # simple quotes, testing spaces in file names echo "TESTING: 1.2 - args with space and \"" -firejail --quiet ./argtest "arg1 tail" "arg2 tail" +firejail --env=FIREJAIL_TEST_ARGUMENTS=yes --quiet /usr/lib/firejail/faudit "arg1 tail" "arg2 tail" echo "TESTING: 1.3 - args with space and '" -firejail --quiet ./argtest 'arg1 tail' 'arg2 tail' +firejail --env=FIREJAIL_TEST_ARGUMENTS=yes --quiet /usr/lib/firejail/faudit 'arg1 tail' 'arg2 tail' # escaped space in file names echo "TESTING: 1.4 - args with space and \\" -firejail --quiet ./argtest arg1\ tail arg2\ tail +firejail --env=FIREJAIL_TEST_ARGUMENTS=yes --quiet /usr/lib/firejail/faudit arg1\ tail arg2\ tail # & char appears in URLs - URLs should be quoted echo "TESTING: 1.5 - args with & and \"" -firejail --quiet ./argtest "arg1&tail" "arg2&tail" +firejail --env=FIREJAIL_TEST_ARGUMENTS=yes --quiet /usr/lib/firejail/faudit "arg1&tail" "arg2&tail" echo "TESTING: 1.6 - args with & and '" -firejail --quiet ./argtest 'arg1&tail' 'arg2&tail' +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 @@ #!/bin/bash echo "TESTING: 3.1 - simple args" -firejail --join=joinrun ./argtest arg1 arg2 +firejail --env=FIREJAIL_TEST_ARGUMENTS=yes --join=joinrun /usr/lib/firejail/faudit arg1 arg2 # simple quotes, testing spaces in file names echo "TESTING: 3.2 - args with space and \"" -firejail --quiet ./argtest "arg1 tail" "arg2 tail" +firejail--env=FIREJAIL_TEST_ARGUMENTS=yes --quiet /usr/lib/firejail/faudit "arg1 tail" "arg2 tail" echo "TESTING: 3.3 - args with space and '" -firejail --quiet ./argtest 'arg1 tail' 'arg2 tail' +firejail --env=FIREJAIL_TEST_ARGUMENTS=yes --quiet /usr/lib/firejail/faudit 'arg1 tail' 'arg2 tail' # escaped space in file names echo "TESTING: 3.4 - args with space and \\" -firejail --quiet ./argtest arg1\ tail arg2\ tail +firejail--env=FIREJAIL_TEST_ARGUMENTS=yes --quiet /usr/lib/firejail/faudit arg1\ tail arg2\ tail # & char appears in URLs - URLs should be quoted echo "TESTING: 3.5 - args with & and \"" -firejail --quiet ./argtest "arg1&tail" "arg2&tail" +firejail --env=FIREJAIL_TEST_ARGUMENTS=yes --quiet /usr/lib/firejail/faudit "arg1&tail" "arg2&tail" echo "TESTING: 3.6 - args with & and '" -firejail --quiet ./argtest 'arg1&tail' 'arg2&tail' +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 @@ -/* - * Copyright (C) 2014-2016 Firejail Authors - * - * This file is part of firejail project - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ -#include - -int main(int argc, char **argv) { - printf("Arguments:\n"); - - int i; - for (i = 0; i < argc; i++) { - printf("#%s#\n", argv[i]); - } - - return 0; -} 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 @@ #!/bin/bash echo "TESTING: 4.1 - simple args" -firejail --output=out ./argtest arg1 arg2 +firejail --env=FIREJAIL_TEST_ARGUMENTS=yes --output=out /usr/lib/firejail/faudit arg1 arg2 # simple quotes, testing spaces in file names echo "TESTING: 4.2 - args with space and \"" -firejail --output=out ./argtest "arg1 tail" "arg2 tail" +firejail --env=FIREJAIL_TEST_ARGUMENTS=yes --output=out /usr/lib/firejail/faudit "arg1 tail" "arg2 tail" echo "TESTING: 4.3 - args with space and '" -firejail --output=out ./argtest 'arg1 tail' 'arg2 tail' +firejail--env=FIREJAIL_TEST_ARGUMENTS=yes --output=out /usr/lib/firejail/faudit 'arg1 tail' 'arg2 tail' # escaped space in file names echo "TESTING: 4.4 - args with space and \\" -firejail --output=out ./argtest arg1\ tail arg2\ tail +firejail--env=FIREJAIL_TEST_ARGUMENTS=yes --output=out /usr/lib/firejail/faudit arg1\ tail arg2\ tail # & char appears in URLs - URLs should be quoted echo "TESTING: 4.5 - args with & and \"" -firejail --output=out ./argtest "arg1&tail" "arg2&tail" +firejail --env=FIREJAIL_TEST_ARGUMENTS=yes --output=out /usr/lib/firejail/faudit "arg1&tail" "arg2&tail" echo "TESTING: 4.6 - args with & and '" -firejail --output=out ./argtest 'arg1&tail' 'arg2&tail' +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 @@ -Argument testing fremework for Firejail. - -A small test program, argtest, is compiled and installed in /usr/local/bin directory. -Run "make && sudo make install" to install it. - -Run "make test" to run the tests. - -Run "sudo make uninstall" to remove the test program. - -- cgit v1.2.3-54-g00ecf