diff options
author | Reiner Herrmann <reiner@reiner-h.de> | 2017-04-16 21:11:10 +0200 |
---|---|---|
committer | Reiner Herrmann <reiner@reiner-h.de> | 2017-04-16 21:16:15 +0200 |
commit | d600a293a7f33397243c449d895168a4d4a9376d (patch) | |
tree | f508eea04da0fb5c5eb4ba8f3670b556c9adf8fb /test/fcopy | |
parent | test: argtest no longer available (diff) | |
download | firejail-d600a293a7f33397243c449d895168a4d4a9376d.tar.gz firejail-d600a293a7f33397243c449d895168a4d4a9376d.tar.zst firejail-d600a293a7f33397243c449d895168a4d4a9376d.zip |
test: make tests independent of libdir
Diffstat (limited to 'test/fcopy')
-rwxr-xr-x | test/fcopy/cmdline.exp | 8 | ||||
-rwxr-xr-x | test/fcopy/dircopy.exp | 2 | ||||
-rwxr-xr-x | test/fcopy/fcopy.sh | 7 | ||||
-rwxr-xr-x | test/fcopy/filecopy.exp | 2 | ||||
-rwxr-xr-x | test/fcopy/linkcopy.exp | 2 |
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 | |||
7 | spawn $env(SHELL) | 7 | spawn $env(SHELL) |
8 | match_max 100000 | 8 | match_max 100000 |
9 | 9 | ||
10 | send -- "/usr/lib/firejail/fcopy\r" | 10 | send -- "fcopy\r" |
11 | expect { | 11 | expect { |
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 | } |
19 | after 100 | 19 | after 100 |
20 | 20 | ||
21 | send -- "/usr/lib/firejail/fcopy foo\r" | 21 | send -- "fcopy foo\r" |
22 | expect { | 22 | expect { |
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 | } |
30 | after 100 | 30 | after 100 |
31 | 31 | ||
32 | send -- "/usr/lib/firejail/fcopy f%oo1 foo2\r" | 32 | send -- "fcopy f%oo1 foo2\r" |
33 | expect { | 33 | expect { |
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 | } |
37 | after 100 | 37 | after 100 |
38 | 38 | ||
39 | send -- "/usr/lib/firejail/fcopy foo1 f,oo2\r" | 39 | send -- "fcopy foo1 f,oo2\r" |
40 | expect { | 40 | expect { |
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 | |||
13 | send -- "rm -fr dest/*\r" | 13 | send -- "rm -fr dest/*\r" |
14 | after 100 | 14 | after 100 |
15 | 15 | ||
16 | send -- "/usr/lib/firejail/fcopy src dest\r" | 16 | send -- "fcopy src dest\r" |
17 | after 100 | 17 | after 100 |
18 | 18 | ||
19 | send -- "find dest\r" | 19 | send -- "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 @@ | |||
6 | export MALLOC_CHECK_=3 | 6 | export MALLOC_CHECK_=3 |
7 | export MALLOC_PERTURB_=$(($RANDOM % 255 + 1)) | 7 | export MALLOC_PERTURB_=$(($RANDOM % 255 + 1)) |
8 | 8 | ||
9 | if [ -f /etc/debian_version ]; then | ||
10 | libdir=$(dirname "$(dpkg -L firejail | grep fcopy)") | ||
11 | export PATH="$PATH:$libdir" | ||
12 | else | ||
13 | export PATH="$PATH:/usr/lib/firejail" | ||
14 | fi | ||
15 | |||
9 | mkdir dest | 16 | mkdir dest |
10 | 17 | ||
11 | echo "TESTING: fcopy cmdline (test/fcopy/cmdline.exp)" | 18 | echo "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 | |||
13 | send -- "rm -fr dest/*\r" | 13 | send -- "rm -fr dest/*\r" |
14 | after 100 | 14 | after 100 |
15 | 15 | ||
16 | send -- "/usr/lib/firejail/fcopy dircopy.exp dest\r" | 16 | send -- "fcopy dircopy.exp dest\r" |
17 | after 100 | 17 | after 100 |
18 | 18 | ||
19 | send -- "find dest\r" | 19 | send -- "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 | |||
13 | send -- "rm -fr dest/*\r" | 13 | send -- "rm -fr dest/*\r" |
14 | after 100 | 14 | after 100 |
15 | 15 | ||
16 | send -- "/usr/lib/firejail/fcopy src/dircopy.exp dest\r" | 16 | send -- "fcopy src/dircopy.exp dest\r" |
17 | after 100 | 17 | after 100 |
18 | 18 | ||
19 | send -- "find dest\r" | 19 | send -- "find dest\r" |