From 0386d562f44ebf612980c7d779336e967973f9c5 Mon Sep 17 00:00:00 2001 From: netblue30 Date: Fri, 31 Mar 2017 11:05:05 -0400 Subject: testing --- test/environment/doubledash.exp | 2 +- test/root/firecfg.exp | 8 ++++++++ test/stress/stress.sh | 4 +++- test/utils/firecfg-fix.exp | 25 +++++++++++++++++++++++++ test/utils/utils.sh | 5 +++++ 5 files changed, 42 insertions(+), 2 deletions(-) create mode 100755 test/utils/firecfg-fix.exp (limited to 'test') diff --git a/test/environment/doubledash.exp b/test/environment/doubledash.exp index 2eaa7d9ce..ed0419f2d 100755 --- a/test/environment/doubledash.exp +++ b/test/environment/doubledash.exp @@ -57,4 +57,4 @@ expect { after 100 -puts "\n" +puts "\nall done\n" diff --git a/test/root/firecfg.exp b/test/root/firecfg.exp index c9085e8c8..8961aed60 100755 --- a/test/root/firecfg.exp +++ b/test/root/firecfg.exp @@ -42,5 +42,13 @@ expect { timeout {puts "TESTING ERROR 5\n";exit} "/usr/local/bin/firefox" } +after 100 + +send -- "firecfg --fix\r" +expect { + timeout {puts "TESTING ERROR 5\n";exit} + "this option is not supported for root user" +} + after 100 puts "\nall done\n" diff --git a/test/stress/stress.sh b/test/stress/stress.sh index e95d304c4..6a140ab22 100755 --- a/test/stress/stress.sh +++ b/test/stress/stress.sh @@ -15,10 +15,11 @@ rm noblacklist.profile rm env.profile for i in `seq 1 100`; do - echo $i echo "hello" > ~/fj-stress-test/testfile$i echo "blacklist ~/fj-stress-test/testfile$i" >> blacklist.profile + echo "blacklist \${PATH}/sh" >> blacklist.profile echo "noblacklist ~/fj-stress-test/testfile$i" >> noblacklist.profile + echo "noblacklist \${PATH}/sh" >> noblacklist.profile echo "env FJSTRESS$i=stress" >> env.profile done echo "include blacklist.profile" >> noblacklist.profile @@ -30,6 +31,7 @@ echo "TESTING: stress env (/test/stress/env.exp)" ./env.exp rm -fr ~/fj-stress-test + rm blacklist.profile rm noblacklist.profile rm env.profile diff --git a/test/utils/firecfg-fix.exp b/test/utils/firecfg-fix.exp new file mode 100755 index 000000000..685ce9c7b --- /dev/null +++ b/test/utils/firecfg-fix.exp @@ -0,0 +1,25 @@ +#!/usr/bin/expect -f +# This file is part of Firejail project +# Copyright (C) 2014-2017 Firejail Authors +# License GPL v2 + +set timeout 10 +spawn $env(SHELL) +match_max 100000 + +send -- "firecfg --fix\r" +expect { + timeout {puts "TESTING ERROR 0\n";exit} + "created" +} +sleep 1 + +send -- "firecfg --fix\r" +expect { + timeout {puts "TESTING ERROR 1\n";exit} + "skipped" +} +sleep 1 + +puts "\nall done\n" + diff --git a/test/utils/utils.sh b/test/utils/utils.sh index 751f1f8e7..d5ee5ef32 100755 --- a/test/utils/utils.sh +++ b/test/utils/utils.sh @@ -112,3 +112,8 @@ echo "TESTING: firemon interface (test/utils/firemon-interface.exp)" echo "TESTING: firemon name (test/utils/firemon-name.exp)" ./firemon-name.exp +echo "TESTING: firecfg --fix (test/utils/firecfg-fix.exp)" +mv ~/.local/share/applications ~/firejail-test-local-apps +./firecfg-fix.exp +rm -fr ~/.local/share/applications +mv ~/firejail-test-local-apps ~/.local/share/applications -- cgit v1.2.3-54-g00ecf