Tests: Rename helper functions to have consistent names
authorChristian Babeux <christian.babeux@efficios.com>
Mon, 24 Sep 2012 16:11:47 +0000 (12:11 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Mon, 24 Sep 2012 20:36:43 +0000 (16:36 -0400)
Most of the helper functions had inconsistent naming.

Suggested naming convention for helper functions:

<action>_<bin_name>
or
<action>_lttng_<command>

List of modified helper functions:

lttng_start_relayd -> start_lttng_relayd
lttng_stop_relayd  -> stop_lttng_relayd

start_sessiond     -> start_lttng_sessiond
stop_sessiond      -> stop_lttng_sessiond

start_tracing      -> start_lttng_tracing
stop_tracing       -> stop_lttng_tracing

Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
12 files changed:
tests/kernel/run-kernel-tests.sh
tests/tools/streaming/run-kernel
tests/tools/streaming/run-ust
tests/tools/streaming/uri_switch
tests/ust/before-after/run
tests/ust/high-throughput/run
tests/ust/low-throughput/run
tests/ust/multi-session/run
tests/ust/nprocesses/run
tests/ust/nprocesses/ust-nprocesses
tests/ust/run-ust-global-tests.sh
tests/utils.sh

index f89cd7b260d2a1fccaf9669ae8eebbda6fda8dbb..6948e1fa29cca19920ae922fdde52c4ebe28a987 100755 (executable)
@@ -19,16 +19,16 @@ function start_tests ()
                        continue
                fi
 
-               start_sessiond
+               start_lttng_sessiond
 
         ./$bin $tmpdir
         # Test must return 0 to pass.
         if [ $? -ne 0 ]; then
             exit_code=1
-                       stop_sessiond
+                       stop_lttng_sessiond
             break
         fi
-               stop_sessiond
+               stop_lttng_sessiond
     done
 
        # Cleaning up
index b87be13c50f5b191da036cd8f033864c6955b53a..b64f233b8fa612f27ff307b56e8409c36e5cac74 100755 (executable)
@@ -75,10 +75,10 @@ function test_kernel_before_start ()
        lttng_create_session
        lttng_enable_consumer_localhost
        lttng_enable_kernel_event $SESSION_NAME $EVENT_NAME
-       start_tracing $SESSION_NAME
+       start_lttng_tracing $SESSION_NAME
        # Give a second
        sleep 1
-       stop_tracing $SESSION_NAME
+       stop_lttng_tracing $SESSION_NAME
        destroy_lttng_session $SESSION_NAME
 }
 
@@ -89,16 +89,16 @@ function test_kernel_after_start ()
        echo -e "\n=== Testing kernel streaming with event enable AFTER start\n"
        lttng_create_session
        lttng_enable_consumer_localhost
-       start_tracing $SESSION_NAME
+       start_lttng_tracing $SESSION_NAME
        lttng_enable_kernel_event $SESSION_NAME $EVENT_NAME
        # Give a second
        sleep 1
-       stop_tracing $SESSION_NAME
+       stop_lttng_tracing $SESSION_NAME
        destroy_lttng_session $SESSION_NAME
 }
 
-start_sessiond
-lttng_start_relayd "-o $TRACE_PATH"
+start_lttng_sessiond
+start_lttng_relayd "-o $TRACE_PATH"
 
 tests=( test_kernel_before_start )
 
@@ -118,8 +118,8 @@ do
 done
 
 echo ""
-stop_sessiond
-lttng_stop_relayd
+stop_lttng_sessiond
+stop_lttng_relayd
 
 
 exit $out
index 1c415cc70b44eb2f1436c6b7ce55f47b52b375b5..277807faa1ec4187b3dbd48333bc0c8b924b3c78 100755 (executable)
@@ -68,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
 }
 
@@ -81,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 "-o $TRACE_PATH"
+start_lttng_sessiond
+start_lttng_relayd "-o $TRACE_PATH"
 
 tests=( test_ust_before_start test_ust_after_start )
 
@@ -112,7 +112,7 @@ do
 done
 
 echo ""
-stop_sessiond
-lttng_stop_relayd
+stop_lttng_sessiond
+stop_lttng_relayd
 
 exit $out
