#!/bin/bash
#
# Copyright (C) 2018 Jérémie Galarneau <jdesfossez@efficios.com>
#
# SPDX-License-Identifier: LGPL-2.1-only

TEST_DESC="Rotation - Schedule API"

CURDIR=$(dirname $0)/
TESTDIR=$CURDIR/../../..

SESSION_NAME="my_session"
TRACE_PATH=$(mktemp --tmpdir -d -t tmp.rotation_schedule_api.XXXXXX)

source $TESTDIR/utils/utils.sh

print_test_banner "$TEST_DESC"

start_lttng_sessiond_notap

create_lttng_session_notap $SESSION_NAME $TRACE_PATH

# The actual test is a native application as it tests the liblttng-ctl API
$CURDIR/schedule_api $SESSION_NAME

destroy_lttng_session_notap $SESSION_NAME
stop_lttng_sessiond_notap

# Remove tmp dir
rm -rf $TRACE_PATH
