mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-06-07 05:42:42 +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:
+45
-34
@@ -1,4 +1,5 @@
|
||||
import re
|
||||
import os
|
||||
|
||||
from lib import BaseTest
|
||||
|
||||
@@ -7,7 +8,7 @@ class CreateMirror1Test(BaseTest):
|
||||
"""
|
||||
create mirror: all architectures + all components
|
||||
"""
|
||||
runCmd = "aptly mirror create --ignore-signatures mirror1 http://archive.debian.org/debian-archive/debian/ stretch"
|
||||
runCmd = "aptly mirror create --ignore-signatures mirror1 http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/ stretch"
|
||||
|
||||
def check(self):
|
||||
self.check_output()
|
||||
@@ -18,7 +19,7 @@ class CreateMirror2Test(BaseTest):
|
||||
"""
|
||||
create mirror: all architectures and 1 component
|
||||
"""
|
||||
runCmd = "aptly mirror create --ignore-signatures mirror2 http://archive.debian.org/debian-archive/debian/ stretch main"
|
||||
runCmd = "aptly mirror create --ignore-signatures mirror2 http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/ stretch main"
|
||||
|
||||
def check(self):
|
||||
self.check_output()
|
||||
@@ -29,7 +30,7 @@ class CreateMirror3Test(BaseTest):
|
||||
"""
|
||||
create mirror: some architectures and 2 components
|
||||
"""
|
||||
runCmd = "aptly -architectures=i386,amd64 mirror create --ignore-signatures mirror3 http://archive.debian.org/debian-archive/debian/ stretch main contrib"
|
||||
runCmd = "aptly -architectures=i386,amd64 mirror create --ignore-signatures mirror3 http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/ stretch main contrib"
|
||||
|
||||
def check(self):
|
||||
self.check_output()
|
||||
@@ -42,7 +43,7 @@ class CreateMirror4Test(BaseTest):
|
||||
"""
|
||||
expectedCode = 1
|
||||
|
||||
runCmd = "aptly -architectures=i386,amd64 mirror create --ignore-signatures mirror4 http://archive.debian.org/debian-archive/debian/ stretch life"
|
||||
runCmd = "aptly -architectures=i386,amd64 mirror create --ignore-signatures mirror4 http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/ stretch life"
|
||||
|
||||
|
||||
class CreateMirror5Test(BaseTest):
|
||||
@@ -51,7 +52,7 @@ class CreateMirror5Test(BaseTest):
|
||||
"""
|
||||
expectedCode = 1
|
||||
|
||||
runCmd = "aptly -architectures=i386,nano68 mirror create --ignore-signatures mirror5 http://archive.debian.org/debian-archive/debian/ stretch"
|
||||
runCmd = "aptly -architectures=i386,nano68 mirror create --ignore-signatures mirror5 http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/ stretch"
|
||||
|
||||
|
||||
class CreateMirror6Test(BaseTest):
|
||||
@@ -59,17 +60,17 @@ class CreateMirror6Test(BaseTest):
|
||||
create mirror: missing release
|
||||
"""
|
||||
expectedCode = 1
|
||||
requiresGPG1 = True
|
||||
requiresGPG2 = True
|
||||
|
||||
configOverride = {"max-tries": 1}
|
||||
runCmd = "aptly mirror create --keyring=aptlytest.gpg mirror6 http://archive.debian.org/debian-archive/debian/ suslik"
|
||||
runCmd = "aptly mirror create --keyring=aptlytest.gpg mirror6 http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/ suslik"
|
||||
|
||||
|
||||
class CreateMirror7Test(BaseTest):
|
||||
"""
|
||||
create mirror: architectures fixed via config file
|
||||
"""
|
||||
runCmd = "aptly mirror create --ignore-signatures mirror7 http://archive.debian.org/debian-archive/debian/ stretch main contrib"
|
||||
runCmd = "aptly mirror create --ignore-signatures mirror7 http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/ stretch main contrib"
|
||||
configOverride = {"architectures": ["i386", "amd64"]}
|
||||
|
||||
def check(self):
|
||||
@@ -82,9 +83,9 @@ class CreateMirror8Test(BaseTest):
|
||||
create mirror: already exists
|
||||
"""
|
||||
fixtureCmds = [
|
||||
"aptly mirror create --ignore-signatures mirror8 http://archive.debian.org/debian-archive/debian/ stretch main contrib"
|
||||
"aptly mirror create --ignore-signatures mirror8 http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/ stretch main contrib"
|
||||
]
|
||||
runCmd = "aptly mirror create --ignore-signatures mirror8 http://archive.debian.org/debian-archive/debian/ stretch main contrib"
|
||||
runCmd = "aptly mirror create --ignore-signatures mirror8 http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/ stretch main contrib"
|
||||
expectedCode = 1
|
||||
|
||||
|
||||
@@ -92,9 +93,9 @@ class CreateMirror9Test(BaseTest):
|
||||
"""
|
||||
create mirror: repo with InRelease verification
|
||||
"""
|
||||
runCmd = "aptly mirror create --keyring=aptlytest.gpg mirror9 http://archive.debian.org/debian-archive/debian/ stretch-backports"
|
||||
runCmd = "aptly mirror create --keyring=aptlytest.gpg mirror9 http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/ stretch-backports"
|
||||
fixtureGpg = True
|
||||
requiresGPG1 = True
|
||||
requiresGPG2 = True
|
||||
|
||||
def outputMatchPrepare(self, s):
|
||||
return re.sub(r'Signature made .* using|Warning: using insecure memory!\n', '', s)
|
||||
@@ -112,7 +113,7 @@ class CreateMirror10Test(BaseTest):
|
||||
"""
|
||||
create mirror: repo with InRelease verification, failure
|
||||
"""
|
||||
runCmd = "aptly mirror create --keyring=aptlytest.gpg mirror10 http://archive.debian.org/debian-archive/debian/ stretch-backports"
|
||||
runCmd = "aptly mirror create --keyring=aptlytest.gpg mirror10 http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/ stretch-backports"
|
||||
fixtureGpg = False
|
||||
gold_processor = BaseTest.expand_environ
|
||||
expectedCode = 1
|
||||
@@ -126,7 +127,7 @@ class CreateMirror11Test(BaseTest):
|
||||
create mirror: repo with Release + Release.gpg verification
|
||||
"""
|
||||
configOverride = {"max-tries": 1}
|
||||
runCmd = "aptly mirror create --keyring=aptlytest.gpg mirror11 http://archive.debian.org/debian-archive/debian/ stretch"
|
||||
runCmd = "aptly mirror create --keyring=aptlytest.gpg mirror11 http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/ stretch"
|
||||
fixtureGpg = True
|
||||
|
||||
def outputMatchPrepare(self, s):
|
||||
@@ -142,7 +143,7 @@ class CreateMirror12Test(BaseTest):
|
||||
create mirror: repo with Release+Release.gpg verification, failure
|
||||
"""
|
||||
configOverride = {"max-tries": 1}
|
||||
runCmd = "aptly mirror create --keyring=aptlytest.gpg mirror12 http://archive.debian.org/debian-archive/debian/ stretch"
|
||||
runCmd = "aptly mirror create --keyring=aptlytest.gpg mirror12 http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/ stretch"
|
||||
fixtureGpg = False
|
||||
gold_processor = BaseTest.expand_environ
|
||||
expectedCode = 1
|
||||
@@ -155,7 +156,7 @@ class CreateMirror13Test(BaseTest):
|
||||
"""
|
||||
create mirror: skip verification using config file
|
||||
"""
|
||||
runCmd = "aptly mirror create mirror13 http://archive.debian.org/debian-archive/debian/ stretch"
|
||||
runCmd = "aptly mirror create mirror13 http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/ stretch"
|
||||
configOverride = {"gpgDisableVerify": True}
|
||||
|
||||
def check(self):
|
||||
@@ -167,7 +168,7 @@ class CreateMirror14Test(BaseTest):
|
||||
"""
|
||||
create mirror: flat repository
|
||||
"""
|
||||
runCmd = "aptly mirror create -keyring=aptlytest.gpg mirror14 https://cloud.r-project.org/bin/linux/debian bullseye-cran40/"
|
||||
runCmd = "aptly mirror create -keyring=aptlytest.gpg mirror14 http://repo.aptly.info/system-tests/cloud.r-project.org/bin/linux/debian bullseye-cran40/"
|
||||
fixtureGpg = True
|
||||
|
||||
def outputMatchPrepare(self, s):
|
||||
@@ -186,7 +187,7 @@ class CreateMirror15Test(BaseTest):
|
||||
"""
|
||||
create mirror: flat repository + components
|
||||
"""
|
||||
runCmd = "aptly mirror create -keyring=aptlytest.gpg mirror14 https://cloud.r-project.org/bin/linux/debian bullseye-cran40/ main"
|
||||
runCmd = "aptly mirror create -keyring=aptlytest.gpg mirror14 http://repo.aptly.info/system-tests/cloud.r-project.org/bin/linux/debian bullseye-cran40/ main"
|
||||
expectedCode = 1
|
||||
|
||||
|
||||
@@ -196,14 +197,14 @@ class CreateMirror16Test(BaseTest):
|
||||
"""
|
||||
expectedCode = 1
|
||||
|
||||
runCmd = "aptly -architectures=source mirror create -ignore-signatures mirror16 http://archive.debian.org/debian-archive/debian/ stretch"
|
||||
runCmd = "aptly -architectures=source mirror create -ignore-signatures mirror16 http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/ stretch"
|
||||
|
||||
|
||||
class CreateMirror17Test(BaseTest):
|
||||
"""
|
||||
create mirror: mirror with sources enabled
|
||||
"""
|
||||
runCmd = "aptly -architectures=i386 mirror create -ignore-signatures -with-sources mirror17 http://archive.debian.org/debian-archive/debian/ stretch"
|
||||
runCmd = "aptly -architectures=i386 mirror create -ignore-signatures -with-sources mirror17 http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/ stretch"
|
||||
|
||||
def check(self):
|
||||
self.check_output()
|
||||
@@ -237,7 +238,7 @@ class CreateMirror19Test(BaseTest):
|
||||
"""
|
||||
fixtureGpg = True
|
||||
|
||||
runCmd = "aptly -architectures='i386' mirror create -keyring=aptlytest.gpg -with-sources mirror19 http://archive.debian.org/debian-security/ stretch/updates main"
|
||||
runCmd = "aptly -architectures='i386' mirror create -keyring=aptlytest.gpg -with-sources mirror19 http://repo.aptly.info/system-tests/archive.debian.org/debian-security/ stretch/updates main"
|
||||
|
||||
def outputMatchPrepare(self, s):
|
||||
return re.sub(r'Signature made .* using', '', s)
|
||||
@@ -258,7 +259,7 @@ class CreateMirror20Test(BaseTest):
|
||||
fixtureGpg = True
|
||||
configOverride = {"max-tries": 1}
|
||||
|
||||
runCmd = "aptly -architectures='i386' mirror create -keyring=aptlytest.gpg -with-sources mirror20 http://archive.debian.org/debian-security/ stretch/updates main"
|
||||
runCmd = "aptly -architectures='i386' mirror create -keyring=aptlytest.gpg -with-sources mirror20 http://repo.aptly.info/system-tests/archive.debian.org/debian-security/ stretch/updates main"
|
||||
environmentOverride = {"HTTP_PROXY": "127.0.0.1:3137"}
|
||||
expectedCode = 1
|
||||
|
||||
@@ -270,8 +271,8 @@ class CreateMirror20Test(BaseTest):
|
||||
).replace(
|
||||
'proxyconnect tcp', 'http: error connecting to proxy http://127.0.0.1:3137'
|
||||
).replace(
|
||||
'Get http://archive.debian.org/debian-security/dists/stretch/updates/Release:',
|
||||
'Get "http://archive.debian.org/debian-security/dists/stretch/updates/Release":'
|
||||
'Get http://repo.aptly.info/system-tests/archive.debian.org/debian-security/dists/stretch/updates/Release:',
|
||||
'Get "http://repo.aptly.info/system-tests/archive.debian.org/debian-security/dists/stretch/updates/Release":'
|
||||
)
|
||||
|
||||
|
||||
@@ -280,7 +281,7 @@ class CreateMirror21Test(BaseTest):
|
||||
create mirror: flat repository in subdir
|
||||
"""
|
||||
configOverride = {"max-tries": 1}
|
||||
runCmd = "aptly mirror create -keyring=aptlytest.gpg mirror21 http://pkg.jenkins-ci.org/debian-stable binary/"
|
||||
runCmd = "aptly mirror create -keyring=aptlytest.gpg mirror21 http://repo.aptly.info/system-tests/pkg.jenkins.io/debian-stable binary/"
|
||||
fixtureGpg = True
|
||||
|
||||
def outputMatchPrepare(self, s):
|
||||
@@ -302,7 +303,7 @@ class CreateMirror22Test(BaseTest):
|
||||
"""
|
||||
create mirror: mirror with filter
|
||||
"""
|
||||
runCmd = "aptly mirror create -ignore-signatures -filter='nginx | Priority (required)' mirror22 http://archive.debian.org/debian-security/ stretch/updates main"
|
||||
runCmd = "aptly mirror create -ignore-signatures -filter='nginx | Priority (required)' mirror22 http://repo.aptly.info/system-tests/archive.debian.org/debian-security/ stretch/updates main"
|
||||
|
||||
def check(self):
|
||||
def removeDates(s):
|
||||
@@ -317,7 +318,7 @@ class CreateMirror23Test(BaseTest):
|
||||
"""
|
||||
create mirror: mirror with wrong filter
|
||||
"""
|
||||
runCmd = "aptly mirror create -ignore-signatures -filter='nginx | ' mirror23 http://archive.debian.org/debian-security/ stretch/updates main"
|
||||
runCmd = "aptly mirror create -ignore-signatures -filter='nginx | ' mirror23 http://repo.aptly.info/system-tests/archive.debian.org/debian-security/ stretch/updates main"
|
||||
expectedCode = 1
|
||||
|
||||
|
||||
@@ -325,7 +326,7 @@ class CreateMirror24Test(BaseTest):
|
||||
"""
|
||||
create mirror: disable config value with option
|
||||
"""
|
||||
runCmd = "aptly mirror create -ignore-signatures=false -keyring=aptlytest.gpg mirror24 http://archive.debian.org/debian-security/ stretch/updates main"
|
||||
runCmd = "aptly mirror create -ignore-signatures=false -keyring=aptlytest.gpg mirror24 http://repo.aptly.info/system-tests/archive.debian.org/debian-security/ stretch/updates main"
|
||||
fixtureGpg = True
|
||||
|
||||
def outputMatchPrepare(self, s):
|
||||
@@ -340,7 +341,7 @@ class CreateMirror25Test(BaseTest):
|
||||
"""
|
||||
create mirror: mirror with udebs enabled
|
||||
"""
|
||||
runCmd = "aptly -architectures=i386 mirror create -ignore-signatures -with-udebs mirror25 http://archive.debian.org/debian-archive/debian/ stretch"
|
||||
runCmd = "aptly -architectures=i386 mirror create -ignore-signatures -with-udebs mirror25 http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/ stretch"
|
||||
|
||||
def check(self):
|
||||
self.check_output()
|
||||
@@ -351,7 +352,7 @@ class CreateMirror26Test(BaseTest):
|
||||
"""
|
||||
create mirror: flat mirror with udebs
|
||||
"""
|
||||
runCmd = "aptly mirror create -keyring=aptlytest.gpg -with-udebs mirror26 http://pkg.jenkins-ci.org/debian-stable binary/"
|
||||
runCmd = "aptly mirror create -keyring=aptlytest.gpg -with-udebs mirror26 http://repo.aptly.info/system-tests/pkg.jenkins.io/debian-stable binary/"
|
||||
fixtureGpg = True
|
||||
expectedCode = 1
|
||||
|
||||
@@ -374,19 +375,24 @@ class CreateMirror29Test(BaseTest):
|
||||
"""
|
||||
create mirror: repo with InRelease verification (internal GPG implementation)
|
||||
"""
|
||||
runCmd = "aptly mirror create --keyring=aptlytest.gpg mirror9 http://archive.debian.org/debian-archive/debian/ stretch-backports"
|
||||
fixtureCmds = ["gpg --no-default-keyring --keyring aptlytest.gpg --export-options export-minimal --export -o " + os.path.join(
|
||||
os.environ["HOME"], ".gnupg/aptlytest-gpg1.gpg")]
|
||||
runCmd = "aptly mirror create --keyring=aptlytest-gpg1.gpg mirror9 http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/ stretch-backports"
|
||||
configOverride = {"gpgProvider": "internal"}
|
||||
fixtureGpg = True
|
||||
|
||||
def outputMatchPrepare(self, s):
|
||||
return re.sub(r'Signature made .* using', '', s)
|
||||
|
||||
def teardown(self):
|
||||
self.run_cmd(["rm", "-f", os.path.join(os.environ["HOME"], ".gnupg/aptlytest-gpg1.gpg")])
|
||||
|
||||
|
||||
class CreateMirror30Test(BaseTest):
|
||||
"""
|
||||
create mirror: repo with InRelease verification, failure (internal GPG implementation)
|
||||
"""
|
||||
runCmd = "aptly mirror create --keyring=aptlytest.gpg mirror10 http://archive.debian.org/debian-archive/debian/ stretch"
|
||||
runCmd = "aptly mirror create --keyring=aptlytest.gpg mirror10 http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/ stretch"
|
||||
configOverride = {"gpgProvider": "internal", "max-tries": 1}
|
||||
gold_processor = BaseTest.expand_environ
|
||||
fixtureGpg = False
|
||||
@@ -400,20 +406,25 @@ class CreateMirror31Test(BaseTest):
|
||||
"""
|
||||
create mirror: repo with Release + Release.gpg verification (internal GPG implementation)
|
||||
"""
|
||||
runCmd = "aptly mirror create --keyring=aptlytest.gpg mirror11 http://archive.debian.org/debian-archive/debian/ stretch"
|
||||
fixtureCmds = ["gpg --no-default-keyring --keyring aptlytest.gpg --export-options export-minimal --export -o " + os.path.join(
|
||||
os.environ["HOME"], ".gnupg/aptlytest-gpg1.gpg")]
|
||||
runCmd = "aptly mirror create --keyring=aptlytest-gpg1.gpg mirror11 http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/ stretch"
|
||||
configOverride = {"gpgProvider": "internal", "max-tries": 1}
|
||||
fixtureGpg = True
|
||||
|
||||
def outputMatchPrepare(self, s):
|
||||
return re.sub(r'Signature made .* using', '', s)
|
||||
|
||||
def teardown(self):
|
||||
self.run_cmd(["rm", "-f", os.path.join(os.environ["HOME"], ".gnupg/aptlytest-gpg1.gpg")])
|
||||
|
||||
|
||||
class CreateMirror32Test(BaseTest):
|
||||
"""
|
||||
create mirror: repo with Release + Release.gpg verification (gpg2)
|
||||
"""
|
||||
configOverride = {"max-tries": 1}
|
||||
runCmd = "aptly mirror create --keyring=aptlytest.gpg mirror32 http://archive.debian.org/debian-archive/debian/ stretch"
|
||||
runCmd = "aptly mirror create --keyring=aptlytest.gpg mirror32 http://repo.aptly.info/system-tests/archive.debian.org/debian-archive/debian/ stretch"
|
||||
fixtureGpg = True
|
||||
requiresGPG2 = True
|
||||
|
||||
|
||||
Reference in New Issue
Block a user