From e44a0cb0d91fb6fa543a3f6b83aae6ff5afbbcf9 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Sun, 14 May 2017 03:25:45 +0200 Subject: trial: always use abspath No actual failure known, but using the abspath will prevent further problems when running a binary in its own run dir and passing trial paths to it. Adjust test expectations. Change-Id: Ia2ba876a42eef9122a92645edd1f28ddb56e6be3 --- selftest/trial_test.ok | 4 ++-- selftest/trial_test.ok.ign | 1 + src/osmo_gsm_tester/trial.py | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/selftest/trial_test.ok b/selftest/trial_test.ok index 66dcff0..6ad39a9 100644 --- a/selftest/trial_test.ok +++ b/selftest/trial_test.ok @@ -11,6 +11,6 @@ third None - test checksum verification - detect wrong checksum -ok, got RuntimeError("Checksum mismatch for 'trial_test/invalid_checksum/file2' vs. 'trial_test/invalid_checksum/checksums.md5' line 2",) +ok, got RuntimeError("Checksum mismatch for '[PATH]/trial_test/invalid_checksum/file2' vs. '[PATH]/trial_test/invalid_checksum/checksums.md5' line 2",) - detect missing file -ok, got RuntimeError("File listed in checksums file but missing in trials dir: 'trial_test/missing_file/file2' vs. 'trial_test/missing_file/checksums.md5' line 2",) +ok, got RuntimeError("File listed in checksums file but missing in trials dir: '[PATH]/trial_test/missing_file/file2' vs. '[PATH]/trial_test/missing_file/checksums.md5' line 2",) diff --git a/selftest/trial_test.ok.ign b/selftest/trial_test.ok.ign index 38a82ce..1a969de 100644 --- a/selftest/trial_test.ok.ign +++ b/selftest/trial_test.ok.ign @@ -1,2 +1,3 @@ /tmp/[^/]* [TMP] ....-..-.._..-..-.. [TIMESTAMP] +'[^']*/trial_test '[PATH]/trial_test diff --git a/src/osmo_gsm_tester/trial.py b/src/osmo_gsm_tester/trial.py index a7c74c4..171061d 100644 --- a/src/osmo_gsm_tester/trial.py +++ b/src/osmo_gsm_tester/trial.py @@ -52,7 +52,7 @@ class Trial(log.Origin): return Trial(trials_dir.child(next_trial)).take() def __init__(self, trial_dir): - self.path = trial_dir + self.path = os.path.abspath(trial_dir) self.set_name(os.path.basename(self.path)) self.set_log_category(log.C_TST) self.dir = util.Dir(self.path) -- cgit v1.2.3