Nancy <nancydreaming@gmail.com> reported: Case "endian_switch01" FAIL on IBM Power 6 machine. The case failed on IBM JS22, p570 and p550. Is that the case bug or the OS bug? Thank you!. Subrata Modak <subrata@linux.vnet.ibm.com> replied: This will fail for all POWER machines which are not P6 & above, and, for all other archs. However, for other archs, it will throw you appropriate message like:
$./testcases/bin/endian_switch01
endian_switch01    1  CONF  :  This system does not support running of switch() syscall
In P6 (and above), even it will fail if the kernel is not 2.6.26 & above. The support for this syscall was added only from then. Please see: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=745a14cc264b1832c638e41812e0cb04328b2db1. If you are running 2.6.26 on p6, then we need to investigate why this is failing, else, i would prefer to merge the following patch for avoiding to test in systems where the switch() support is not available at the first place itself. Signed-Off-By: Subrata Modak <subrata@linux.vnet.ibm.com>,
diff --git a/testcases/kernel/syscalls/switch/endian_switch01.c b/testcases/kernel/syscalls/switch/endian_switch01.c
index f7208d7..5e783c1 100644
--- a/testcases/kernel/syscalls/switch/endian_switch01.c
+++ b/testcases/kernel/syscalls/switch/endian_switch01.c
@@ -116,6 +116,12 @@
 }
 
 int main4(int ac, char **av, char **envp, unsigned long *auxv) {
+
+        if((tst_kvercmp(2, 6, 26)) < 0)
+        {
+                tst_resm(TCONF, "This test can only run on kernels that are 2.6.26 and higher");
+                tst_exit();
+        }
         setup();
 	for (; *auxv != AT_NULL && *auxv != AT_HWCAP; auxv += 2)
 		;