aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2016-08-08 06:09:43 -0400
committerLibravatar GitHub <noreply@github.com>2016-08-08 06:09:43 -0400
commit02a326047dceb0a01cc4103ef49c0124505d9d88 (patch)
tree1495b16f81c1494d1398a4a4ba07d0409470f9cd
parentMerge pull request #691 from manevich/smallfixes-02 (diff)
parentDon't assume ~/.bashrc exists (diff)
downloadfirejail-02a326047dceb0a01cc4103ef49c0124505d9d88.tar.gz
firejail-02a326047dceb0a01cc4103ef49c0124505d9d88.tar.zst
firejail-02a326047dceb0a01cc4103ef49c0124505d9d88.zip
Merge pull request #689 from reinerh/master
tar profile and test fixes
-rw-r--r--etc/tar.profile2
-rwxr-xr-xtest/sysutils/file.exp4
-rwxr-xr-xtest/sysutils/tar.exp17
3 files changed, 18 insertions, 5 deletions
diff --git a/etc/tar.profile b/etc/tar.profile
index 6daa7396a..78bf7ad13 100644
--- a/etc/tar.profile
+++ b/etc/tar.profile
@@ -8,7 +8,7 @@ net none
8shell none 8shell none
9 9
10# support compressed archives 10# support compressed archives
11private-bin tar,gtar,compress,gzip,lzma,xz,bzip2,lbzip2,lzip,lzop 11private-bin sh,tar,gtar,compress,gzip,lzma,xz,bzip2,lbzip2,lzip,lzop
12private-dev 12private-dev
13private-etc passwd,group,localtime 13private-etc passwd,group,localtime
14hostname tar 14hostname tar
diff --git a/test/sysutils/file.exp b/test/sysutils/file.exp
index e40b83197..a8ad84d12 100755
--- a/test/sysutils/file.exp
+++ b/test/sysutils/file.exp
@@ -7,10 +7,12 @@ set timeout 10
7spawn $env(SHELL) 7spawn $env(SHELL)
8match_max 100000 8match_max 100000
9 9
10send -- "firejail file ~/.bashrc\r" 10send -- "echo 'test string for firejail test' > /tmp/firejail_test.txt; firejail file /tmp/firejail_test.txt\r"
11expect { 11expect {
12 timeout {puts "TESTING ERROR 1\n";exit} 12 timeout {puts "TESTING ERROR 1\n";exit}
13 "ASCII text" 13 "ASCII text"
14} 14}
15send -- "rm /tmp/firejail_test.txt\r"
16sleep 1
15 17
16puts "\nall done\n" 18puts "\nall done\n"
diff --git a/test/sysutils/tar.exp b/test/sysutils/tar.exp
index af569f5ac..f41d67d6f 100755
--- a/test/sysutils/tar.exp
+++ b/test/sysutils/tar.exp
@@ -9,20 +9,31 @@ match_max 100000
9 9
10send -- "firejail /bin/tar -cjvf firejail_t2 /usr/share/doc/firejail\r" 10send -- "firejail /bin/tar -cjvf firejail_t2 /usr/share/doc/firejail\r"
11expect { 11expect {
12 timeout {puts "TESTING ERROR 1\n";exit} 12 timeout {puts "TESTING ERROR 1.1\n";exit}
13 "Error" {puts "TESTING ERROR 1.2\n";exit}
13 "/usr/share/doc/firejail/README" 14 "/usr/share/doc/firejail/README"
14} 15}
15after 100 16after 100
16 17
18send -- "stat -c '|%s|' firejail_t2; uname -s\r"
19expect {
20 timeout {puts "TESTING ERROR 2.1\n";exit}
21 "|0|" {puts "TESTING ERROR 2.2\n";exit}
22 "Linux"
23}
24sleep 1
25
17send -- "firejail /bin/tar --compare --file=firejail_t2 -C / | wc\r" 26send -- "firejail /bin/tar --compare --file=firejail_t2 -C / | wc\r"
18expect { 27expect {
19 timeout {puts "TESTING ERROR 2\n";exit} 28 timeout {puts "TESTING ERROR 3.1\n";exit}
29 "This does not look like a tar archive" {puts "TESTING ERROR 3.2\n"; exit}
20 " 0 0 0" 30 " 0 0 0"
21} 31}
22sleep 1 32sleep 1
23send -- "/bin/tar --compare --file=firejail_t2 -C / | wc\r" 33send -- "/bin/tar --compare --file=firejail_t2 -C / | wc\r"
24expect { 34expect {
25 timeout {puts "TESTING ERROR 3\n";exit} 35 timeout {puts "TESTING ERROR 4.1\n";exit}
36 "This does not look like a tar archive" {puts "TESTING ERROR 4.2\n"; exit}
26 " 0 0 0" 37 " 0 0 0"
27} 38}
28sleep 1 39sleep 1