Skip to contentSkip to conversation

selftests/vm: Add protection_keys tests to run_vmtests

PATCH Superseded Kalpana Shetty 2 participants 3 messages Jun 17, 2022

Subsystems (2)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 selftests/vm: Add protection_keys tests to run_vmtests

Adding "protected_keys" tests to "run_vmtests.sh" would help out to run all VM related tests from a single shell script.

---
Changes in V3:
Shuah Khan's review comments incorporated, added protection_keys binary check.

 tools/testing/selftests/vm/run_vmtests.sh | 11 +++++++++++
 1 file changed, 11 insertions(+)
tools/testing/selftests/vm/run_vmtests.sh +11 -0
index 41fce8bea929..b19c6b1b84c4 100755
@@ -179,4 +179,15 @@ run_test ./ksm_tests -N -m 1
 # KSM test with 2 NUMA nodes and merge_across_nodes = 0
 run_test ./ksm_tests -N -m 0
 
+# protection_keys tests
+if ./protection_keys_32 &> /dev/null
+then
+	run_test ./protection_keys_32
+fi
+
+if ./protection_keys_64 &> /dev/null
+then
+	run_test ./protection_keys_64
+fi
+
 exit $exitcode
Signature · 1 line
2.25.1
maintainer
#1 lore raw
Quoted 22 lines · Kalpana Shetty

Adding "protected_keys" tests to "run_vmtests.sh" would help out to run all VM related tests from a single shell script.

---
Changes in V3:
Shuah Khan's review comments incorporated, added protection_keys binary check.

  tools/testing/selftests/vm/run_vmtests.sh | 11 +++++++++++
  1 file changed, 11 insertions(+)
tools/testing/selftests/vm/run_vmtests.sh +2 -0
index 41fce8bea929..b19c6b1b84c4 100755
@@ -179,4 +179,15 @@ run_test ./ksm_tests -N -m 1
  # KSM test with 2 NUMA nodes and merge_across_nodes = 0
  run_test ./ksm_tests -N -m 0
 
+# protection_keys tests
+if ./protection_keys_32 &> /dev/null

tools/testing/selftests/vm/run_vmtests.sh run_test ./ksm_tests -N -m 1 · line 193

Quoted 10 lines
tools/testing/selftests/vm/run_vmtests.sh +9 -0
+then
+	run_test ./protection_keys_32
+fi
+
+if ./protection_keys_64 &> /dev/null
+then
+	run_test ./protection_keys_64
+fi
+
  exit $exitcode

Why not use file test operators. -x works for this case. There is no need to run attempt to run the test.

thanks,
-- Shuah

#2 lore raw
Quoted 27 lines · Shuah Khan
Quoted 26 lines · Kalpana Shetty

Adding "protected_keys" tests to "run_vmtests.sh" would help out to run all VM related tests from a single shell script.

---
Changes in V3:
  Shuah Khan's review comments incorporated, added protection_keys binary check.

  tools/testing/selftests/vm/run_vmtests.sh | 11 +++++++++++

  1 file changed, 11 insertions(+)
tools/testing/selftests/vm/run_vmtests.sh +0 -0
index 41fce8bea929..b19c6b1b84c4 100755
@@ -179,4 +179,15 @@ run_test ./ksm_tests -N -m 1
   # KSM test with 2 NUMA nodes and merge_across_nodes = 0

  run_test ./ksm_tests -N -m 0
  +# protection_keys tests

tools/testing/selftests/vm/run_vmtests.sh +7 -0
+if ./protection_keys_32 &> /dev/null
+then
+    run_test ./protection_keys_32
+fi
+
+if ./protection_keys_64 &> /dev/null
+then
Quoted 8 lines
Quoted 5 lines

+    run_test ./protection_keys_64

tools/testing/selftests/vm/run_vmtests.sh +2 -0
+fi
+

  exit $exitcode

Why not use file test operators. -x works for this case. There is no need to run attempt to run the test.

Sure; thanks for the suggestion. Sent V4 patch.

Quoted 3 lines

thanks,
-- Shuah

Thanks,

Kalpana