Introduce a new create_lttng_session_uri test helper.
Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
print_test_banner "$TEST_DESC"
-function lttng_create_session_uri
-{
- # Create session with default path
- $TESTDIR/../src/bin/lttng/$LTTNG_BIN create $SESSION_NAME -U net://localhost >/dev/null 2>&1
- ok $? "Create session with default path"
-}
-
function validate_trace_date
{
local test_date=$1
{
diag "Test kernel streaming with metadata regeneration"
date "+%Y-%m-%d %H:%M" -s "$DATE1 $HOUR" >/dev/null
- lttng_create_session_uri
+ create_lttng_session_uri $SESSION_NAME net://localhost
lttng_enable_kernel_event $SESSION_NAME $KERNEL_EVENT_NAME
start_lttng_tracing_ok $SESSION_NAME
echo -n "100" > /proc/lttng-test-filter-event
diag "Test UST streaming with metadata regeneration"
date "+%Y-%m-%d %H:%M" -s "$DATE1 $HOUR" >/dev/null
- lttng_create_session_uri
+ create_lttng_session_uri $SESSION_NAME net://localhost
enable_ust_lttng_event_ok $SESSION_NAME $UST_EVENT_NAME
$TESTAPP_BIN $NR_ITER $NR_USEC_WAIT ${file_sync_after_first} ${file_sync_before_last} /dev/null 2>&1 &
source $TESTDIR/utils/utils.sh
-function lttng_create_session_uri
-{
- # Create session with default path
- $TESTDIR/../src/bin/lttng/$LTTNG_BIN create $SESSION_NAME \
- -U net://localhost >/dev/null 2>&1
- ok $? "Create session with default path"
-}
-
function report_errors
{
test_thread_error_string="$1"
source $TESTDIR/utils/utils.sh
-function lttng_create_session_uri
-{
- # Create session with default path
- $TESTDIR/../src/bin/lttng/$LTTNG_BIN create $SESSION_NAME \
- -U net://localhost >/dev/null 2>&1
- ok $? "Create session with default path"
-}
-
function report_errors
{
# Report health errors
source $TESTDIR/utils/utils.sh
-function lttng_create_session_uri
-{
- # Create session with default path
- $TESTDIR/../src/bin/lttng/$LTTNG_BIN create $SESSION_NAME -U net://localhost >/dev/null 2>&1
-
- ok $? "Create session $SESSION_NAME"
-}
-
function test_kernel_streaming ()
{
diag "Test kernel streaming with metadata regeneration"
- lttng_create_session_uri
+ create_lttng_session_uri $SESSION_NAME net://localhost
lttng_enable_kernel_event $SESSION_NAME $EVENT_NAME
start_lttng_tracing_ok $SESSION_NAME
echo -n "100" > /proc/lttng-test-filter-event
BAIL_OUT "No UST events binary detected."
fi
-function lttng_create_session_uri
-{
- # Create session with default path
- $TESTDIR/../src/bin/lttng/$LTTNG_BIN create $SESSION_NAME -U net://localhost >/dev/null 2>&1
- ok $? "Create session with default path"
-}
-
-function lttng_create_session_uri_live
-{
- # Create session with default path
- $TESTDIR/../src/bin/lttng/$LTTNG_BIN create $SESSION_NAME --live -U net://localhost >/dev/null 2>&1
- ok $? "Create live session"
-}
-
function enable_channel_per_pid()
{
sess_name=$1
local file_sync_before_last=$(mktemp -u)
diag "Test UST streaming with metadata regeneration"
- lttng_create_session_uri
+ create_lttng_session_uri $SESSION_NAME net://localhost
enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME
$TESTAPP_BIN $NR_ITER $NR_USEC_WAIT ${file_sync_after_first} ${file_sync_before_last} /dev/null 2>&1 &
local file_sync_before_last=$(mktemp -u)
diag "Test UST live with metadata regeneration (expect failure)"
- lttng_create_session_uri_live $SESSION_NAME $TRACE_PATH
+ create_lttng_session_uri $SESSION_NAME net://localhost --live
enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME
$TESTAPP_BIN $NR_ITER $NR_USEC_WAIT ${file_sync_after_first} ${file_sync_before_last} /dev/null 2>&1 &
source $TESTDIR/utils/utils.sh
source $CURDIR/rotate_utils.sh
-function lttng_create_session_uri
-{
- # Create session with default path
- $TESTDIR/../src/bin/lttng/$LTTNG_BIN create $SESSION_NAME -U net://localhost >/dev/null 2>&1
-
- ok $? "Create session $SESSION_NAME"
-}
-
function rotate_kernel_test ()
{
local_path=$1
function test_kernel_streaming ()
{
diag "Test kernel streaming with session rotation"
- lttng_create_session_uri
+ create_lttng_session_uri $SESSION_NAME net://localhost
rotate_kernel_test "${TRACE_PATH}/${HOSTNAME}/${SESSION_NAME}*"
clean_path $TRACE_PATH
}
function test_kernel_streaming_timer ()
{
diag "Test kernel remote with session rotation timer"
- lttng_create_session_uri
+ create_lttng_session_uri $SESSION_NAME net://localhost
lttng_enable_kernel_event $SESSION_NAME $EVENT_NAME
lttng_enable_rotation_timer_ok $SESSION_NAME 500ms
start_lttng_tracing_ok $SESSION_NAME
enable_ust_lttng_channel_ok $sess_name $channel_name --buffers-pid
}
-function lttng_create_session_uri ()
-{
- # Create session with default path
- $TESTDIR/../src/bin/lttng/$LTTNG_BIN create $SESSION_NAME -U net://localhost >/dev/null 2>&1
-
- ok $? "Create session $SESSION_NAME"
-}
-
# MUST set TESTDIR before calling those functions
function rotate_ust_test ()
function test_ust_streaming_uid ()
{
diag "Test UST streaming with session rotation per UID"
- lttng_create_session_uri
+ create_lttng_session_uri $SESSION_NAME net://localhost
enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME
rotate_ust_test "${TRACE_PATH}/${HOSTNAME}/${SESSION_NAME}*" "ust/uid/*/*/" 0
function test_ust_streaming_pid ()
{
diag "Test UST streaming with session rotation per PID"
- lttng_create_session_uri
+ create_lttng_session_uri $SESSION_NAME net://localhost
enable_channel_per_pid $SESSION_NAME "channel0"
enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME "channel0"
function test_ust_streaming_timer_uid ()
{
diag "Test ust remote with session rotation timer per-uid"
- lttng_create_session_uri
+ create_lttng_session_uri $SESSION_NAME net://localhost
enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME
lttng_enable_rotation_timer_ok $SESSION_NAME 500ms
start_lttng_tracing_ok $SESSION_NAME
function test_ust_streaming_timer_pid ()
{
diag "Test ust remote with session rotation timer per-pid"
- lttng_create_session_uri
+ create_lttng_session_uri $SESSION_NAME net://localhost
enable_channel_per_pid $SESSION_NAME "channel0"
enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME "channel0"
lttng_enable_rotation_timer_ok $SESSION_NAME 500ms
source $TESTDIR/utils/utils.sh
-function lttng_create_session_uri
-{
- # Create session with default path
- $TESTDIR/../src/bin/lttng/$LTTNG_BIN create $SESSION_NAME -U net://localhost >/dev/null 2>&1
-
- ok $? "Create session $SESSION_NAME"
-}
-
function test_kernel_before_start ()
{
diag "Test kernel streaming with event enable BEFORE start"
- lttng_create_session_uri
+ create_lttng_session_uri $SESSION_NAME net://localhost
lttng_enable_kernel_event $SESSION_NAME $EVENT_NAME
start_lttng_tracing_ok $SESSION_NAME
# Give a second
function test_kernel_after_start ()
{
diag "Test kernel streaming with event enable AFTER start"
- lttng_create_session_uri
+ create_lttng_session_uri $SESSION_NAME net://localhost
start_lttng_tracing_ok $SESSION_NAME
lttng_enable_kernel_event $SESSION_NAME $EVENT_NAME
# Give a second
BAIL_OUT "No UST events binary detected."
fi
-function lttng_create_session_uri
-{
- # Create session with default path
- $TESTDIR/../src/bin/lttng/$LTTNG_BIN create $SESSION_NAME -U net://localhost >/dev/null 2>&1
- ok $? "Create session with default path"
-}
-
-
# MUST set TESTDIR before calling those functions
function test_ust_before_start ()
local file_sync_before_last=$(mktemp -u)
diag "Test UST streaming BEFORE tracing starts"
- lttng_create_session_uri
+ create_lttng_session_uri $SESSION_NAME net://localhost
enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME
# Run 5 times with a 1 second delay
local file_sync_after_first=$(mktemp -u)
diag "Test UST streaming AFTER tracing starts"
- lttng_create_session_uri
+ create_lttng_session_uri $SESSION_NAME net://localhost
enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME
start_lttng_tracing_ok $SESSION_NAME
ok $? "Enable channel $channel_name per UID for session $sess_name"
}
-function lttng_create_session_uri
-{
- local name=$1
-
- # Create session with default path
- $TESTDIR/../src/bin/lttng/$LTTNG_BIN create $name -U net://localhost >/dev/null 2>&1
- ok $? "Create session on net://localhost"
-}
-
function check_sessiond()
{
if [ -z "$(pgrep --full lt-lttng-sessiond)" ]; then
{
for b in $(seq 1 $NR_LOOP); do
for a in $(seq 1 $NR_SESSION); do
- lttng_create_session_uri $SESSION_NAME-$a
+ create_lttng_session_uri $SESSION_NAME-$a net://localhost
check_sessiond
check_relayd
enable_channel_per_uid $SESSION_NAME-$a $CHANNEL_NAME
ok $? "Enable channel $channel_name per UID for session $sess_name"
}
-function lttng_create_session_uri
-{
- local name=$1
-
- # Create session with default path
- $TESTDIR/../src/bin/lttng/$LTTNG_BIN create $name -U net://localhost >/dev/null 2>&1
- ok $? "Create session on net://localhost"
-}
-
function check_sessiond()
{
if [ -z "$(pgrep --full lt-lttng-sessiond)" ]; then
{
for b in $(seq 1 $NR_LOOP); do
for a in $(seq 1 $NR_SESSION); do
- lttng_create_session_uri $SESSION_NAME-$a
+ create_lttng_session_uri $SESSION_NAME-$a net://localhost
check_sessiond
check_relayd
enable_channel_per_uid $SESSION_NAME-$a $CHANNEL_NAME
ok $? "Create session $sess_name in no-output mode"
}
+function create_lttng_session_uri () {
+ local sess_name=$1
+ local uri=$2
+ local opts="${@:3}"
+
+ $TESTDIR/../src/bin/lttng/$LTTNG_BIN create $sess_name -U $uri $opts 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
+ ok $? "Create session $sess_name with uri:$uri and opts: $opts"
+}
+
function create_lttng_session ()
{
local withtap=$1