linuxdebug/tools/testing/selftests/tc-testing/plugin-lib/rootPlugin.py

20 lines
493 B
Python
Raw Permalink Normal View History

2024-07-16 15:50:57 +02:00
import os
import sys
from TdcPlugin import TdcPlugin
from tdc_config import *
class SubPlugin(TdcPlugin):
def __init__(self):
self.sub_class = 'root/SubPlugin'
super().__init__()
def pre_suite(self, testcount, testidlist):
# run commands before test_runner goes into a test loop
super().pre_suite(testcount, testidlist)
if os.geteuid():
print('This script must be run with root privileges', file=sys.stderr)
exit(1)