From 46113d48c480249363081ce75086d275948bd644 Mon Sep 17 00:00:00 2001 From: netblue30 Date: Sun, 24 Apr 2016 06:49:25 -0400 Subject: testing --- Makefile.in | 5 +- test/firemon/caps.exp | 129 --------------------------------------------- test/firemon/caps1.profile | 1 - test/firemon/caps2.profile | 1 - test/firemon/firemon.sh | 10 ---- test/firemon/seccomp.exp | 48 ----------------- test/utils/caps.exp | 129 +++++++++++++++++++++++++++++++++++++++++++++ test/utils/caps1.profile | 1 + test/utils/caps2.profile | 1 + test/utils/seccomp.exp | 48 +++++++++++++++++ test/utils/utils.sh | 6 +++ 11 files changed, 186 insertions(+), 193 deletions(-) delete mode 100755 test/firemon/caps.exp delete mode 100644 test/firemon/caps1.profile delete mode 100644 test/firemon/caps2.profile delete mode 100755 test/firemon/firemon.sh delete mode 100755 test/firemon/seccomp.exp create mode 100755 test/utils/caps.exp create mode 100644 test/utils/caps1.profile create mode 100644 test/utils/caps2.profile create mode 100755 test/utils/seccomp.exp diff --git a/Makefile.in b/Makefile.in index 4f777583c..d33ff0aff 100644 --- a/Makefile.in +++ b/Makefile.in @@ -277,14 +277,11 @@ test-apps: test-apps-x11: cd test/apps-x11; ./apps-x11.sh | grep TESTING -test-firemon: - cd test/firemon; ./firemon.sh | grep TESTING - test-utils: cd test/utils; ./utils.sh | grep TESTING test-environment: cd test/environment; ./environment.sh | grep TESTING -test: test-profiles test-utils test-environment test-apps test-apps-x11 test-firemon +test: test-profiles test-utils test-environment test-apps test-apps-x11 echo "TEST COMPLETE" diff --git a/test/firemon/caps.exp b/test/firemon/caps.exp deleted file mode 100755 index ab1067921..000000000 --- a/test/firemon/caps.exp +++ /dev/null @@ -1,129 +0,0 @@ -#!/usr/bin/expect -f -# This file is part of Firejail project -# Copyright (C) 2014-2016 Firejail Authors -# License GPL v2 - -set timeout 10 -spawn $env(SHELL) -match_max 100000 - -send -- "firejail --name=bingo1 --noprofile --caps\r" -expect { - timeout {puts "TESTING ERROR 0\n";exit} - "Child process initialized" -} -sleep 1 - -spawn $env(SHELL) -send -- "firejail --name=bingo2 --noprofile\r" -expect { - timeout {puts "TESTING ERROR 1\n";exit} - "Child process initialized" -} -sleep 1 - -spawn $env(SHELL) -send -- "firejail --name=bingo3 --noprofile --caps.drop=all\r" -expect { - timeout {puts "TESTING ERROR 2\n";exit} - "Child process initialized" -} -sleep 1 - -spawn $env(SHELL) -send -- "firejail --noprofile --name=bingo4 --caps.drop=chown,kill\r" -expect { - timeout {puts "TESTING ERROR 3\n";exit} - "Child process initialized" -} -sleep 1 - -spawn $env(SHELL) -send -- "firejail --noprofile --name=bingo5 --caps.keep=chown,kill\r" -expect { - timeout {puts "TESTING ERROR 4\n";exit} - "Child process initialized" -} -sleep 1 - -spawn $env(SHELL) -send -- "firejail --name=bingo6 --profile=caps1.profile\r" -expect { - timeout {puts "TESTING ERROR 5\n";exit} - "Child process initialized" -} -sleep 1 - -spawn $env(SHELL) -send -- "firejail --name=bingo7 --profile=caps2.profile\r" -expect { - timeout {puts "TESTING ERROR 0\n";exit} - "Child process initialized" -} -sleep 1 - -spawn $env(SHELL) -send -- "firemon --caps\r" -expect { - timeout {puts "TESTING ERROR 8.1\n";exit} - "bingo1" -} -expect { - timeout {puts "TESTING ERROR 8.2\n";exit} - "31cffff" -} -expect { - timeout {puts "TESTING ERROR 8.3\n";exit} - "bingo2" -} -expect { - timeout {puts "TESTING ERROR 8.4\n";exit} - "fffffff" -} -expect { - timeout {puts "TESTING ERROR 8.5\n";exit} - "bingo3" -} -expect { - timeout {puts "TESTING ERROR 8.6\n";exit} - "000000000000" -} - -expect { - timeout {puts "TESTING ERROR 8.7\n";exit} - "bingo4" -} -expect { - timeout {puts "TESTING ERROR 8.8\n";exit} - "ffffffde" -} -expect { - timeout {puts "TESTING ERROR 8.9\n";exit} - "bingo5" -} -expect { - timeout {puts "TESTING ERROR 8.10\n";exit} - "0000000000000021" -} - -expect { - timeout {puts "TESTING ERROR 8.11\n";exit} - "bingo6" -} -expect { - timeout {puts "TESTING ERROR 8.12\n";exit} - "ffffffde" -} -expect { - timeout {puts "TESTING ERROR 8.13\n";exit} - "bingo7" -} -expect { - timeout {puts "TESTING ERROR 8.14\n";exit} - "0000000000000021" -} - -after 100 - -puts "all done\n" - diff --git a/test/firemon/caps1.profile b/test/firemon/caps1.profile deleted file mode 100644 index e14655b2e..000000000 --- a/test/firemon/caps1.profile +++ /dev/null @@ -1 +0,0 @@ -caps.drop chown,kill \ No newline at end of file diff --git a/test/firemon/caps2.profile b/test/firemon/caps2.profile deleted file mode 100644 index cb2258c52..000000000 --- a/test/firemon/caps2.profile +++ /dev/null @@ -1 +0,0 @@ -caps.keep chown,kill \ No newline at end of file diff --git a/test/firemon/firemon.sh b/test/firemon/firemon.sh deleted file mode 100755 index edd548526..000000000 --- a/test/firemon/firemon.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -# This file is part of Firejail project -# Copyright (C) 2014-2016 Firejail Authors -# License GPL v2 - -echo "TESTING: firemon --seccomp (test/firemon/seccomp.exp)" -./seccomp.exp - -echo "TESTING: firemon --caps (test/firemon/caps.exp)" -./caps.exp diff --git a/test/firemon/seccomp.exp b/test/firemon/seccomp.exp deleted file mode 100755 index a318e39b1..000000000 --- a/test/firemon/seccomp.exp +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/expect -f -# This file is part of Firejail project -# Copyright (C) 2014-2016 Firejail Authors -# License GPL v2 - -set timeout 10 -spawn $env(SHELL) -match_max 100000 - -send -- "firejail --noprofile --name=bingo1 --seccomp\r" -expect { - timeout {puts "TESTING ERROR 0\n";exit} - "Child process initialized" -} -sleep 1 - -spawn $env(SHELL) -send -- "firejail --noprofile --name=bingo2\r" -expect { - timeout {puts "TESTING ERROR 0.1\n";exit} - "Child process initialized" -} -sleep 1 - - - - -spawn $env(SHELL) -send -- "firemon --seccomp\r" -expect { - timeout {puts "TESTING ERROR 1\n";exit} - "bingo1" -} -expect { - timeout {puts "TESTING ERROR 2\n";exit} - "Seccomp: 2" -} -expect { - timeout {puts "TESTING ERROR 3\n";exit} - "bingo2" -} -expect { - timeout {puts "TESTING ERROR 3\n";exit} - "Seccomp: 0" -} -after 100 - -puts "all done\n" diff --git a/test/utils/caps.exp b/test/utils/caps.exp new file mode 100755 index 000000000..ab1067921 --- /dev/null +++ b/test/utils/caps.exp @@ -0,0 +1,129 @@ +#!/usr/bin/expect -f +# This file is part of Firejail project +# Copyright (C) 2014-2016 Firejail Authors +# License GPL v2 + +set timeout 10 +spawn $env(SHELL) +match_max 100000 + +send -- "firejail --name=bingo1 --noprofile --caps\r" +expect { + timeout {puts "TESTING ERROR 0\n";exit} + "Child process initialized" +} +sleep 1 + +spawn $env(SHELL) +send -- "firejail --name=bingo2 --noprofile\r" +expect { + timeout {puts "TESTING ERROR 1\n";exit} + "Child process initialized" +} +sleep 1 + +spawn $env(SHELL) +send -- "firejail --name=bingo3 --noprofile --caps.drop=all\r" +expect { + timeout {puts "TESTING ERROR 2\n";exit} + "Child process initialized" +} +sleep 1 + +spawn $env(SHELL) +send -- "firejail --noprofile --name=bingo4 --caps.drop=chown,kill\r" +expect { + timeout {puts "TESTING ERROR 3\n";exit} + "Child process initialized" +} +sleep 1 + +spawn $env(SHELL) +send -- "firejail --noprofile --name=bingo5 --caps.keep=chown,kill\r" +expect { + timeout {puts "TESTING ERROR 4\n";exit} + "Child process initialized" +} +sleep 1 + +spawn $env(SHELL) +send -- "firejail --name=bingo6 --profile=caps1.profile\r" +expect { + timeout {puts "TESTING ERROR 5\n";exit} + "Child process initialized" +} +sleep 1 + +spawn $env(SHELL) +send -- "firejail --name=bingo7 --profile=caps2.profile\r" +expect { + timeout {puts "TESTING ERROR 0\n";exit} + "Child process initialized" +} +sleep 1 + +spawn $env(SHELL) +send -- "firemon --caps\r" +expect { + timeout {puts "TESTING ERROR 8.1\n";exit} + "bingo1" +} +expect { + timeout {puts "TESTING ERROR 8.2\n";exit} + "31cffff" +} +expect { + timeout {puts "TESTING ERROR 8.3\n";exit} + "bingo2" +} +expect { + timeout {puts "TESTING ERROR 8.4\n";exit} + "fffffff" +} +expect { + timeout {puts "TESTING ERROR 8.5\n";exit} + "bingo3" +} +expect { + timeout {puts "TESTING ERROR 8.6\n";exit} + "000000000000" +} + +expect { + timeout {puts "TESTING ERROR 8.7\n";exit} + "bingo4" +} +expect { + timeout {puts "TESTING ERROR 8.8\n";exit} + "ffffffde" +} +expect { + timeout {puts "TESTING ERROR 8.9\n";exit} + "bingo5" +} +expect { + timeout {puts "TESTING ERROR 8.10\n";exit} + "0000000000000021" +} + +expect { + timeout {puts "TESTING ERROR 8.11\n";exit} + "bingo6" +} +expect { + timeout {puts "TESTING ERROR 8.12\n";exit} + "ffffffde" +} +expect { + timeout {puts "TESTING ERROR 8.13\n";exit} + "bingo7" +} +expect { + timeout {puts "TESTING ERROR 8.14\n";exit} + "0000000000000021" +} + +after 100 + +puts "all done\n" + diff --git a/test/utils/caps1.profile b/test/utils/caps1.profile new file mode 100644 index 000000000..e14655b2e --- /dev/null +++ b/test/utils/caps1.profile @@ -0,0 +1 @@ +caps.drop chown,kill \ No newline at end of file diff --git a/test/utils/caps2.profile b/test/utils/caps2.profile new file mode 100644 index 000000000..cb2258c52 --- /dev/null +++ b/test/utils/caps2.profile @@ -0,0 +1 @@ +caps.keep chown,kill \ No newline at end of file diff --git a/test/utils/seccomp.exp b/test/utils/seccomp.exp new file mode 100755 index 000000000..a318e39b1 --- /dev/null +++ b/test/utils/seccomp.exp @@ -0,0 +1,48 @@ +#!/usr/bin/expect -f +# This file is part of Firejail project +# Copyright (C) 2014-2016 Firejail Authors +# License GPL v2 + +set timeout 10 +spawn $env(SHELL) +match_max 100000 + +send -- "firejail --noprofile --name=bingo1 --seccomp\r" +expect { + timeout {puts "TESTING ERROR 0\n";exit} + "Child process initialized" +} +sleep 1 + +spawn $env(SHELL) +send -- "firejail --noprofile --name=bingo2\r" +expect { + timeout {puts "TESTING ERROR 0.1\n";exit} + "Child process initialized" +} +sleep 1 + + + + +spawn $env(SHELL) +send -- "firemon --seccomp\r" +expect { + timeout {puts "TESTING ERROR 1\n";exit} + "bingo1" +} +expect { + timeout {puts "TESTING ERROR 2\n";exit} + "Seccomp: 2" +} +expect { + timeout {puts "TESTING ERROR 3\n";exit} + "bingo2" +} +expect { + timeout {puts "TESTING ERROR 3\n";exit} + "Seccomp: 0" +} +after 100 + +puts "all done\n" diff --git a/test/utils/utils.sh b/test/utils/utils.sh index 8c53feab3..23cbc6b35 100755 --- a/test/utils/utils.sh +++ b/test/utils/utils.sh @@ -69,3 +69,9 @@ rm -f index.html* ./trace.exp rm -f index.html* +echo "TESTING: firemon --seccomp (test/utils/seccomp.exp)" +./seccomp.exp + +echo "TESTING: firemon --caps (test/ustil/caps.exp)" +./caps.exp + -- cgit v1.2.3-54-g00ecf