blob: bdf7c646021b41269cf22b2ed495a5d1063ffdaf [file] [log] [blame]
Neels Hofmeyrdae3d3c2017-03-28 12:16:58 +02001import sys
2import time
Neels Hofmeyr417a03d2017-05-04 14:48:49 +02003import os
Neels Hofmeyrdae3d3c2017-03-28 12:16:58 +02004
5import _prep
6
Neels Hofmeyr417a03d2017-05-04 14:48:49 +02007from osmo_gsm_tester.util import FileLock, touch_file
Neels Hofmeyrdae3d3c2017-03-28 12:16:58 +02008
Neels Hofmeyr417a03d2017-05-04 14:48:49 +02009testdir, name = sys.argv[1:]
10stop_signalling_file = os.path.join(testdir, name)
11assert os.path.isfile(stop_signalling_file)
12
13lockfile_path = os.path.join(testdir, 'lock_test')
14fl = FileLock(lockfile_path, name)
Neels Hofmeyrdae3d3c2017-03-28 12:16:58 +020015
16with fl:
Neels Hofmeyr417a03d2017-05-04 14:48:49 +020017 while os.path.exists(stop_signalling_file):
18 time.sleep(.1)
Neels Hofmeyr417a03d2017-05-04 14:48:49 +020019touch_file(stop_signalling_file + '.done')
Neels Hofmeyrdae3d3c2017-03-28 12:16:58 +020020
21# vim: expandtab tabstop=4 shiftwidth=4