Linux Netfilter development
 help / color / mirror / Atom feed
* [iptables PATCH] tests: shell: Fix for 'make distcheck'
@ 2024-10-29 11:29 Phil Sutter
  2024-11-05 23:02 ` Phil Sutter
  0 siblings, 1 reply; 2+ messages in thread
From: Phil Sutter @ 2024-10-29 11:29 UTC (permalink / raw)
  To: netfilter-devel

The target performs a "VPATH build", so built binaries are not put into
the same directory tree as the test script itself. For lack of a better
way to detect this, assume $PWD in this situation remains being the
build tree's TLD and check if binaries are present in there.

Signed-off-by: Phil Sutter <phil@nwl.cc>
---
 iptables/tests/shell/run-tests.sh | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/iptables/tests/shell/run-tests.sh b/iptables/tests/shell/run-tests.sh
index 1125690583b46..2ad259c21644c 100755
--- a/iptables/tests/shell/run-tests.sh
+++ b/iptables/tests/shell/run-tests.sh
@@ -87,6 +87,17 @@ if [ "$HOST" != "y" ]; then
 	XTABLES_LEGACY_MULTI="$(dirname $0)/../../xtables-legacy-multi"
 
 	export XTABLES_LIBDIR=${TESTDIR}/../../../extensions
+
+	# maybe this is 'make distcheck' calling us from a build tree
+	if [ ! -e "$XTABLES_NFT_MULTI" -a \
+	     ! -e "$XTABLES_LEGACY_MULTI" -a \
+	     -e "./iptables/xtables-nft-multi" -a \
+	     -e "./iptables/xtables-legacy-multi" ]; then
+		msg_warn "Running in separate build-tree, using binaries from $PWD/iptables"
+		XTABLES_NFT_MULTI="$PWD/iptables/xtables-nft-multi"
+		XTABLES_LEGACY_MULTI="$PWD/iptables/xtables-legacy-multi"
+		export XTABLES_LIBDIR="$PWD/extensions"
+	fi
 else
 	XTABLES_NFT_MULTI="xtables-nft-multi"
 	XTABLES_LEGACY_MULTI="xtables-legacy-multi"
-- 
2.47.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [iptables PATCH] tests: shell: Fix for 'make distcheck'
  2024-10-29 11:29 [iptables PATCH] tests: shell: Fix for 'make distcheck' Phil Sutter
@ 2024-11-05 23:02 ` Phil Sutter
  0 siblings, 0 replies; 2+ messages in thread
From: Phil Sutter @ 2024-11-05 23:02 UTC (permalink / raw)
  To: netfilter-devel

On Tue, Oct 29, 2024 at 12:29:38PM +0100, Phil Sutter wrote:
> The target performs a "VPATH build", so built binaries are not put into
> the same directory tree as the test script itself. For lack of a better
> way to detect this, assume $PWD in this situation remains being the
> build tree's TLD and check if binaries are present in there.
> 
> Signed-off-by: Phil Sutter <phil@nwl.cc>

Patch applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-11-05 23:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-29 11:29 [iptables PATCH] tests: shell: Fix for 'make distcheck' Phil Sutter
2024-11-05 23:02 ` Phil Sutter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox