Skip to contentSkip to conversation

kselftest: Fix NULL INSTALL_PATH for TARGETS runlist

PATCH In review Prabhakar Kushwaha 2 participants 4 messages Oct 20, 2019 – Oct 22, 2019 Kselftest

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kselftest: Fix NULL INSTALL_PATH for TARGETS runlist

As per commit 131b30c94fbc ("kselftest: exclude failed TARGETS from runlist") failed targets were excluded from the runlist. But value $$INSTALL_PATH is always NULL. It should be $INSTALL_PATH instead $$INSTALL_PATH.

So, fix Makefile to use $INSTALL_PATH.

---
 tools/testing/selftests/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/Makefile +1 -1
index 4cdbae6f4e61..612f6757015d 100644
@@ -213,7 +213,7 @@ ifdef INSTALL_PATH
 	@# included in the generated runlist.
 	for TARGET in $(TARGETS); do \
 		BUILD_TARGET=$$BUILD/$$TARGET;	\
-		[ ! -d $$INSTALL_PATH/$$TARGET ] && echo "Skipping non-existent dir: $$TARGET" && continue; \
+		[ ! -d $(INSTALL_PATH)/$$TARGET ] && echo "Skipping non-existent dir: $$TARGET" && continue; \
 		echo "[ -w /dev/kmsg ] && echo \"kselftest: Running tests in $$TARGET\" >> /dev/kmsg" >> $(ALL_SCRIPT); \
 		echo "cd $$TARGET" >> $(ALL_SCRIPT); \
 		echo -n "run_many" >> $(ALL_SCRIPT); \
Signature · 1 line
2.17.0
Reviewed-by on v1 1/1
#1 lore raw

Hi

Quoted 7 lines · Prabhakar Kushwaha

As per commit 131b30c94fbc ("kselftest: exclude failed TARGETS from runlist") failed targets were excluded from the runlist. But value $$INSTALL_PATH is always NULL. It should be $INSTALL_PATH instead $$INSTALL_PATH.

So, fix Makefile to use $INSTALL_PATH.

I was a bit puzzled at first since I never saw the NULLified value while testing the original patch. Looking at it closely today, I realized that I used to test it like:

$ rm -rf $HOME/KSFT_TEST && make -C tools/testing/selftests/ INSTALL_PATH=$HOME/KSFT_TEST install

which in fact causes INSTALL_PATH to be exported down to the subshell in the recipe, so that even referring it as $$INSTALL_PATH from the recipe line make it work fine.

Instead, using the default Makefile provided value (unexported) by invoking like:

$ rm -rf $HOME/KSFT_TEST && make -C tools/testing/selftests/ install

exposes the error you mentioned, being INSTALL_PATH not accessible form the subshell and so NULL. Moreover it's anyway certainly better to refer with $(INSTALL_PATH) being it a strict Makefile var. So it's fine for me, thanks to have spotted this.

Reviewed-by [email protected]

Cristian

Quoted 21 lines
---
 tools/testing/selftests/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/Makefile +1 -1
index 4cdbae6f4e61..612f6757015d 100644
@@ -213,7 +213,7 @@ ifdef INSTALL_PATH
 	@# included in the generated runlist.
 	for TARGET in $(TARGETS); do \
 		BUILD_TARGET=$$BUILD/$$TARGET;	\
-		[ ! -d $$INSTALL_PATH/$$TARGET ] && echo "Skipping non-existent dir: $$TARGET" && continue; \
+		[ ! -d $(INSTALL_PATH)/$$TARGET ] && echo "Skipping non-existent dir: $$TARGET" && continue; \
 		echo "[ -w /dev/kmsg ] && echo \"kselftest: Running tests in $$TARGET\" >> /dev/kmsg" >> $(ALL_SCRIPT); \
 		echo "cd $$TARGET" >> $(ALL_SCRIPT); \
 		echo -n "run_many" >> $(ALL_SCRIPT); \
#2 lore raw

Dear Cristian,

Quoted 23 lines · Cristian Marussi

Hi

Quoted 7 lines · Prabhakar Kushwaha

As per commit 131b30c94fbc ("kselftest: exclude failed TARGETS from runlist") failed targets were excluded from the runlist. But value $$INSTALL_PATH is always NULL. It should be $INSTALL_PATH instead $$INSTALL_PATH.

So, fix Makefile to use $INSTALL_PATH.

I was a bit puzzled at first since I never saw the NULLified value while testing the original patch. Looking at it closely today, I realized that I used to test it like:

$ rm -rf $HOME/KSFT_TEST && make -C tools/testing/selftests/ INSTALL_PATH=$HOME/KSFT_TEST install

