X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=src%2Ftest%2Fjava%2Forg%2Flttng%2Fust%2Fagent%2Futils%2FMiscTestUtils.java;h=3aac32c00d1627641f9fa59dd7a6012e1d22d236;hb=8a0613fae3d438ff096d22cf5762bc6ed083e16b;hp=dd5505c7effb06f203b83110edbf21db739246e9;hpb=2b408e85806bd695f6036371701dcb8691ab3c32;p=lttng-ust-java-tests.git diff --git a/src/test/java/org/lttng/ust/agent/utils/MiscTestUtils.java b/src/test/java/org/lttng/ust/agent/utils/MiscTestUtils.java index dd5505c..3aac32c 100644 --- a/src/test/java/org/lttng/ust/agent/utils/MiscTestUtils.java +++ b/src/test/java/org/lttng/ust/agent/utils/MiscTestUtils.java @@ -91,6 +91,12 @@ public final class MiscTestUtils { } } + /** + * Check if there is a user session daemon currently running on the system. + * It needs to be of the same user as the application running this program. + * + * @return If there is a user session daemon currently running + */ public static boolean checkForUserSessiond() { String userName = System.getProperty("user.name"); @@ -104,6 +110,12 @@ public final class MiscTestUtils { .anyMatch(s -> s.startsWith(shortUserName)); } + /** + * Check if there is a root user session daemon daemon currently running on + * the system. + * + * @return If there is a root session daemon currently running + */ public static boolean checkForRootSessiond() { List command = Arrays.asList("ps", "-e", "u"); List output = getOutputFromCommand(false, command);