From ad04b6e6903328480a824177d0e7c90bd89050a4 Mon Sep 17 00:00:00 2001 From: Arturo Borrero Date: Thu, 23 Jun 2016 13:45:44 +0200 Subject: tests: shell: run-tests.sh: use src/nft binary by default Better use the local tree nft binary rather than the installed one. Requested-by: Pablo Neira Ayuso Signed-off-by: Arturo Borrero Gonzalez Signed-off-by: Pablo Neira Ayuso --- tests/shell/README | 4 +++- tests/shell/run-tests.sh | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/shell/README b/tests/shell/README index 2ce4120a..2d8681fd 100644 --- a/tests/shell/README +++ b/tests/shell/README @@ -20,4 +20,6 @@ Also, test-files will receive the environment variable $NFT which contains the path to the nftables binary being tested. You can pass an arbitrary $NFT value as well: - % NFT=../../src/nft ./run-tests.sh + % NFT=/usr/local/sbin/nft ./run-tests.sh + +By default the tests are run with the nft binary at '../../src/nft' diff --git a/tests/shell/run-tests.sh b/tests/shell/run-tests.sh index b10445d2..32776550 100755 --- a/tests/shell/run-tests.sh +++ b/tests/shell/run-tests.sh @@ -3,6 +3,7 @@ # Configuration TESTDIR="./" RETURNCODE_SEPARATOR="_" +SRC_NFT="../../src/nft" msg_error() { echo "E: $1 ..." >&2 @@ -21,7 +22,7 @@ if [ "$(id -u)" != "0" ] ; then msg_error "this requires root!" fi -[ -z "$NFT" ] && NFT="$(which nft)" +[ -z "$NFT" ] && NFT=$SRC_NFT if [ ! -x "$NFT" ] ; then msg_error "no nft binary!" else -- cgit v1.2.3