2017-03-28 10:16:58 +00:00
|
|
|
import sys
|
|
|
|
import time
|
2017-05-04 12:48:49 +00:00
|
|
|
import os
|
2017-03-28 10:16:58 +00:00
|
|
|
|
|
|
|
import _prep
|
|
|
|
|
2020-04-10 17:51:31 +00:00
|
|
|
from osmo_gsm_tester.core.util import FileLock, touch_file
|
2017-03-28 10:16:58 +00:00
|
|
|
|
2017-05-04 12:48:49 +00:00
|
|
|
testdir, name = sys.argv[1:]
|
|
|
|
stop_signalling_file = os.path.join(testdir, name)
|
2017-09-13 23:31:41 +00:00
|
|
|
if not os.path.isfile(stop_signalling_file):
|
|
|
|
print('expected a stop-file %r' % stop_signalling_file)
|
|
|
|
exit(1)
|
2017-05-04 12:48:49 +00:00
|
|
|
|
|
|
|
lockfile_path = os.path.join(testdir, 'lock_test')
|
|
|
|
fl = FileLock(lockfile_path, name)
|
2017-03-28 10:16:58 +00:00
|
|
|
|
2017-09-13 23:31:41 +00:00
|
|
|
touch_file(stop_signalling_file + '.ready')
|
|
|
|
|
2017-03-28 10:16:58 +00:00
|
|
|
with fl:
|
2017-05-04 12:48:49 +00:00
|
|
|
while os.path.exists(stop_signalling_file):
|
|
|
|
time.sleep(.1)
|
|
|
|
touch_file(stop_signalling_file + '.done')
|
2017-03-28 10:16:58 +00:00
|
|
|
|
|
|
|
# vim: expandtab tabstop=4 shiftwidth=4
|