src/net: install tests to target /usr/share/net

Host tools and target are often out of sync, sometimes because we need
to run a newer version of iproute2 with more features.  By installing
tests to target we can still verify basic functionality, provided the
tests verify their dependencies and exit 77 (SKIP).

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2023-04-20 21:14:54 +02:00
committed by Tobias Waldekranz
parent f84b4803d9
commit a26dd9c19f
2 changed files with 13 additions and 5 deletions
+3 -1
View File
@@ -1,6 +1,8 @@
EXTRA_DIST = lib.sh $(TESTS)
CLEANFILES = *~ *.trs *.log
pkgdata_DATA = $(EXTRA_DIST)
TEST_EXTENSIONS = .sh
TESTS_ENVIRONMENT = unshare -mrun
TESTS = three-independent.sh
CLEANFILES = *~ *.trs *.log
+10 -4
View File
@@ -19,6 +19,9 @@ export NET_DIR
gen=-1
NET=$(command -v net)
[ -n "$NET" ] || NET=../src/net
# Exit immediately on error, treat unset variables as error
set -eu
@@ -115,10 +118,11 @@ netdo()
{
if [ -n "$DEBUG" ]; then
tree "$NET_DIR/"
echo "Calling: ../src/net $DEBUG apply"
echo "Calling: $NET $DEBUG apply"
fi
../src/net $DEBUG apply
# shellcheck disable=SC2086
$NET $DEBUG apply
if [ -n "$DEBUG" ]; then
ip link
@@ -129,7 +133,8 @@ netdo()
netdown()
{
../src/net $DEBUG down $@
# shellcheck disable=SC2086,SC2068
$NET $DEBUG down $@
if [ -n "$DEBUG" ]; then
ip link
@@ -139,7 +144,8 @@ netdown()
netup()
{
../src/net $DEBUG up $@
# shellcheck disable=SC2086,SC2068
$NET $DEBUG up $@
if [ -n "$DEBUG" ]; then
ip link