which in fact causes INSTALL_PATH to be exported down to the subshell in the recipe, so that even referring it as $$INSTALL_PATH from the recipe line make it work fine.

Instead, using the default Makefile provided value (unexported) by invoking like:

Quoted 8 lines
$ rm -rf $HOME/KSFT_TEST && make -C tools/testing/selftests/ install

exposes the error you mentioned, being INSTALL_PATH not accessible form the subshell and so NULL. Moreover it's anyway certainly better to refer with $(INSTALL_PATH) being it a strict Makefile var. So it's fine for me, thanks to have spotted this.

Reviewed-by [email protected]

Thanks for Reviewing.

I have to send v2 patch with author mail id fix. I will keep your Reviewed-by.

--prabhakar (pk)

Quoted 23 lines
Quoted 22 lines
---
 tools/testing/selftests/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/Makefile +1 -1
index 4cdbae6f4e61..612f6757015d 100644
@@ -213,7 +213,7 @@ ifdef INSTALL_PATH
      @# included in the generated runlist.
      for TARGET in $(TARGETS); do \
              BUILD_TARGET=$$BUILD/$$TARGET;  \
-             [ ! -d $$INSTALL_PATH/$$TARGET ] && echo "Skipping non-existent dir: $$TARGET" && continue; \
+             [ ! -d $(INSTALL_PATH)/$$TARGET ] && echo "Skipping non-existent dir: $$TARGET" && continue; \
              echo "[ -w /dev/kmsg ] && echo \"kselftest: Running tests in $$TARGET\" >> /dev/kmsg" >> $(ALL_SCRIPT); \
              echo "cd $$TARGET" >> $(ALL_SCRIPT); \
              echo -n "run_many" >> $(ALL_SCRIPT); \
#3 lore raw

Hi

Quoted 33 lines · Prabhakar Kushwaha

Dear Cristian,

Quoted 29 lines · Cristian Marussi

Hi

Quoted 7 lines · Prabhakar Kushwaha

As per commit 131b30c94fbc ("kselftest: exclude failed TARGETS from runlist") failed targets were excluded from the runlist. But value $$INSTALL_PATH is always NULL. It should be $INSTALL_PATH instead $$INSTALL_PATH.

So, fix Makefile to use $INSTALL_PATH.

I was a bit puzzled at first since I never saw the NULLified value while testing the original patch. Looking at it closely today, I realized that I used to test it like:

$ rm -rf $HOME/KSFT_TEST && make -C tools/testing/selftests/ INSTALL_PATH=$HOME/KSFT_TEST install

which in fact causes INSTALL_PATH to be exported down to the subshell in the recipe, so that even referring it as $$INSTALL_PATH from the recipe line make it work fine.

Instead, using the default Makefile provided value (unexported) by invoking like:

$ rm -rf $HOME/KSFT_TEST && make -C tools/testing/selftests/ install

exposes the error you mentioned, being INSTALL_PATH not accessible form the subshell and so NULL. Moreover it's anyway certainly better to refer with $(INSTALL_PATH) being it a strict Makefile var. So it's fine for me, thanks to have spotted this.

Quoted 6 lines
Quoted 2 lines
Reviewed-by [email protected]

Thanks for Reviewing.

I have to send v2 patch with author mail id fix. I will keep your Reviewed-by.

Thanks to you.

I forgot to say that maybe it's worth also adding a Fixes: tag too like:

Fixes 131b30c94fbc ("kselftest: exclude failed TARGETS from runlist")

given that I've spotted the original patch being already picked up for some stable queues like in:

https://lore.kernel.org/lkml/[email protected]/

Thanks

Cristian

Quoted 27 lines

--prabhakar (pk)

Quoted 23 lines
Quoted 22 lines
---
 tools/testing/selftests/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/Makefile +1 -1
index 4cdbae6f4e61..612f6757015d 100644
@@ -213,7 +213,7 @@ ifdef INSTALL_PATH
      @# included in the generated runlist.
      for TARGET in $(TARGETS); do \
              BUILD_TARGET=$$BUILD/$$TARGET;  \
-             [ ! -d $$INSTALL_PATH/$$TARGET ] && echo "Skipping non-existent dir: $$TARGET" && continue; \
+             [ ! -d $(INSTALL_PATH)/$$TARGET ] && echo "Skipping non-existent dir: $$TARGET" && continue; \
              echo "[ -w /dev/kmsg ] && echo \"kselftest: Running tests in $$TARGET\" >> /dev/kmsg" >> $(ALL_SCRIPT); \
              echo "cd $$TARGET" >> $(ALL_SCRIPT); \
              echo -n "run_many" >> $(ALL_SCRIPT); \