Skip to content
Snippets Groups Projects
Commit 72cfb580 authored by Stéphane Diemer's avatar Stéphane Diemer
Browse files

Restart tester if updated (refs #24053).

parent 3915d125
No related branches found
No related tags found
No related merge requests found
......@@ -71,13 +71,14 @@ def raid_idle():
class Tester():
USAGE = '''%s [-e] [-f] [-b] [-d] [-h] [msuser]
USAGE = '''%s [-e] [-f] [-b] [-n] [-d] [-h] [msuser]
-e: send email with report.
-f: send email with report only if at least one test failed.
-b: run only basic tests (exclude mediaserver tests).
-n: do not update envsetup repository.
-d: debug mode (can be started with non root users).
-h: show this message.''' % __file__
VALID_ARGS = ['-e', '-f', '-b', '-d', '-h']
VALID_ARGS = ['-e', '-f', '-b', '-n', '-d', '-h']
MAX_LOG_FILES = 50
NO_MAIL_FAILURES_COUNT = 5
......@@ -119,7 +120,14 @@ class Tester():
log('This script should be run as root user.')
sys.exit(1)
# Update envsetup files
subprocess.call(['python3', 'update_envsetup.py'])
if '-n' not in args:
tester_path = os.path.join(root_dir, os.path.basename(__file__))
mtime = os.path.getmtime(tester_path)
subprocess.call(['python3', 'update_envsetup.py'])
if mtime != os.path.getmtime(tester_path):
log('The script has changed, restarting it...')
os.execl('/bin/python3', 'python3', tester_path, '-n', *args)
sys.exit(1) # not reachable
# Load conf
conf = utils.load_conf()
if not conf:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment