Tests: Cleanup redundant code and use printing helper functions
[lttng-tools.git] / tests / tools / streaming / run-ust
index 2e88d2a9fc8541b4aa686e39cf0f30054f433cb4..1c415cc70b44eb2f1436c6b7ce55f47b52b375b5 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."
@@ -91,7 +92,7 @@ function test_ust_after_start ()
 }
 
 start_sessiond
-lttng_start_relayd
+lttng_start_relayd "-o $TRACE_PATH"
 
 tests=( test_ust_before_start test_ust_after_start )
 
@@ -101,11 +102,10 @@ 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
This page took 0.02367 seconds and 4 git commands to generate.