diff mbox

[nft] tests: py: allow to run tests with other nft binaries

Message ID 146123183481.8142.11138398894868501284.stgit@nfdev2.cica.es
State Accepted
Delegated to: Pablo Neira
Headers show

Commit Message

Arturo Borrero April 21, 2016, 9:43 a.m. UTC
Allow to run tests with other nft binaries by reading a 'NFT'
environment variable, allowing arbitrary locations for the nft binary.

This is what the tests/shell/run-tests.sh script does.

Among other thing, this allow us to properly hook this testsuite
from the Debian CI environment (https://ci.debian.net) where we can perform
tests for packages 'as installed'.

Examples:

 # run with default config (ie src/nft)
 % ./nft-test.py

 # run with installed binary (ie /usr/sbin/nft)
 % NFT=/usr/sbin/nft ./nft-test.py

Signed-off-by: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>
---
 tests/py/nft-test.py |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Pablo Neira Ayuso April 27, 2016, 5:25 p.m. UTC | #1
On Thu, Apr 21, 2016 at 11:43:54AM +0200, Arturo Borrero Gonzalez wrote:
> Allow to run tests with other nft binaries by reading a 'NFT'
> environment variable, allowing arbitrary locations for the nft binary.
> 
> This is what the tests/shell/run-tests.sh script does.
> 
> Among other thing, this allow us to properly hook this testsuite
> from the Debian CI environment (https://ci.debian.net) where we can perform
> tests for packages 'as installed'.

Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/tests/py/nft-test.py b/tests/py/nft-test.py
index 1256a33..df0fbad 100755
--- a/tests/py/nft-test.py
+++ b/tests/py/nft-test.py
@@ -19,7 +19,7 @@  import subprocess
 import argparse
 import signal
 
-NFT_BIN = "src/nft"
+NFT_BIN = os.getenv('NFT', "src/nft")
 TESTS_PATH = os.path.dirname(os.path.abspath(__file__))
 TESTS_DIRECTORY = ["any", "arp", "bridge", "inet", "ip", "ip6"]
 LOGFILE = "/tmp/nftables-test.log"