rootPlugin.py 493 B

12345678910111213141516171819
  1. import os
  2. import sys
  3. from TdcPlugin import TdcPlugin
  4. from tdc_config import *
  5. class SubPlugin(TdcPlugin):
  6. def __init__(self):
  7. self.sub_class = 'root/SubPlugin'
  8. super().__init__()
  9. def pre_suite(self, testcount, testidlist):
  10. # run commands before test_runner goes into a test loop
  11. super().pre_suite(testcount, testidlist)
  12. if os.geteuid():
  13. print('This script must be run with root privileges', file=sys.stderr)
  14. exit(1)