diff options
author | netblue30 <netblue30@yahoo.com> | 2016-08-08 06:09:43 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-08 06:09:43 -0400 |
commit | 02a326047dceb0a01cc4103ef49c0124505d9d88 (patch) | |
tree | 1495b16f81c1494d1398a4a4ba07d0409470f9cd | |
parent | Merge pull request #691 from manevich/smallfixes-02 (diff) | |
parent | Don't assume ~/.bashrc exists (diff) | |
download | firejail-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.profile | 2 | ||||
-rwxr-xr-x | test/sysutils/file.exp | 4 | ||||
-rwxr-xr-x | test/sysutils/tar.exp | 17 |
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 | |||
8 | shell none | 8 | shell none |
9 | 9 | ||
10 | # support compressed archives | 10 | # support compressed archives |
11 | private-bin tar,gtar,compress,gzip,lzma,xz,bzip2,lbzip2,lzip,lzop | 11 | private-bin sh,tar,gtar,compress,gzip,lzma,xz,bzip2,lbzip2,lzip,lzop |
12 | private-dev | 12 | private-dev |
13 | private-etc passwd,group,localtime | 13 | private-etc passwd,group,localtime |
14 | hostname tar | 14 | hostname 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 | |||
7 | spawn $env(SHELL) | 7 | spawn $env(SHELL) |
8 | match_max 100000 | 8 | match_max 100000 |
9 | 9 | ||
10 | send -- "firejail file ~/.bashrc\r" | 10 | send -- "echo 'test string for firejail test' > /tmp/firejail_test.txt; firejail file /tmp/firejail_test.txt\r" |
11 | expect { | 11 | expect { |
12 | timeout {puts "TESTING ERROR 1\n";exit} | 12 | timeout {puts "TESTING ERROR 1\n";exit} |
13 | "ASCII text" | 13 | "ASCII text" |
14 | } | 14 | } |
15 | send -- "rm /tmp/firejail_test.txt\r" | ||
16 | sleep 1 | ||
15 | 17 | ||
16 | puts "\nall done\n" | 18 | puts "\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 | ||
10 | send -- "firejail /bin/tar -cjvf firejail_t2 /usr/share/doc/firejail\r" | 10 | send -- "firejail /bin/tar -cjvf firejail_t2 /usr/share/doc/firejail\r" |
11 | expect { | 11 | expect { |
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 | } |
15 | after 100 | 16 | after 100 |
16 | 17 | ||
18 | send -- "stat -c '|%s|' firejail_t2; uname -s\r" | ||
19 | expect { | ||
20 | timeout {puts "TESTING ERROR 2.1\n";exit} | ||
21 | "|0|" {puts "TESTING ERROR 2.2\n";exit} | ||
22 | "Linux" | ||
23 | } | ||
24 | sleep 1 | ||
25 | |||
17 | send -- "firejail /bin/tar --compare --file=firejail_t2 -C / | wc\r" | 26 | send -- "firejail /bin/tar --compare --file=firejail_t2 -C / | wc\r" |
18 | expect { | 27 | expect { |
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 | } |
22 | sleep 1 | 32 | sleep 1 |
23 | send -- "/bin/tar --compare --file=firejail_t2 -C / | wc\r" | 33 | send -- "/bin/tar --compare --file=firejail_t2 -C / | wc\r" |
24 | expect { | 34 | expect { |
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 | } |
28 | sleep 1 | 39 | sleep 1 |