mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-06-05 05:20:34 +00:00
system tests: use repository mirrors on S3 for reproducibility
no direct internet download from apt repositories, which over time will change or cease to exist. also migrate to gpg2 on newer ubuntu.
This commit is contained in:
@@ -9,7 +9,7 @@ class MirrorsAPITestCreateShow(APITest):
|
||||
def check(self):
|
||||
mirror_name = self.random_name()
|
||||
mirror_desc = {'Name': mirror_name,
|
||||
'ArchiveURL': 'http://security.debian.org/debian-security/',
|
||||
'ArchiveURL': 'http://repo.aptly.info/system-tests/security.debian.org/debian-security/',
|
||||
'Architectures': ['amd64'],
|
||||
'Components': ['main'],
|
||||
'Distribution': 'buster/updates'}
|
||||
@@ -27,7 +27,7 @@ class MirrorsAPITestCreateShow(APITest):
|
||||
resp = self.get("/api/mirrors/" + mirror_name)
|
||||
self.check_equal(resp.status_code, 200)
|
||||
self.check_subset({'Name': mirror_name,
|
||||
'ArchiveRoot': 'http://security.debian.org/debian-security/',
|
||||
'ArchiveRoot': 'http://repo.aptly.info/system-tests/security.debian.org/debian-security/',
|
||||
'Architectures': ['amd64'],
|
||||
'Components': ['main'],
|
||||
'Distribution': 'buster/updates'}, resp.json())
|
||||
@@ -43,8 +43,10 @@ class MirrorsAPITestCreateUpdate(APITest):
|
||||
def check(self):
|
||||
mirror_name = self.random_name()
|
||||
mirror_desc = {'Name': mirror_name,
|
||||
'ArchiveURL': 'https://packagecloud.io/varnishcache/varnish30/debian/',
|
||||
'ArchiveURL': 'http://repo.aptly.info/system-tests/packagecloud.io/varnishcache/varnish30/debian/',
|
||||
'Distribution': 'wheezy',
|
||||
'Keyrings': ["aptlytest.gpg"],
|
||||
'Architectures': ["amd64"],
|
||||
'Components': ['main']}
|
||||
|
||||
mirror_desc['IgnoreSignatures'] = True
|
||||
@@ -56,9 +58,12 @@ class MirrorsAPITestCreateUpdate(APITest):
|
||||
|
||||
mirror_desc["Name"] = self.random_name()
|
||||
resp = self.put_task("/api/mirrors/" + mirror_name, json=mirror_desc)
|
||||
self.check_equal(resp.json()["State"], TASK_SUCCEEDED)
|
||||
|
||||
self.check_equal(resp.status_code, 200)
|
||||
_id = resp.json()['ID']
|
||||
if resp.json()["State"] != TASK_SUCCEEDED:
|
||||
resp = self.get("/api/tasks/" + str(_id) + "/output")
|
||||
raise Exception("task failed: " + str(resp.json()))
|
||||
|
||||
resp = self.get("/api/tasks/" + str(_id) + "/detail")
|
||||
self.check_equal(resp.status_code, 200)
|
||||
self.check_equal(resp.json()['RemainingDownloadSize'], 0)
|
||||
@@ -67,7 +72,7 @@ class MirrorsAPITestCreateUpdate(APITest):
|
||||
resp = self.get("/api/mirrors/" + mirror_desc["Name"])
|
||||
self.check_equal(resp.status_code, 200)
|
||||
self.check_subset({'Name': mirror_desc["Name"],
|
||||
'ArchiveRoot': 'https://packagecloud.io/varnishcache/varnish30/debian/',
|
||||
'ArchiveRoot': 'http://repo.aptly.info/system-tests/packagecloud.io/varnishcache/varnish30/debian/',
|
||||
'Distribution': 'wheezy'}, resp.json())
|
||||
|
||||
resp = self.get("/api/mirrors/" + mirror_desc["Name"] + "/packages")
|
||||
@@ -81,7 +86,7 @@ class MirrorsAPITestCreateDelete(APITest):
|
||||
def check(self):
|
||||
mirror_name = self.random_name()
|
||||
mirror_desc = {'Name': mirror_name,
|
||||
'ArchiveURL': 'https://packagecloud.io/varnishcache/varnish30/debian/',
|
||||
'ArchiveURL': 'http://repo.aptly.info/system-tests/packagecloud.io/varnishcache/varnish30/debian/',
|
||||
'IgnoreSignatures': True,
|
||||
'Distribution': 'wheezy',
|
||||
'Components': ['main']}
|
||||
@@ -104,7 +109,7 @@ class MirrorsAPITestCreateList(APITest):
|
||||
|
||||
mirror_name = self.random_name()
|
||||
mirror_desc = {'Name': mirror_name,
|
||||
'ArchiveURL': 'https://packagecloud.io/varnishcache/varnish30/debian/',
|
||||
'ArchiveURL': 'http://repo.aptly.info/system-tests/packagecloud.io/varnishcache/varnish30/debian/',
|
||||
'IgnoreSignatures': True,
|
||||
'Distribution': 'wheezy',
|
||||
'Components': ['main']}
|
||||
|
||||
@@ -10,8 +10,9 @@ class TaskAPITestParallelTasks(APITest):
|
||||
def _create_mirror(self, dist):
|
||||
mirror_name = self.random_name()
|
||||
mirror_desc = {'Name': mirror_name,
|
||||
'ArchiveURL': 'https://packagecloud.io/varnishcache/varnish30/debian/',
|
||||
'ArchiveURL': 'http://repo.aptly.info/system-tests/packagecloud.io/varnishcache/varnish30/debian/',
|
||||
'Distribution': dist,
|
||||
'Architectures': ["amd64", "i386"],
|
||||
'Components': ['main']}
|
||||
mirror_desc['IgnoreSignatures'] = True
|
||||
resp = self.post("/api/mirrors", json=mirror_desc)
|
||||
@@ -76,7 +77,7 @@ class TaskAPITestParallelTasks(APITest):
|
||||
def check(self):
|
||||
publish_task_ids = []
|
||||
mirror_task_list = []
|
||||
for mirror_dist in ['squeeze', 'jessie']:
|
||||
for mirror_dist in ['squeeze', 'wheezy']:
|
||||
mirror_task_id, mirror_name = self._create_mirror(mirror_dist)
|
||||
mirror_task_list.append((mirror_task_id, mirror_name))
|
||||
repo_task_id, repo_name = self._create_repo()
|
||||
|
||||
Reference in New Issue
Block a user