index cb0979e9a5a347cd0be7268d93c4460e9e2b2f47..4eb4359835017e1a3506ffbc0ea7a6fe1404bfc0 100755 (executable)
@@ -94,10 +94,10 @@ function test_uri_switch_localhost_folder
        done
 
        enable_ust_lttng_event $SESSION_NAME $EVENT_NAME
-       start_tracing $SESSION_NAME
+       start_lttng_tracing $SESSION_NAME
        run_apps
        wait_apps
-       stop_tracing $SESSION_NAME
+       stop_lttng_tracing $SESSION_NAME
        destroy_lttng_session $SESSION_NAME
        validate_trace $EVENT_NAME $TRACE_PATH/$HOSTNAME/$RAND
 
@@ -135,10 +135,10 @@ function test_uri_switch_file_network
                lttng_create_session $FILE_URI
                lttng_enable_consumer "$NETWORK_URI/$NET_PATH"
                enable_ust_lttng_event $SESSION_NAME $EVENT_NAME
-               start_tracing $SESSION_NAME
+               start_lttng_tracing $SESSION_NAME
                run_apps
                wait_apps
-               stop_tracing $SESSION_NAME
+               stop_lttng_tracing $SESSION_NAME
                destroy_lttng_session $SESSION_NAME
                validate_trace $EVENT_NAME $TRACE_PATH/$HOSTNAME/$NET_PATH
 
@@ -179,10 +179,10 @@ IPVER=$1
            lttng_create_session $NETWORK_URI
            lttng_enable_consumer "$FILE_URI/$FILE_PATH"
            enable_ust_lttng_event $SESSION_NAME $EVENT_NAME
-           start_tracing $SESSION_NAME
+           start_lttng_tracing $SESSION_NAME
            run_apps
            wait_apps
-           stop_tracing $SESSION_NAME
+           stop_lttng_tracing $SESSION_NAME
            destroy_lttng_session $SESSION_NAME
            validate_trace $EVENT_NAME $TMP_PATH/$FILE_PATH
 
@@ -196,22 +196,22 @@ IPVER=$1
 }
 
 
-start_sessiond
+start_lttng_sessiond
 
 echo ""
 echo "=== Testing with IPv4"
-lttng_start_relayd "-o $TRACE_PATH"
+start_lttng_relayd "-o $TRACE_PATH"
 test_uri_switch_localhost_folder "IPv4"
 test_uri_switch_file_network "IPv4"
 test_uri_switch_network_file "IPv4"
-lttng_stop_relayd
+stop_lttng_relayd
 
 echo ""
 echo "=== Testing with IPv6"
-lttng_start_relayd "-o $TRACE_PATH -C tcp6://localhost:5342 -D tcp6://localhost:5343"
+start_lttng_relayd "-o $TRACE_PATH -C tcp6://localhost:5342 -D tcp6://localhost:5343"
 test_uri_switch_localhost_folder "IPv6"
 test_uri_switch_file_network "IPv6"
 test_uri_switch_network_file "IPv6"
-lttng_stop_relayd
+stop_lttng_relayd
 
