From 272a60a478a521f6b233fcee46b84bd075a7a029 Mon Sep 17 00:00:00 2001 From: James Prestwood Date: Thu, 18 Feb 2021 12:19:29 -0800 Subject: [PATCH] test-runner: require root user to run with --monitor Since the monitor file requires touching the host file system, root access is required. --- tools/test-runner | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/test-runner b/tools/test-runner index a390014b..8bf8d363 100755 --- a/tools/test-runner +++ b/tools/test-runner @@ -1434,6 +1434,10 @@ class Main: options += ' --log-uid %u' % uid if self.args.monitor: + if os.environ.get('SUDO_GID', None) is None: + print("--monitor can only be used as root user") + quit() + self.args.monitor = os.path.abspath(self.args.monitor) mon_parent_dir = os.path.abspath(os.path.join(self.args.monitor, os.pardir))