X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=tests%2Fregression%2Fust%2Fgetcpu-override%2Ftest_getcpu_override;h=030d22042af705ac60e70ad0cf1f9f202aef7db7;hb=9d16b343fb9e781fc8d8fa3c448a3f382306dd33;hp=f140eeaed2e6b1e686c8cb3f57810e4629d804f9;hpb=fb7767e02f8f8d126153786073497440a8065ea9;p=lttng-tools.git diff --git a/tests/regression/ust/getcpu-override/test_getcpu_override b/tests/regression/ust/getcpu-override/test_getcpu_override index f140eeaed..030d22042 100755 --- a/tests/regression/ust/getcpu-override/test_getcpu_override +++ b/tests/regression/ust/getcpu-override/test_getcpu_override @@ -1,19 +1,9 @@ #!/bin/bash # -# Copyright (C) - 2015 Jonathan Rajotte +# Copyright (C) 2015 Jonathan Rajotte # -# This library is free software; you can redistribute it and/or modify it under -# the terms of the GNU Lesser General Public License as published by the Free -# Software Foundation; version 2.1 of the License. -# -# This library is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more -# details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this library; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# SPDX-License-Identifier: LGPL-2.1-only + TEST_DESC="UST - Getcpu override plugin" CURDIR=$(dirname $0)/ @@ -50,23 +40,19 @@ source $TESTDIR/utils/utils.sh # Equivalent to the syconf(_SC_NPROCESSORS_CONF) call. num_cpus=$(conf_proc_count) -if [ ! -x "$CURDIR/.libs/lttng-ust-getcpu-override-test.so" ]; then - BAIL_OUT "No shared object generated" -fi - # MUST set TESTDIR before calling those functions run_app() { diag "Launching app without getcpu-plugin wrapper" - $TESTAPP_BIN $NUM_EVENT $EVENT_WAIT_USEC + $TESTAPP_BIN -i $NUM_EVENT -w $EVENT_WAIT_USEC ok $? "Application without wrapper done" } run_getcpu_plugin_app() { diag "Launching app with getcpu-plugin wrapper" - $CURDIR/$TESTAPP_WRAPPER $TESTAPP_BIN $NUM_EVENT $EVENT_WAIT_USEC + $CURDIR/$TESTAPP_WRAPPER $TESTAPP_BIN -i $NUM_EVENT -w $EVENT_WAIT_USEC ok $? "Application with wrapper done" } @@ -161,6 +147,20 @@ plan_tests $NUM_TESTS print_test_banner "$TEST_DESC" +if [ ! -x "$CURDIR/.libs/lttng-ust-getcpu-override-test.so" ]; then + skip 0 "No shared object generated. Skipping all tests." $NUM_TESTS && exit 0 +fi + +if [ "$num_cpus" -eq "1" ]; then + # Skip the test since we cannot perform it as designed since N mod 1 + # is always equals to zero. There is no point testing this on a system + # with a single configured core. LTTng-UST limits the get_cpu function + # to return value inside the [0, NUM_CPU - 1] range for a valid event + # (present in trace). + skip 0 "Test system only have a single thread. Skipping all tests." $NUM_TESTS && exit 0 +fi + + TESTS=( test_getcpu_override_fail test_getcpu_override