+ lttng_remove_trigger_ok "T2"
+ lttng_remove_trigger_ok "T3"
+ lttng_remove_trigger_ok "T4"
+}
+
+test_session_consumed_size_condition ()
+{
+ ${register_some_triggers_bin} test_session_consumed_size_condition
+
+ cat > "${tmp_expected_stdout}" <<- EOF
+ - name: trigger-with-session-consumed-size-condition
+ owner uid: ${uid}
+ condition: session consumed size
+ session name: the-session-name
+ threshold: 1234 bytes
+ actions:
+ notify
+ errors: none
+ errors: none
+ EOF
+
+ list_triggers_matches_ok "session consumed size condition" "${tmp_expected_stdout}"
+
+ lttng_remove_trigger_ok "trigger-with-session-consumed-size-condition"
+}
+
+test_buffer_usage_conditions ()
+{
+ ${register_some_triggers_bin} test_buffer_usage_conditions
+
+ cat > "${tmp_expected_stdout}" <<- EOF
+ - name: trigger-with-buffer-usage-high-bytes-condition
+ owner uid: ${uid}
+ condition: buffer usage high
+ session name: the-session-name
+ channel name: the-channel-name
+ domain: ust
+ threshold (bytes): 1234
+ actions:
+ notify
+ errors: none
+ errors: none
+ - name: trigger-with-buffer-usage-high-ratio-condition
+ owner uid: ${uid}
+ condition: buffer usage high
+ session name: the-session-name
+ channel name: the-channel-name
+ domain: ust
+ threshold (ratio): 0.25
+ actions:
+ notify
+ errors: none
+ errors: none
+ - name: trigger-with-buffer-usage-low-bytes-condition
+ owner uid: ${uid}
+ condition: buffer usage low
+ session name: the-session-name
+ channel name: the-channel-name
+ domain: ust
+ threshold (bytes): 2345
+ actions:
+ notify
+ errors: none
+ errors: none
+ - name: trigger-with-buffer-usage-low-ratio-condition
+ owner uid: ${uid}
+ condition: buffer usage low
+ session name: the-session-name
+ channel name: the-channel-name
+ domain: ust
+ threshold (ratio): 0.40
+ actions:
+ notify
+ errors: none
+ errors: none
+ EOF
+
+ list_triggers_matches_ok "buffer usage condition" "${tmp_expected_stdout}"
+
+ lttng_remove_trigger_ok "trigger-with-buffer-usage-high-bytes-condition"
+ lttng_remove_trigger_ok "trigger-with-buffer-usage-high-ratio-condition"
+ lttng_remove_trigger_ok "trigger-with-buffer-usage-low-bytes-condition"
+ lttng_remove_trigger_ok "trigger-with-buffer-usage-low-ratio-condition"
+}
+
+test_session_rotation_conditions ()
+{
+ ${register_some_triggers_bin} test_session_rotation_conditions
+
+ cat > "${tmp_expected_stdout}" <<- EOF
+ - name: trigger-with-session-rotation-completed-condition
+ owner uid: ${uid}
+ condition: session rotation completed
+ session name: the-session-name
+ actions:
+ notify
+ errors: none
+ errors: none
+ - name: trigger-with-session-rotation-ongoing-condition
+ owner uid: ${uid}
+ condition: session rotation ongoing
+ session name: the-session-name
+ actions:
+ notify
+ errors: none
+ errors: none
+ EOF
+
+ list_triggers_matches_ok "session rotation conditions" "${tmp_expected_stdout}"
+
+ lttng_remove_trigger_ok "trigger-with-session-rotation-completed-condition"
+ lttng_remove_trigger_ok "trigger-with-session-rotation-ongoing-condition"