From: Jonathan Rajotte Date: Thu, 6 Oct 2016 21:12:38 +0000 (-0400) Subject: test: load --override-name X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=5f73564142abcb8c6263c66b2dbd405db8393e55;p=lttng-tools.git test: load --override-name Signed-off-by: Jonathan Rajotte Signed-off-by: Jérémie Galarneau --- diff --git a/tests/regression/tools/save-load/test_load b/tests/regression/tools/save-load/test_load index ff1471b81..005ec4c9c 100755 --- a/tests/regression/tools/save-load/test_load +++ b/tests/regression/tools/save-load/test_load @@ -30,7 +30,7 @@ EVENT_NAME="tp:tptest" DIR=$(readlink -f $TESTDIR) -NUM_TESTS=62 +NUM_TESTS=66 source $TESTDIR/utils/utils.sh @@ -302,6 +302,35 @@ function test_override_url_live() rm -rf ${mi_output_file} } +function test_override_session_name() +{ + diag "Test session name override" + local override_name="PinkyAndTheBrain" + + local mi_output_file=$(mktemp) + if [ $? -ne 0 ]; then + break; + fi + + lttng_load_ok "-i ${CURDIR}/${SESSION_NAME}.lttng --override-name=${override_name} ${SESSION_NAME}" + ${TESTDIR}/../src/bin/lttng/${LTTNG_BIN} --mi XML list "${SESSION_NAME}" &> /dev/null + if [ $? -eq 0 ]; then + fail "Expected a failure on listing for old session name" + fi + + ${TESTDIR}/../src/bin/lttng/${LTTNG_BIN} --mi XML list "${override_name}" > $mi_output_file + mi_result=$($CURDIR/../mi/extract_xml $mi_output_file "//lttng:command/lttng:output/lttng:sessions/lttng:session/lttng:name") + + test "${mi_result}" = "${override_name}" + ok $? "Override name successful [${SESSION_NAME} to ${override_name}]" + destroy_lttng_session_ok "${override_name}" + + diag "Test session name override with all (Do not permit)" + lttng_load_fail "-i ${CURDIR}/${SESSION_NAME}.lttng --override-name=${override_name}" + + rm -rf ${mi_output_file} +} + start_lttng_sessiond TESTS=( @@ -313,6 +342,7 @@ TESTS=( test_override_url_normal test_override_url_snapshot test_override_url_live + test_override_session_name ) for fct_test in ${TESTS[@]};