Tests: Cleanup redundant code and use printing helper functions
[lttng-tools.git] / tests / tools / streaming / run-kernel
index 73a99de158a070ccef6f95cbdb1b9d5953b260dd..b87be13c50f5b191da036cd8f033864c6955b53a 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 - Kernel tracing"
 
 CURDIR=$(dirname $0)/
 TESTDIR=$CURDIR/../..
@@ -25,9 +26,7 @@ TRACE_PATH=$(mktemp -d)
 
 source $TESTDIR/utils.sh
 
-echo -e "\n---------------------------"
-echo -e " Streaming - Kernel tracing "
-echo -e "----------------------------"
+print_test_banner "$TEST_DESC"
 
 if [ "$(id -u)" != "0" ]; then
        echo "This test must be running as root. Aborting"
@@ -50,10 +49,10 @@ function lttng_create_session
        # Create session with default path
        $TESTDIR/../src/bin/lttng/$LTTNG_BIN create $SESSION_NAME >/dev/null 2>&1
        if [ $? -eq 1 ]; then
-               echo -e '\e[1;31mFAILED\e[0m'
+               print_fail
                return 1
        else
-               echo -e "\e[1;32mOK\e[0m"
+               print_ok
        fi
 }
 
@@ -63,10 +62,10 @@ function lttng_enable_consumer_localhost
        # Create session with default path
        $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-consumer -k net://localhost >/dev/null 2>&1
        if [ $? -eq 1 ]; then
-               echo -e '\e[1;31mFAILED\e[0m'
+               print_fail
                return 1
        else
-               echo -e "\e[1;32mOK\e[0m"
+               print_ok
        fi
 }
 
This page took 0.023146 seconds and 4 git commands to generate.