-stop_sessiond
+stop_lttng_sessiond
index 5f6cc439b862cfb2b347db09f2e83209606a9264..46b97f4433159ac7b8f449310f9edf82ec6c1aec 100755 (executable)
@@ -39,13 +39,13 @@ test_before_apps() {
        # BEFORE application is spawned
        create_lttng_session $SESSION_NAME $TRACE_PATH
        enable_ust_lttng_event $SESSION_NAME $EVENT_NAME
-       start_tracing $SESSION_NAME
+       start_lttng_tracing $SESSION_NAME
        # Start test
        echo -n "Starting application... "
        ./$CURDIR/gen-nevents $NR_ITER
        echo -n "Ended "
        print_ok
-       stop_tracing $SESSION_NAME
+       stop_lttng_tracing $SESSION_NAME
        destroy_lttng_session $SESSION_NAME
 
        trace_matches $EVENT_NAME $NR_ITER $TRACE_PATH
@@ -63,12 +63,12 @@ test_after_apps() {
        # BEFORE application is spawned
        create_lttng_session $SESSION_NAME $TRACE_PATH
        enable_ust_lttng_event $SESSION_NAME $EVENT_NAME
-       start_tracing $SESSION_NAME
+       start_lttng_tracing $SESSION_NAME
 
        # At least hit one event
        sleep 2
 
-       stop_tracing $SESSION_NAME
+       stop_lttng_tracing $SESSION_NAME
        destroy_lttng_session $SESSION_NAME
 
        out=$(babeltrace $TRACE_PATH | grep $EVENT_NAME | wc -l)
@@ -87,7 +87,7 @@ test_after_apps() {
 
 # MUST set TESTDIR before calling those functions
 
-start_sessiond
+start_lttng_sessiond
 
 echo ""
 echo "=== Start application BEFORE tracing was started ==="
@@ -97,7 +97,7 @@ TRACE_PATH=$(mktemp -d)
 test_before_apps
 out=$?
 if [ $out -ne 0 ]; then
-       stop_sessiond
+       stop_lttng_sessiond
        exit $out
 fi
 
@@ -111,10 +111,10 @@ TRACE_PATH=$(mktemp -d)
 test_after_apps
 out=$?
 if [ $out -ne 0 ]; then
-       stop_sessiond
+       stop_lttng_sessiond
        exit $out
 fi
 
-stop_sessiond
+stop_lttng_sessiond
 
 rm -rf $TRACE_PATH
index f86a17a14f8fd1e6015a07c6bbe00dc0fdc35ab4..dff5fdd4978b437ac1c76f9d3a97868dc8a39133 100755 (executable)
@@ -36,12 +36,12 @@ TRACE_PATH=$(mktemp -d)
 
 # MUST set TESTDIR before calling those functions
 
-start_sessiond
+start_lttng_sessiond
 
 create_lttng_session $SESSION_NAME $TRACE_PATH
 
 enable_ust_lttng_event $SESSION_NAME $EVENT_NAME
-start_tracing $SESSION_NAME
+start_lttng_tracing $SESSION_NAME
 
 for i in `seq 1 $NR_ITER`; do
        ./$CURDIR/$BIN_NAME & >/dev/null 2>&1
@@ -54,10 +54,10 @@ while [ -n "$(pidof $BIN_NAME)" ]; do
 done
 echo ""
 
-stop_tracing $SESSION_NAME
+stop_lttng_tracing $SESSION_NAME
 destroy_lttng_session $SESSION_NAME
 
-stop_sessiond
+stop_lttng_sessiond
 
 # Validate test
 
index 219a6417e38c3e9193339e91f17b2479df79a8a5..26e074997e27d655e1ff5ce8bdade2f84cb17eb1 100755 (executable)
@@ -35,20 +35,20 @@ TRACE_PATH=$(mktemp -d)
 
 # MUST set TESTDIR before calling those functions
 
-start_sessiond
+start_lttng_sessiond
 
 create_lttng_session $SESSION_NAME $TRACE_PATH
 
 enable_ust_lttng_event $SESSION_NAME $EVENT_NAME
-start_tracing $SESSION_NAME
+start_lttng_tracing $SESSION_NAME
 
 # This is going to take 20 minutes
 ./$CURDIR/$BIN_NAME >/dev/null 2>&1
 
-stop_tracing $SESSION_NAME
+stop_lttng_tracing $SESSION_NAME
 destroy_lttng_session $SESSION_NAME
 
-stop_sessiond
+stop_lttng_sessiond
 
 # Validate test
 
index ce3d12bcad735777da25bcead1c9e12ec016a1d9..7242fd90ea4c59b495cce063cf79850d46edb39d 100755 (executable)
@@ -40,7 +40,7 @@ test_multi_session() {
        for i in `seq 0 3`; do
                create_lttng_session "$SESSION_NAME-$i" "$TRACE_PATH/$i"
                enable_ust_lttng_event "$SESSION_NAME-$i" "$EVENT_NAME$i"
-               start_tracing "$SESSION_NAME-$i"
+               start_lttng_tracing "$SESSION_NAME-$i"
        done
 
        echo -n "Starting application generating $NR_ITER events... "
@@ -56,7 +56,7 @@ test_multi_session() {
        print_ok
 
        for i in `seq 0 3`; do
-               stop_tracing "$SESSION_NAME-$i"
+               stop_lttng_tracing "$SESSION_NAME-$i"
                destroy_lttng_session "$SESSION_NAME-$i"
                out=$(babeltrace "$TRACE_PATH/$i" | grep "$EVENT_NAMEi$i" | wc -l)
                if [ $out -ne $NR_ITER ]; then
@@ -75,17 +75,17 @@ test_multi_session() {
 
 # MUST set TESTDIR before calling those functions
 
-start_sessiond
+start_lttng_sessiond
 
 TRACE_PATH=$(mktemp -d)
 
 test_multi_session
 out=$?
 if [ $out -ne 0 ]; then
-       stop_sessiond
+       stop_lttng_sessiond
        exit $out
 fi
 
-stop_sessiond
+stop_lttng_sessiond
 
 rm -rf "$TRACE_PATH"
index 25ca413125a9dc429aaaa0dd6aab68b7ae2f95f4..f492ed7ed0698930bc321ce331cbd24ecbe3f0ca 100755 (executable)
@@ -32,10 +32,10 @@ fi
 
 # MUST set TESTDIR before calling those functions
 
-start_sessiond
+start_lttng_sessiond
 
 ./$CURDIR/ust-nprocesses $NR_ITER
 
-stop_sessiond
+stop_lttng_sessiond
 
 exit 0
index 7355057178501e5ee934ea1e77d93dbbe2cba127..90c0c2e9b9dca4aa92e1b777454349cd21885416 100755 (executable)
@@ -52,13 +52,13 @@ TRACE_PATH=$(mktemp -d)
 create_lttng_session $SESSION_NAME $TRACE_PATH
 
 enable_ust_lttng_event $SESSION_NAME $EVENT_NAME
-start_tracing $SESSION_NAME
+start_lttng_tracing $SESSION_NAME
 
 echo "Sleeping $TEST_WAIT_SEC seconds for tracing to start everywhere"
 echo "Warning: this arbitrary time can make the test fail on slower system"
 sleep $TEST_WAIT_SEC
 
-stop_tracing $SESSION_NAME
+stop_lttng_tracing $SESSION_NAME
 destroy_lttng_session $SESSION_NAME
 
 rm -rf $TRACE_PATH
index 57c517050095b8cf68ff3bee02c372a7406ce796..e1a54ad6195db0c8a76946b2402e7e06b6a8ff60 100755 (executable)
@@ -19,16 +19,16 @@ function start_tests ()
                        continue
                fi
 
-               start_sessiond
+               start_lttng_sessiond
 
         ./$bin $tmpdir
         # Test must return 0 to pass.
         if [ $? -ne 0 ]; then
             exit_code=1
-                       stop_sessiond
+                       stop_lttng_sessiond
             break
         fi
-               stop_sessiond
+               stop_lttng_sessiond
     done
 
        # Cleaning up
index b4b2451018dc6e05764a16dbfd9bd130c4780468..5e32e78f03bd1f39edea9440c9338f28c2b20875 100644 (file)
@@ -128,7 +128,7 @@ function lttng_enable_kernel_event
        fi
 }
 
-function lttng_start_relayd
+function start_lttng_relayd
 {
        local opt="$1"
 
@@ -150,7 +150,7 @@ function lttng_start_relayd
        fi
 }
 
-function lttng_stop_relayd
+function stop_lttng_relayd
 {
        PID_RELAYD=`pidof lt-$RELAYD_BIN`
 
@@ -170,7 +170,7 @@ function lttng_stop_relayd
        fi
 }
 
-function start_sessiond()
+function start_lttng_sessiond()
 {
        if [ -n $TEST_NO_SESSIOND ] && [ "$TEST_NO_SESSIOND" == "1" ]; then
                # Env variable requested no session daemon
@@ -192,7 +192,7 @@ function start_sessiond()
        sleep 2
 }
 
-function stop_sessiond ()
+function stop_lttng_sessiond ()
 {
        if [ -n $TEST_NO_SESSIOND ] && [ "$TEST_NO_SESSIOND" == "1" ]; then
                # Env variable requested no session daemon
@@ -276,7 +276,7 @@ function enable_ust_lttng_event ()
        fi
 }
 
-function start_tracing ()
+function start_lttng_tracing ()
 {
        sess_name=$1
 
@@ -290,7 +290,7 @@ function start_tracing ()
        fi
 }
 
-function stop_tracing ()
+function stop_lttng_tracing ()
 {
        sess_name=$1
 
This page took 0.050457 seconds and 4 git commands to generate.