Neels Hofmeyr | dae3d3c | 2017-03-28 12:16:58 +0200 | [diff] [blame] | 1 | import sys |
| 2 | import time |
Neels Hofmeyr | 417a03d | 2017-05-04 14:48:49 +0200 | [diff] [blame] | 3 | import os |
Neels Hofmeyr | dae3d3c | 2017-03-28 12:16:58 +0200 | [diff] [blame] | 4 | |
| 5 | import _prep |
| 6 | |
Neels Hofmeyr | 417a03d | 2017-05-04 14:48:49 +0200 | [diff] [blame] | 7 | from osmo_gsm_tester.util import FileLock, touch_file |
Neels Hofmeyr | dae3d3c | 2017-03-28 12:16:58 +0200 | [diff] [blame] | 8 | |
Neels Hofmeyr | 417a03d | 2017-05-04 14:48:49 +0200 | [diff] [blame] | 9 | testdir, name = sys.argv[1:] |
| 10 | stop_signalling_file = os.path.join(testdir, name) |
| 11 | assert os.path.isfile(stop_signalling_file) |
| 12 | |
| 13 | lockfile_path = os.path.join(testdir, 'lock_test') |
| 14 | fl = FileLock(lockfile_path, name) |
Neels Hofmeyr | dae3d3c | 2017-03-28 12:16:58 +0200 | [diff] [blame] | 15 | |
| 16 | with fl: |
Neels Hofmeyr | 417a03d | 2017-05-04 14:48:49 +0200 | [diff] [blame] | 17 | while os.path.exists(stop_signalling_file): |
| 18 | time.sleep(.1) |
Neels Hofmeyr | 417a03d | 2017-05-04 14:48:49 +0200 | [diff] [blame] | 19 | touch_file(stop_signalling_file + '.done') |
Neels Hofmeyr | dae3d3c | 2017-03-28 12:16:58 +0200 | [diff] [blame] | 20 | |
| 21 | # vim: expandtab tabstop=4 shiftwidth=4 |