public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Poirier <bpoirier@nvidia.com>
To: Jonathan Toppins <jtoppins@redhat.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	Jay Vosburgh <j.vosburgh@gmail.com>,
	Shuah Khan <shuah@kernel.org>,
	linux-kselftest@vger.kernel.org
Subject: Re: kselftest: bonding: dev_addr_lists.sh doesn't run due to lack of dependencies
Date: Thu, 13 Oct 2022 09:40:46 +0900	[thread overview]
Message-ID: <Y0dejgSk60iZaJ/4@d3> (raw)
In-Reply-To: <40f04ded-0c86-8669-24b1-9a313ca21076@redhat.com>

On 2022-10-12 10:17 -0400, Jonathan Toppins wrote:
> When kselftest for bonding is built like:
> $ make TARGETS="drivers/net/bonding" -j8 -C tools/testing/selftests gen_tar
> 
> and then run on the target:
> $ ./run_kselftest.sh
> [...]
> # selftests: drivers/net/bonding: dev_addr_lists.sh
> # ./dev_addr_lists.sh: line 17: ./../../../net/forwarding/lib.sh: No such
> file or directory
> # ./dev_addr_lists.sh: line 107: tests_run: command not found
> # ./dev_addr_lists.sh: line 109: exit: : numeric argument required
> # ./dev_addr_lists.sh: line 34: pre_cleanup: command not found
> not ok 4 selftests: drivers/net/bonding: dev_addr_lists.sh # exit=2
> [...]
> 
> I am still new to kselftests is this expected or is there some way in the
> make machinery to force packaging of net as well?
> 

Arg, I didn't know that you could export just a part of the selftest
tree. Thanks for the report.

I'm traveling for a few days. I'll look into how to fix the inclusion
problem when I get back on October 19th.

In the meantime, if you just want to run the bonding tests you can do:

(in tree)
make -C tools/testing/selftests run_tests TARGETS="drivers/net/bonding"

or

(exported)
make -C tools/testing/selftests gen_tar
[... extract archive ...]
./run_kselftest.sh -c drivers/net/bonding


It seems like a plausible fix might be to use symlinks, what do you
think?

diff --git a/tools/testing/selftests/drivers/net/bonding/Makefile b/tools/testing/selftests/drivers/net/bonding/Makefile
index e9dab5f9d773..7c50bfc24d32 100644
--- a/tools/testing/selftests/drivers/net/bonding/Makefile
+++ b/tools/testing/selftests/drivers/net/bonding/Makefile
@@ -7,6 +7,8 @@ TEST_PROGS := \
 	bond-lladdr-target.sh \
 	dev_addr_lists.sh
 
-TEST_FILES := lag_lib.sh
+TEST_FILES := \
+	lag_lib.sh \
+	lib.sh
 
 include ../../../lib.mk
diff --git a/tools/testing/selftests/drivers/net/bonding/dev_addr_lists.sh b/tools/testing/selftests/drivers/net/bonding/dev_addr_lists.sh
index e6fa24eded5b..7b79f090ddaa 100755
--- a/tools/testing/selftests/drivers/net/bonding/dev_addr_lists.sh
+++ b/tools/testing/selftests/drivers/net/bonding/dev_addr_lists.sh
@@ -14,7 +14,7 @@ ALL_TESTS="
 REQUIRE_MZ=no
 NUM_NETIFS=0
 lib_dir=$(dirname "$0")
-source "$lib_dir"/../../../net/forwarding/lib.sh
+source "$lib_dir"/lib.sh
 
 source "$lib_dir"/lag_lib.sh
 
diff --git a/tools/testing/selftests/drivers/net/bonding/lib.sh b/tools/testing/selftests/drivers/net/bonding/lib.sh
new file mode 120000
index 000000000000..39c96828c5ef
--- /dev/null
+++ b/tools/testing/selftests/drivers/net/bonding/lib.sh
@@ -0,0 +1 @@
+../../../net/forwarding/lib.sh
\ No newline at end of file
diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk
index 9d4cb94cf437..6203d3993554 100644
--- a/tools/testing/selftests/lib.mk
+++ b/tools/testing/selftests/lib.mk
@@ -84,7 +84,7 @@ endif
 
 define INSTALL_SINGLE_RULE
 	$(if $(INSTALL_LIST),@mkdir -p $(INSTALL_PATH))
-	$(if $(INSTALL_LIST),rsync -a $(INSTALL_LIST) $(INSTALL_PATH)/)
+	$(if $(INSTALL_LIST),rsync -aL $(INSTALL_LIST) $(INSTALL_PATH)/)
 endef
 
 define INSTALL_RULE

  reply	other threads:[~2022-10-13  0:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-12 14:17 kselftest: bonding: dev_addr_lists.sh doesn't run due to lack of dependencies Jonathan Toppins
2022-10-13  0:40 ` Benjamin Poirier [this message]
2022-10-17 17:53   ` Jonathan Toppins

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y0dejgSk60iZaJ/4@d3 \
    --to=bpoirier@nvidia.com \
    --cc=j.vosburgh@gmail.com \
    --cc=jtoppins@redhat.com \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=shuah@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox