aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing
diff options
context:
space:
mode:
Diffstat (limited to 'tools/testing')
-rw-r--r--tools/testing/selftests/cpu-hotplug/Makefile2
-rw-r--r--tools/testing/selftests/ipc/msgque.c5
-rw-r--r--tools/testing/selftests/memory-hotplug/Makefile2
-rw-r--r--tools/testing/selftests/powerpc/tm/Makefile2
-rw-r--r--tools/testing/selftests/powerpc/tm/tm-resched-dscr.c14
5 files changed, 19 insertions, 6 deletions
diff --git a/tools/testing/selftests/cpu-hotplug/Makefile b/tools/testing/selftests/cpu-hotplug/Makefile
index ae5faf9aade2..790c23a9db44 100644
--- a/tools/testing/selftests/cpu-hotplug/Makefile
+++ b/tools/testing/selftests/cpu-hotplug/Makefile
@@ -1,6 +1,6 @@
1all: 1all:
2 2
3run_tests: 3run_tests:
4 @/bin/sh ./on-off-test.sh || echo "cpu-hotplug selftests: [FAIL]" 4 @/bin/bash ./on-off-test.sh || echo "cpu-hotplug selftests: [FAIL]"
5 5
6clean: 6clean:
diff --git a/tools/testing/selftests/ipc/msgque.c b/tools/testing/selftests/ipc/msgque.c
index aa290c0de6f5..552f0810bffb 100644
--- a/tools/testing/selftests/ipc/msgque.c
+++ b/tools/testing/selftests/ipc/msgque.c
@@ -193,6 +193,11 @@ int main(int argc, char **argv)
193 int msg, pid, err; 193 int msg, pid, err;
194 struct msgque_data msgque; 194 struct msgque_data msgque;
195 195
196 if (getuid() != 0) {
197 printf("Please run the test as root - Exiting.\n");
198 exit(1);
199 }
200
196 msgque.key = ftok(argv[0], 822155650); 201 msgque.key = ftok(argv[0], 822155650);
197 if (msgque.key == -1) { 202 if (msgque.key == -1) {
198 printf("Can't make key\n"); 203 printf("Can't make key\n");
diff --git a/tools/testing/selftests/memory-hotplug/Makefile b/tools/testing/selftests/memory-hotplug/Makefile
index 350bfeda3aa8..058c76f5d102 100644
--- a/tools/testing/selftests/memory-hotplug/Makefile
+++ b/tools/testing/selftests/memory-hotplug/Makefile
@@ -1,6 +1,6 @@
1all: 1all:
2 2
3run_tests: 3run_tests:
4 @/bin/sh ./on-off-test.sh || echo "memory-hotplug selftests: [FAIL]" 4 @/bin/bash ./on-off-test.sh || echo "memory-hotplug selftests: [FAIL]"
5 5
6clean: 6clean:
diff --git a/tools/testing/selftests/powerpc/tm/Makefile b/tools/testing/selftests/powerpc/tm/Makefile
index 51267f4184a6..2cede239a074 100644
--- a/tools/testing/selftests/powerpc/tm/Makefile
+++ b/tools/testing/selftests/powerpc/tm/Makefile
@@ -2,7 +2,7 @@ PROGS := tm-resched-dscr
2 2
3all: $(PROGS) 3all: $(PROGS)
4 4
5$(PROGS): 5$(PROGS): ../harness.c
6 6
7run_tests: all 7run_tests: all
8 @-for PROG in $(PROGS); do \ 8 @-for PROG in $(PROGS); do \
diff --git a/tools/testing/selftests/powerpc/tm/tm-resched-dscr.c b/tools/testing/selftests/powerpc/tm/tm-resched-dscr.c
index ee98e3886af2..42d4c8caad81 100644
--- a/tools/testing/selftests/powerpc/tm/tm-resched-dscr.c
+++ b/tools/testing/selftests/powerpc/tm/tm-resched-dscr.c
@@ -28,6 +28,8 @@
28#include <assert.h> 28#include <assert.h>
29#include <asm/tm.h> 29#include <asm/tm.h>
30 30
31#include "utils.h"
32
31#define TBEGIN ".long 0x7C00051D ;" 33#define TBEGIN ".long 0x7C00051D ;"
32#define TEND ".long 0x7C00055D ;" 34#define TEND ".long 0x7C00055D ;"
33#define TCHECK ".long 0x7C00059C ;" 35#define TCHECK ".long 0x7C00059C ;"
@@ -36,7 +38,8 @@
36#define SPRN_TEXASR 0x82 38#define SPRN_TEXASR 0x82
37#define SPRN_DSCR 0x03 39#define SPRN_DSCR 0x03
38 40
39int main(void) { 41int test_body(void)
42{
40 uint64_t rv, dscr1 = 1, dscr2, texasr; 43 uint64_t rv, dscr1 = 1, dscr2, texasr;
41 44
42 printf("Check DSCR TM context switch: "); 45 printf("Check DSCR TM context switch: ");
@@ -81,10 +84,15 @@ int main(void) {
81 } 84 }
82 if (dscr2 != dscr1) { 85 if (dscr2 != dscr1) {
83 printf(" FAIL\n"); 86 printf(" FAIL\n");
84 exit(EXIT_FAILURE); 87 return 1;
85 } else { 88 } else {
86 printf(" OK\n"); 89 printf(" OK\n");
87 exit(EXIT_SUCCESS); 90 return 0;
88 } 91 }
89 } 92 }
90} 93}
94
95int main(void)
96{
97 return test_harness(test_body, "tm_resched_dscr");
98}