[LTP] [Patch 7/10]Fixes for sched_mc & sched_smt interface test

Poornima Nayak
2009-06-30T14:58:14Z

[Patch 7/10]Fixes for sched_mc & sched_smt interface test
Existing testcase in LTP would fail or not cover all possible sched_mc values.
This patch has been written to make testcase flexible to run on future releases.

Signed-off-by: poornima nayak <mpnayak@linux.vnet.ibm.com>

diff -uprN ltp_orig/testcases/kernel/power_management/test_sched_mc.sh ltp_patched/testcases/kernel/power_management/test_sched_mc.sh
--- ltp_orig/testcases/kernel/power_management/test_sched_mc.sh 2009-06-30 15:04:19.000000000 +0530
+++ ltp_patched/testcases/kernel/power_management/test_sched_mc.sh 2009-06-30 16:09:06.000000000 +0530
@@ -2,8 +2,10 @@

. pm_include.sh

-valid_input="0 1 2"
-invalid_input="a abcefg x1999 xffff -1 -00000
+get_kernel_version
+get_valid_input $kernel_version
+
+invalid_input="3 4 5 6 7 8 a abcefg x1999 xffff -1 -00000
200000000000000000000000000000000000000000000000000000000000000000000000000000
ox324 -0xfffffffffffffffffffff"
test_file="/sys/devices/system/cpu/sched_mc_power_savings"
@@ -14,7 +16,7 @@ fi

RC=0
echo "${0}: ---Valid test cases---"
-check_input "${valid_input}" valid $test_file
+check_input "${valid_input}" valid $test_file
RC=$?
echo "${0}: ---Invalid test cases---"
check_input "${invalid_input}" invalid $test_file
diff -uprN ltp_orig/testcases/kernel/power_management/test_sched_smt.sh ltp_patched/testcases/kernel/power_management/test_sched_smt.sh
--- ltp_orig/testcases/kernel/power_management/test_sched_smt.sh 2009-06-30 15:04:19.000000000 +0530
+++ ltp_patched/testcases/kernel/power_management/test_sched_smt.sh 2009-06-30 16:09:13.000000000 +0530
@@ -1,8 +1,11 @@
#!/bin/bash

. pm_include.sh
-valid_input="0 1"
-invalid_input="a abcefg x1999 xffff -1 -00000
+
+get_kernel_version
+get_valid_input $kernel_version
+
+invalid_input="3 4 5 6 7 8 a abcefg x1999 xffff -1 -00000
200000000000000000000000000000000000000000000000000000000000000000000000000000
ox324 -0xfffffffffffffffffffff"
test_file="/sys/devices/system/cpu/sched_smt_power_savings"