projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add tests for the fsck command.
[tinc]
/
test
/
compression.test
diff --git
a/test/compression.test
b/test/compression.test
index
77efd6d
..
7c69c2c
100755
(executable)
--- a/
test/compression.test
+++ b/
test/compression.test
@@
-2,7
+2,7
@@
. ./testlib.sh
. ./testlib.sh
-test "$(id -u)" = "0" || exit $EXIT_SKIP_TEST
+require_root "$0" "$@"
test -e /dev/net/tun || exit $EXIT_SKIP_TEST
ip netns list || exit $EXIT_SKIP_TEST
command -v socat || exit $EXIT_SKIP_TEST
test -e /dev/net/tun || exit $EXIT_SKIP_TEST
ip netns list || exit $EXIT_SKIP_TEST
command -v socat || exit $EXIT_SKIP_TEST
@@
-110,8
+110,9
@@
for level in $levels; do
socat -u TCP4-LISTEN:$recv_port_foo,reuseaddr OPEN:"$tmp_file",creat &
ip netns exec bar \
socat -u TCP4-LISTEN:$recv_port_foo,reuseaddr OPEN:"$tmp_file",creat &
ip netns exec bar \
- socat -u OPEN:"$ref_file" TCP4:$ip_foo:$recv_port_foo,retry=30
+ socat -u OPEN:"$ref_file" TCP4:$ip_foo:$recv_port_foo,retry=30
&
+ wait
diff -w "$ref_file" "$tmp_file"
tinc foo stop
diff -w "$ref_file" "$tmp_file"
tinc foo stop
@@
-124,7
+125,7
@@
for level in $bogus_levels; do
echo "[STEP] Testing bogus compression level $level"
tinc foo set Compression "$level"
echo "[STEP] Testing bogus compression level $level"
tinc foo set Compression "$level"
- output=$(
must_fail
start_tinc foo 2>&1)
+ output=$(
expect_code "$EXIT_FAILURE"
start_tinc foo 2>&1)
if ! echo "$output" | grep -q 'Bogus compression level'; then
bail 'expected message about the wrong compression level'
if ! echo "$output" | grep -q 'Bogus compression level'; then
bail 'expected message about the wrong compression level'