Check if we have enough rights to create a service on Windows
otherwise we skip daemon test
Signed-off-by: Paul-Daniel Boca <pboca@cloudbasesolutions.com>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Tested-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
AT_SETUP([daemon])
AT_SKIP_IF([test "$IS_WIN32" = "yes"])
+
+dnl OVS_SKIP_NON_ADMIN_WIN()
+dnl
+dnl Checks if we have enough rights to create a service
+m4_define([OVS_SKIP_NON_ADMIN_WIN],
+ [
+ AT_SKIP_IF([net session; test $? -ne 0])
+ ])
+
OVSDB_INIT([db])
AT_CAPTURE_FILE([pid])
AT_CAPTURE_FILE([expected])
AT_SETUP([daemon --service])
AT_KEYWORDS([windows-service])
AT_SKIP_IF([test "$IS_WIN32" != "yes"])
+OVS_SKIP_NON_ADMIN_WIN
+
OVSDB_INIT([db])
AT_CAPTURE_FILE([pid])
# To create a Windows service, we need the absolute path for the executable.