jenkins: fix trials-cleanup.sh: use 'taken' marker
trials-cleanup.sh was still using the old 'SEEN' marker and thus didn't work.
In trial.py, make sure that *every* trial that is run is marked as taken, not
only those discovered by Trial.next().
Change-Id: I8aa6b2eece5d43266a7c84e6b2974b8fe7f3cda1
diff --git a/contrib/trials-cleanup.sh b/contrib/trials-cleanup.sh
index 2ad8c93..baf9c2b 100755
--- a/contrib/trials-cleanup.sh
+++ b/contrib/trials-cleanup.sh
@@ -17,7 +17,7 @@
trial_name="$(basename "$trial_dir")"
echo "Removing: $(ls -ld "$trial_dir")"
# ensure atomic removal, so that the gsm-tester doesn't take it as a
- # newly added dir (can happen when the 'SEEN' marker is removed first).
+ # newly added dir (can happen when the 'taken' marker is removed first).
mv "$trial_dir" "$trial_prep_dir/"
rm -rf "$trial_prep_dir/$trial_name"
}
@@ -25,6 +25,6 @@
# keep the N newest test session dirs that have been started: find all that
# have been started sorted by time, then discard all but the N newest ones.
-for seen in $(ls -1t "$trial_rx_dir"/*/SEEN | tail -n +31); do
+for seen in $(ls -1t "$trial_rx_dir"/*/taken | tail -n +31); do
rm_trial "$(dirname "$seen")"
done
diff --git a/src/osmo_gsm_tester/trial.py b/src/osmo_gsm_tester/trial.py
index 0a882f8..c490105 100644
--- a/src/osmo_gsm_tester/trial.py
+++ b/src/osmo_gsm_tester/trial.py
@@ -61,6 +61,7 @@
def __enter__(self):
self.log('Trial start')
+ self.take()
super().__enter__()
def __exit__(self, *exc_info):