Skip to contentSkip to conversation

selftests/memfd: Actually make the test executable.

PATCH New Thomas Meyer 1 participant 2 messages Sep 7, 2017 Kselftest

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 selftests/memfd: Actually make the test executable.

The current shell script misses the execute flag.

---
 tools/testing/selftests/memfd/run_tests.sh | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 mode change 100644 => 100755 tools/testing/selftests/memfd/run_tests.sh
tools/testing/selftests/memfd/run_tests.sh +0 -0
old mode 100644
new mode 100755
Signature · 1 line
2.11.0
#1 lore raw

PATCH 2/2 selftests/memfd: Add null check for freepgs.

User mode linux kernel has no huge pages. So this variable will be null. Guard all tests in the shell script with a null check.

---
 tools/testing/selftests/memfd/run_tests.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/memfd/run_tests.sh +1 -1
index daabb350697c..0b65bacf8694 100755
@@ -46,7 +46,7 @@ fi
 # If still not enough huge pages available, exit.  But, give back any huge
 # pages potentially allocated above.
 #
-if [ $freepgs -lt $hpages_test ]; then
+if [ -n "$freepgs" ] && [ $freepgs -lt $hpages_test ]; then
 	# nr_hugepgs non-zero only if we attempted to increase
 	if [ -n "$nr_hugepgs" ]; then
 		echo $nr_hugepgs > /proc/sys/vm/nr_hugepages
Signature · 1 line
2.11.0