X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=src%2Forg%2Flttng%2Fust%2Fagent%2Futils%2FLttngSession.java;h=fa387fb2f3b67d724f14893e252e887460b5e933;hb=e41ec02aad337ff074f5209ee11fe2c8edb87a81;hp=d13e2fb53cbc5a268e6f95cbd9d5f3916f37df24;hpb=8576633f94f26d8fb955d7c3a29a03cd09e99ed4;p=lttng-ust-java-tests.git diff --git a/src/org/lttng/ust/agent/utils/LttngSession.java b/src/org/lttng/ust/agent/utils/LttngSession.java index d13e2fb..fa387fb 100644 --- a/src/org/lttng/ust/agent/utils/LttngSession.java +++ b/src/org/lttng/ust/agent/utils/LttngSession.java @@ -137,6 +137,14 @@ public class LttngSession implements AutoCloseable { return TestUtils.getOutputFromCommand(Arrays.asList("lttng", "view", sessionName)); } + /** + * Utility method to destroy all existing sessions. Useful when first + * setting up a test to make sure no existing session interferes. + */ + public static void destroyAllSessions() { + executeCommand(Arrays.asList("lttng", "destroy", "-a")); + } + /** * Outside of the scope of lttng-tools, but this utility method can be used * to delete all traces currently under ~/lttng-traces/. This can be used by