diff options
Diffstat (limited to 'test')
-rwxr-xr-x | test/environment/doubledash.exp | 2 | ||||
-rwxr-xr-x | test/root/firecfg.exp | 8 | ||||
-rwxr-xr-x | test/stress/stress.sh | 4 | ||||
-rwxr-xr-x | test/utils/firecfg-fix.exp | 25 | ||||
-rwxr-xr-x | test/utils/utils.sh | 5 |
5 files changed, 42 insertions, 2 deletions
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 { | |||
57 | 57 | ||
58 | after 100 | 58 | after 100 |
59 | 59 | ||
60 | puts "\n" | 60 | 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 | |||
@@ -43,4 +43,12 @@ expect { | |||
43 | "/usr/local/bin/firefox" | 43 | "/usr/local/bin/firefox" |
44 | } | 44 | } |
45 | after 100 | 45 | after 100 |
46 | |||
47 | send -- "firecfg --fix\r" | ||
48 | expect { | ||
49 | timeout {puts "TESTING ERROR 5\n";exit} | ||
50 | "this option is not supported for root user" | ||
51 | } | ||
52 | |||
53 | after 100 | ||
46 | puts "\nall done\n" | 54 | 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 | |||
15 | rm env.profile | 15 | rm env.profile |
16 | for i in `seq 1 100`; | 16 | for i in `seq 1 100`; |
17 | do | 17 | do |
18 | echo $i | ||
19 | echo "hello" > ~/fj-stress-test/testfile$i | 18 | echo "hello" > ~/fj-stress-test/testfile$i |
20 | echo "blacklist ~/fj-stress-test/testfile$i" >> blacklist.profile | 19 | echo "blacklist ~/fj-stress-test/testfile$i" >> blacklist.profile |
20 | echo "blacklist \${PATH}/sh" >> blacklist.profile | ||
21 | echo "noblacklist ~/fj-stress-test/testfile$i" >> noblacklist.profile | 21 | echo "noblacklist ~/fj-stress-test/testfile$i" >> noblacklist.profile |
22 | echo "noblacklist \${PATH}/sh" >> noblacklist.profile | ||
22 | echo "env FJSTRESS$i=stress" >> env.profile | 23 | echo "env FJSTRESS$i=stress" >> env.profile |
23 | done | 24 | done |
24 | echo "include blacklist.profile" >> noblacklist.profile | 25 | echo "include blacklist.profile" >> noblacklist.profile |
@@ -30,6 +31,7 @@ echo "TESTING: stress env (/test/stress/env.exp)" | |||
30 | ./env.exp | 31 | ./env.exp |
31 | 32 | ||
32 | rm -fr ~/fj-stress-test | 33 | rm -fr ~/fj-stress-test |
34 | |||
33 | rm blacklist.profile | 35 | rm blacklist.profile |
34 | rm noblacklist.profile | 36 | rm noblacklist.profile |
35 | rm env.profile | 37 | 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 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2017 Firejail Authors | ||
4 | # License GPL v2 | ||
5 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | send -- "firecfg --fix\r" | ||
11 | expect { | ||
12 | timeout {puts "TESTING ERROR 0\n";exit} | ||
13 | "created" | ||
14 | } | ||
15 | sleep 1 | ||
16 | |||
17 | send -- "firecfg --fix\r" | ||
18 | expect { | ||
19 | timeout {puts "TESTING ERROR 1\n";exit} | ||
20 | "skipped" | ||
21 | } | ||
22 | sleep 1 | ||
23 | |||
24 | puts "\nall done\n" | ||
25 | |||
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)" | |||
112 | echo "TESTING: firemon name (test/utils/firemon-name.exp)" | 112 | echo "TESTING: firemon name (test/utils/firemon-name.exp)" |
113 | ./firemon-name.exp | 113 | ./firemon-name.exp |
114 | 114 | ||
115 | echo "TESTING: firecfg --fix (test/utils/firecfg-fix.exp)" | ||
116 | mv ~/.local/share/applications ~/firejail-test-local-apps | ||
117 | ./firecfg-fix.exp | ||
118 | rm -fr ~/.local/share/applications | ||
119 | mv ~/firejail-test-local-apps ~/.local/share/applications | ||