3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-25 09:39:25 +01:00

test-runner: require root user to run with --monitor

Since the monitor file requires touching the host file
system, root access is required.
This commit is contained in:
James Prestwood 2021-02-18 12:19:29 -08:00 committed by Denis Kenzior
parent c2d71fdaa5
commit 272a60a478

View File

@ -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))