aboutsummaryrefslogtreecommitdiffstats
path: root/test/fcopy
diff options
context:
space:
mode:
authorLibravatar Reiner Herrmann <reiner@reiner-h.de>2017-04-16 21:11:10 +0200
committerLibravatar Reiner Herrmann <reiner@reiner-h.de>2017-04-16 21:16:15 +0200
commitd600a293a7f33397243c449d895168a4d4a9376d (patch)
treef508eea04da0fb5c5eb4ba8f3670b556c9adf8fb /test/fcopy
parenttest: argtest no longer available (diff)
downloadfirejail-d600a293a7f33397243c449d895168a4d4a9376d.tar.gz
firejail-d600a293a7f33397243c449d895168a4d4a9376d.tar.zst
firejail-d600a293a7f33397243c449d895168a4d4a9376d.zip
test: make tests independent of libdir
Diffstat (limited to 'test/fcopy')
-rwxr-xr-xtest/fcopy/cmdline.exp8
-rwxr-xr-xtest/fcopy/dircopy.exp2
-rwxr-xr-xtest/fcopy/fcopy.sh7
-rwxr-xr-xtest/fcopy/filecopy.exp2
-rwxr-xr-xtest/fcopy/linkcopy.exp2
5 files changed, 14 insertions, 7 deletions
diff --git a/test/fcopy/cmdline.exp b/test/fcopy/cmdline.exp
index 10dd8da58..798c9e718 100755
--- a/test/fcopy/cmdline.exp
+++ b/test/fcopy/cmdline.exp
@@ -7,7 +7,7 @@ set timeout 10
7spawn $env(SHELL) 7spawn $env(SHELL)
8match_max 100000 8match_max 100000
9 9
10send -- "/usr/lib/firejail/fcopy\r" 10send -- "fcopy\r"
11expect { 11expect {
12 timeout {puts "TESTING ERROR 0\n";exit} 12 timeout {puts "TESTING ERROR 0\n";exit}
13 "arguments missing" 13 "arguments missing"
@@ -18,7 +18,7 @@ expect {
18} 18}
19after 100 19after 100
20 20
21send -- "/usr/lib/firejail/fcopy foo\r" 21send -- "fcopy foo\r"
22expect { 22expect {
23 timeout {puts "TESTING ERROR 2\n";exit} 23 timeout {puts "TESTING ERROR 2\n";exit}
24 "arguments missing" 24 "arguments missing"
@@ -29,14 +29,14 @@ expect {
29} 29}
30after 100 30after 100
31 31
32send -- "/usr/lib/firejail/fcopy f%oo1 foo2\r" 32send -- "fcopy f%oo1 foo2\r"
33expect { 33expect {
34 timeout {puts "TESTING ERROR 4\n";exit} 34 timeout {puts "TESTING ERROR 4\n";exit}
35 "invalid source file name" 35 "invalid source file name"
36} 36}
37after 100 37after 100
38 38
39send -- "/usr/lib/firejail/fcopy foo1 f,oo2\r" 39send -- "fcopy foo1 f,oo2\r"
40expect { 40expect {
41 timeout {puts "TESTING ERROR 5\n";exit} 41 timeout {puts "TESTING ERROR 5\n";exit}
42 "invalid dest file name" 42 "invalid dest file name"
diff --git a/test/fcopy/dircopy.exp b/test/fcopy/dircopy.exp
index 573f454c8..e8462ae82 100755
--- a/test/fcopy/dircopy.exp
+++ b/test/fcopy/dircopy.exp
@@ -13,7 +13,7 @@ match_max 100000
13send -- "rm -fr dest/*\r" 13send -- "rm -fr dest/*\r"
14after 100 14after 100
15 15
16send -- "/usr/lib/firejail/fcopy src dest\r" 16send -- "fcopy src dest\r"
17after 100 17after 100
18 18
19send -- "find dest\r" 19send -- "find dest\r"
diff --git a/test/fcopy/fcopy.sh b/test/fcopy/fcopy.sh
index 0ae50399a..d122eff5d 100755
--- a/test/fcopy/fcopy.sh
+++ b/test/fcopy/fcopy.sh
@@ -6,6 +6,13 @@
6export MALLOC_CHECK_=3 6export MALLOC_CHECK_=3
7export MALLOC_PERTURB_=$(($RANDOM % 255 + 1)) 7export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))
8 8
9if [ -f /etc/debian_version ]; then
10 libdir=$(dirname "$(dpkg -L firejail | grep fcopy)")
11 export PATH="$PATH:$libdir"
12else
13 export PATH="$PATH:/usr/lib/firejail"
14fi
15
9mkdir dest 16mkdir dest
10 17
11echo "TESTING: fcopy cmdline (test/fcopy/cmdline.exp)" 18echo "TESTING: fcopy cmdline (test/fcopy/cmdline.exp)"
diff --git a/test/fcopy/filecopy.exp b/test/fcopy/filecopy.exp
index e0d959c32..824a22bba 100755
--- a/test/fcopy/filecopy.exp
+++ b/test/fcopy/filecopy.exp
@@ -13,7 +13,7 @@ match_max 100000
13send -- "rm -fr dest/*\r" 13send -- "rm -fr dest/*\r"
14after 100 14after 100
15 15
16send -- "/usr/lib/firejail/fcopy dircopy.exp dest\r" 16send -- "fcopy dircopy.exp dest\r"
17after 100 17after 100
18 18
19send -- "find dest\r" 19send -- "find dest\r"
diff --git a/test/fcopy/linkcopy.exp b/test/fcopy/linkcopy.exp
index beceb3675..46ee327cb 100755
--- a/test/fcopy/linkcopy.exp
+++ b/test/fcopy/linkcopy.exp
@@ -13,7 +13,7 @@ match_max 100000
13send -- "rm -fr dest/*\r" 13send -- "rm -fr dest/*\r"
14after 100 14after 100
15 15
16send -- "/usr/lib/firejail/fcopy src/dircopy.exp dest\r" 16send -- "fcopy src/dircopy.exp dest\r"
17after 100 17after 100
18 18
19send -- "find dest\r" 19send -- "find dest\r"