Exit and print help if not started with root privileges
diff --git a/tests/oft b/tests/oft
index fd70935..4f60a2a 100755
--- a/tests/oft
+++ b/tests/oft
@@ -116,6 +116,7 @@
import logging
import unittest
import time
+import os
##@var DEBUG_LEVELS
# Map from strings to debugging levels
@@ -433,6 +434,11 @@
else:
_verb = 2
+if os.getuid() != 0:
+ print "ERROR: Super-user privileges required. Please re-run with " \
+ "sudo or as root."
+ exit(1)
+
logging.info("*** TEST RUN START: " + time.asctime())
unittest.TextTestRunner(verbosity=_verb).run(suite)
logging.info("*** TEST RUN END : " + time.asctime())