aboutsummaryrefslogtreecommitdiffstats
path: root/test/sysutils
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2016-07-31 10:06:41 -0400
committerLibravatar netblue30 <netblue30@yahoo.com>2016-07-31 10:06:41 -0400
commit59cd5a6b6bb90d316d7f628fd6fc2df9ff2b17ab (patch)
treeb8e44859848ece18a81e63afc7910d0d0a4ca544 /test/sysutils
parentMerge pull request #662 from reinerh/master (diff)
downloadfirejail-59cd5a6b6bb90d316d7f628fd6fc2df9ff2b17ab.tar.gz
firejail-59cd5a6b6bb90d316d7f628fd6fc2df9ff2b17ab.tar.zst
firejail-59cd5a6b6bb90d316d7f628fd6fc2df9ff2b17ab.zip
cleanup and some new tests
Diffstat (limited to 'test/sysutils')
-rwxr-xr-xtest/sysutils/file.exp16
-rwxr-xr-xtest/sysutils/sysutils.sh18
-rwxr-xr-xtest/sysutils/tar.exp35
3 files changed, 69 insertions, 0 deletions
diff --git a/test/sysutils/file.exp b/test/sysutils/file.exp
new file mode 100755
index 000000000..e40b83197
--- /dev/null
+++ b/test/sysutils/file.exp
@@ -0,0 +1,16 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2016 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail file ~/.bashrc\r"
11expect {
12 timeout {puts "TESTING ERROR 1\n";exit}
13 "ASCII text"
14}
15
16puts "\nall done\n"
diff --git a/test/sysutils/sysutils.sh b/test/sysutils/sysutils.sh
index d75738f97..315b73c9d 100755
--- a/test/sysutils/sysutils.sh
+++ b/test/sysutils/sysutils.sh
@@ -60,3 +60,21 @@ else
60 echo "TESTING SKIP: less not found" 60 echo "TESTING SKIP: less not found"
61fi 61fi
62 62
63which file
64if [ "$?" -eq 0 ];
65then
66 echo "TESTING: file"
67 ./file.exp
68else
69 echo "TESTING SKIP: file not found"
70fi
71
72which tar
73if [ "$?" -eq 0 ];
74then
75 echo "TESTING: tar"
76 ./tar.exp
77else
78 echo "TESTING SKIP: tar not found"
79fi
80
diff --git a/test/sysutils/tar.exp b/test/sysutils/tar.exp
new file mode 100755
index 000000000..af569f5ac
--- /dev/null
+++ b/test/sysutils/tar.exp
@@ -0,0 +1,35 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2016 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail /bin/tar -cjvf firejail_t2 /usr/share/doc/firejail\r"
11expect {
12 timeout {puts "TESTING ERROR 1\n";exit}
13 "/usr/share/doc/firejail/README"
14}
15after 100
16
17send -- "firejail /bin/tar --compare --file=firejail_t2 -C / | wc\r"
18expect {
19 timeout {puts "TESTING ERROR 2\n";exit}
20 " 0 0 0"
21}
22sleep 1
23send -- "/bin/tar --compare --file=firejail_t2 -C / | wc\r"
24expect {
25 timeout {puts "TESTING ERROR 3\n";exit}
26 " 0 0 0"
27}
28sleep 1
29
30
31send -- "rm firejail_t*\r"
32sleep 1
33
34
35puts "\nall done\n"