From: Mathieu Desnoyers Date: Thu, 17 Sep 2015 18:10:50 +0000 (-0400) Subject: Fix: tests: skip UST perf tests if not root X-Git-Tag: v2.7.0~17 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=cabd6e55e74ae97aa090133143ae53bf71dbad86;p=lttng-tools.git Fix: tests: skip UST perf tests if not root 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 Signed-off-by: Jérémie Galarneau --- diff --git a/tests/fast_regression b/tests/fast_regression index 97f0966f8..7731f5c0c 100644 --- a/tests/fast_regression +++ b/tests/fast_regression @@ -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 diff --git a/tests/regression/ust/test_event_perf b/tests/regression/ust/test_event_perf index 7fb37edfe..7dc21681f 100755 --- a/tests/regression/ust/test_event_perf +++ b/tests/regression/ust/test_event_perf @@ -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 +} diff --git a/tests/root_regression b/tests/root_regression index 194bc59e0..71365759d 100644 --- a/tests/root_regression +++ b/tests/root_regression @@ -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