Fix: tests: skip UST perf tests if not root
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 17 Sep 2015 18:10:50 +0000 (14:10 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 21 Sep 2015 15:41:27 +0000 (11:41 -0400)
Some distributions like Debian (e.g. Debian kernel 4.1.0-2-amd64) have
some grsecurity options enabled, such as CONFIG_GRKERNSEC_PERF_HARDEN.

Unfortunately, this option makes it impossible to use the SW page-fault
perf event as a normal user. It only leaves some HW events. However, we
can only use SW events within virtual machines.

Therefore, only run this test as root for now until we find a better
approach.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
tests/fast_regression
tests/regression/ust/test_event_perf
tests/root_regression

index 97f0966f836e1c1da5b3d7c089c6d8662ee88c99..7731f5c0c008c52a96e84fa0cc2d0c0c5ce5f31b 100644 (file)
@@ -28,4 +28,3 @@ regression/ust/getcpu-override/test_getcpu_override
 regression/ust/clock-override/test_clock_override
 regression/ust/test_event_basic
 regression/ust/test_event_tracef
-regression/ust/test_event_perf
index 7fb37edfeb1ff67a4dada6711384ac6c6a1a5b6d..7dc21681fd26deb291e10724f8a68fd6d368bf25 100755 (executable)
@@ -90,8 +90,17 @@ plan_tests $NUM_TESTS
 
 print_test_banner "$TEST_DESC"
 
-start_lttng_sessiond
+if [ "$(id -u)" == "0" ]; then
+        isroot=1
+else
+        isroot=0
+fi
+
+skip $isroot "Root access is needed. Skipping UST perf tests." ${NUM_TESTS} ||
+{
+       start_lttng_sessiond
 
-test_event_basic
+       test_event_basic
 
-stop_lttng_sessiond
+       stop_lttng_sessiond
+}
index 194bc59e0b24e6d49bddaa249e264eb14414a03a..71365759d2fb3a0a28736616791f094e353a076e 100644 (file)
@@ -12,3 +12,4 @@ regression/tools/filtering/test_invalid_filter
 regression/tools/filtering/test_unsupported_op
 regression/tools/filtering/test_valid_filter
 regression/tools/wildcard/test_event_wildcard
+regression/ust/test_event_perf
This page took 0.026939 seconds and 4 git commands to generate.