os.path.join(options.unstable, 'autopkgtest') isn't writable in the Debian setup and we have options.state_dir already

ubuntu/rebased
Paul Gevers 7 years ago
parent eb60fc557e
commit 287a9d328c
No known key found for this signature in database
GPG Key ID: 9C5C99EB05BD750A

@ -62,11 +62,10 @@ class AutopkgtestPolicy(BasePolicy):
def __init__(self, options, suite_info):
super().__init__('autopkgtest', options, suite_info, {'unstable'})
self.test_state_dir = os.path.join(options.unstable, 'autopkgtest')
# tests requested in this and previous runs
# trigger -> src -> [arch]
self.pending_tests = None
self.pending_tests_file = os.path.join(self.test_state_dir, 'pending.json')
self.pending_tests_file = os.path.join(self.options.state_dir, 'pending.json')
# results map: trigger -> src -> arch -> [passed, version, run_id]
# - trigger is "source/version" of an unstable package that triggered
@ -81,7 +80,7 @@ class AutopkgtestPolicy(BasePolicy):
if self.options.adt_shared_results_cache:
self.results_cache_file = self.options.adt_shared_results_cache
else:
self.results_cache_file = os.path.join(self.test_state_dir, 'results.cache')
self.results_cache_file = os.path.join(self.options.state_dir, 'results.cache')
try:
self.options.adt_ppas = self.options.adt_ppas.strip().split()
@ -106,7 +105,7 @@ class AutopkgtestPolicy(BasePolicy):
def initialise(self, britney):
super().initialise(britney)
os.makedirs(self.test_state_dir, exist_ok=True)
os.makedirs(self.options.state_dir, exist_ok=True)
self.read_pending_tests()
# read the cached results that we collected so far

@ -152,7 +152,7 @@ class T(TestBase):
pass
try:
with open(os.path.join(self.data.path, 'data/unstable/autopkgtest/pending.json')) as f:
with open(os.path.join(self.data.path, 'data/testing/state/pending.json')) as f:
self.pending_requests = json.load(f)
except IOError:
self.pending_requests = None
@ -368,7 +368,7 @@ class T(TestBase):
self.assertNotIn('Failure', out, out)
# caches the results and triggers
with open(os.path.join(self.data.path, 'data/unstable/autopkgtest/results.cache')) as f:
with open(os.path.join(self.data.path, 'data/testing/state/results.cache')) as f:
res = json.load(f)
self.assertEqual(res['green/1']['green']['amd64'],
[False, '1', '20150101_020000@'])
@ -1378,7 +1378,7 @@ class T(TestBase):
self.do_test(
[],
{'lightgreen': (False, {'lightgreen/2': {'amd64': 'REGRESSION', 'i386': 'RUNNING'}})})
with open(os.path.join(self.data.path, 'data/unstable/autopkgtest/results.cache')) as f:
with open(os.path.join(self.data.path, 'data/testing/state/results.cache')) as f:
contents = f.read()
self.assertNotIn('null', contents)
self.assertNotIn('None', contents)
@ -2303,7 +2303,7 @@ class T(TestBase):
)
# move and remember original contents
local_path = os.path.join(self.data.path, 'data/unstable/autopkgtest/results.cache')
local_path = os.path.join(self.data.path, 'data/testing/state/results.cache')
shared_path = os.path.join(self.data.path, 'shared_results.cache')
os.rename(local_path, shared_path)
with open(shared_path) as f:

Loading…
Cancel
Save