Tests: Rename helper functions to have consistent names
[lttng-tools.git] / tests / tools / streaming / run-ust
index 0689201621e30d6ecd300c889105491389c851a4..277807faa1ec4187b3dbd48333bc0c8b924b3c78 100755 (executable)
@@ -14,6 +14,7 @@
 # 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
+TEST_DESC="Streaming - User space tracing"
 
 CURDIR=$(dirname $0)/
 TESTDIR=$CURDIR/../..
@@ -22,11 +23,11 @@ SESSION_NAME="stream"
 EVENT_NAME="tp:tptest"
 PID_RELAYD=0
 
+TRACE_PATH=$(mktemp -d)
+
 source $TESTDIR/utils.sh
 
-echo -e "\n-------------------------------"
-echo -e " Streaming - User space tracing "
-echo -e "--------------------------------"
+print_test_banner "$TEST_DESC"
 
 if [ ! -x "$CURDIR/$BIN_NAME" ]; then
        echo -e "No UST nevents binary detected. Passing."
@@ -42,7 +43,7 @@ function lttng_create_session
 function lttng_enable_consumer
 {
        # Create session with default path
-       $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-consumer -u net://localhost/test >/dev/null 2>&1
+       $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-consumer -u net://localhost >/dev/null 2>&1
 }
 
 function wait_apps
@@ -67,10 +68,10 @@ function test_ust_before_start ()
        # Run 5 times with a 1 second delay
        ./$CURDIR/$BIN_NAME 5 1000000 >/dev/null 2>&1 &
 
-       start_tracing $SESSION_NAME
+       start_lttng_tracing $SESSION_NAME
 
        wait_apps
-       stop_tracing $SESSION_NAME
+       stop_lttng_tracing $SESSION_NAME
        destroy_lttng_session $SESSION_NAME
 }
 
@@ -80,18 +81,18 @@ function test_ust_after_start ()
        lttng_create_session
        lttng_enable_consumer
        enable_ust_lttng_event $SESSION_NAME $EVENT_NAME
-       start_tracing $SESSION_NAME
+       start_lttng_tracing $SESSION_NAME
 
        # Run 5 times with a 1 second delay
        ./$CURDIR/$BIN_NAME 5 1000000 >/dev/null 2>&1 &
 
        wait_apps
-       stop_tracing $SESSION_NAME
+       stop_lttng_tracing $SESSION_NAME
        destroy_lttng_session $SESSION_NAME
 }
 
-start_sessiond
-lttng_start_relayd
+start_lttng_sessiond
+start_lttng_relayd "-o $TRACE_PATH"
 
 tests=( test_ust_before_start test_ust_after_start )
 
@@ -101,18 +102,17 @@ do
        ${fct_test}
 
        # Validate test
-       validate_trace $EVENT_NAME ~/lttng-traces/$HOSTNAME/$SESSION_NAME*
+       validate_trace $EVENT_NAME $TRACE_PATH/$HOSTNAME/$SESSION_NAME*
        if [ $? -eq 0 ]; then
                # Only delete if successful
-               rm -rf ~/lttng-traces/$HOSTNAME/$SESSION_NAME*
-               rm -rf ~/lttng-traces/$SESSION_NAME*
+               rm -rf $TRACE_PATH
        else
                break
        fi
 done
 
 echo ""
-stop_sessiond
-lttng_stop_relayd
+stop_lttng_sessiond
+stop_lttng_relayd
 
 exit $out
This page took 0.023457 seconds and 4 git commands to generate.