diff options
| author | Garrett D'Amore <garrett@damore.org> | 2018-05-07 14:58:07 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2018-05-07 17:39:03 -0700 |
| commit | e89202c83138bbc6bad1d5c5dcf55e00c0ee1800 (patch) | |
| tree | 58f3e2bc5e824c34a6954dc6276bd77725794b69 /tools/nngcat/nngcat_incompat_test.sh | |
| parent | d066d6d4307371f3bea1134a694dba18c381f564 (diff) | |
| download | nng-e89202c83138bbc6bad1d5c5dcf55e00c0ee1800.tar.gz nng-e89202c83138bbc6bad1d5c5dcf55e00c0ee1800.tar.bz2 nng-e89202c83138bbc6bad1d5c5dcf55e00c0ee1800.zip | |
fixes #413 desire --count option for nngcat
fixes #249 nngcat needs test cases
fixes #416 transports do not permit unlimited message size with 0
fixes #417 nngcat truncates input files to 4k
fixes #348 nngcat should have switch to adjust maximum receive size
Diffstat (limited to 'tools/nngcat/nngcat_incompat_test.sh')
| -rw-r--r-- | tools/nngcat/nngcat_incompat_test.sh | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/tools/nngcat/nngcat_incompat_test.sh b/tools/nngcat/nngcat_incompat_test.sh new file mode 100644 index 00000000..fcadef80 --- /dev/null +++ b/tools/nngcat/nngcat_incompat_test.sh @@ -0,0 +1,72 @@ +#!/bin/sh + +# +# Copyright 2018 Staysail Systems, Inc. <info@staysail.tech> +# Copyright 2018 Capitar IT Group BV <info@capitar.com> +# +# This software is supplied under the terms of the MIT License, a +# copy of which should be located in the distribution where this +# file was obtained (LICENSE.txt). A copy of the license may also be +# found online at https://opensource.org/licenses/MIT. +# + +NNGCAT=${NNGCAT:-./nngcat} +echo "Verify incompatible options: " + +# Just bind something to this so other ones connect +${NNGCAT} --pull0 --ascii -X /tmp/bogusipc & +pid=$! + +trap "kill $pid && wait $pid 2>/dev/null" 0 + +echo -n " --subscribe doesn't work with non-sub" +if ${NNGCAT} --req0 -x /tmp/bogusipc --subscribe=oops >/dev/null 2>&1 +then + echo "fail" + exit 1 +fi +echo "pass" + +echo -n " --interval doesn't work with recv only: " +if ${NNGCAT} --interval 1 --pull -x /tmp/bogusipc >/dev/null 2>&1 +then + echo "fail" + exit 1 +fi +echo "pass" + +echo -n " --pair1 doesn't work with --compat: " +if ${NNGCAT} --compat --pair1 -x /tmp/bogusipc >/dev/null 2>&1 +then + echo "fail" + exit 1 +fi +echo "pass" + +echo -n " --count doesn't work with --compat: " +if ${NNGCAT} --compat --count=1 --pair0 -x /tmp/bogusipc >/dev/null 2>&1 +then + echo "fail" + exit 1 +fi +echo "pass" + +echo -n " --count fails with non-integer: " +if ${NNGCAT} --count=xyz --pair0 -x /tmp/bogusipc >/dev/null 2>&1 +then + echo "fail" + exit 1 +fi +echo "pass" + +echo -n " --file fails with non-existing file: " +if ${NNGCAT} --async --file=/nosuchfilehere --push0 -x /tmp/bogusipc >/dev/null 2>&1 +then + echo "fail" + exit 1 +fi +echo "pass" + +echo "PASS." +exit 0 + |
