mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-07-15 11:57:59 +00:00
New upstream version 1.5.0+ds1
This commit is contained in:
+76
-64
@@ -10,18 +10,21 @@ def filterOutSignature(_, s):
|
||||
return re.sub(r'Signature made .* using', '', s)
|
||||
|
||||
|
||||
def filterOutRedirects(_, s):
|
||||
return re.sub(r'Following redirect to .+?\n', '', s)
|
||||
|
||||
|
||||
class UpdateMirror1Test(BaseTest):
|
||||
"""
|
||||
update mirrors: regular update
|
||||
"""
|
||||
sortOutput = True
|
||||
longTest = False
|
||||
fixtureCmds = [
|
||||
"aptly -architectures=i386,amd64 mirror create --ignore-signatures varnish https://packagecloud.io/varnishcache/varnish30/debian/ wheezy main",
|
||||
]
|
||||
runCmd = "aptly mirror update --ignore-signatures varnish"
|
||||
|
||||
def output_processor(self, output):
|
||||
return "\n".join(sorted(output.split("\n")))
|
||||
outputMatchPrepare = filterOutRedirects
|
||||
|
||||
|
||||
class UpdateMirror2Test(BaseTest):
|
||||
@@ -40,6 +43,9 @@ class UpdateMirror3Test(BaseTest):
|
||||
"aptly mirror create --ignore-signatures failure ${url} hardy main",
|
||||
]
|
||||
fixtureWebServer = "test_release"
|
||||
configOverride = {
|
||||
"downloadRetries": 0,
|
||||
}
|
||||
runCmd = "aptly mirror update --ignore-signatures failure"
|
||||
expectedCode = 1
|
||||
|
||||
@@ -55,6 +61,9 @@ class UpdateMirror4Test(BaseTest):
|
||||
"aptly mirror create --ignore-signatures failure ${url} hardy main",
|
||||
]
|
||||
fixtureWebServer = "test_release"
|
||||
configOverride = {
|
||||
"downloadRetries": 0,
|
||||
}
|
||||
runCmd = "aptly mirror update -ignore-checksums --ignore-signatures failure"
|
||||
expectedCode = 1
|
||||
|
||||
@@ -70,6 +79,9 @@ class UpdateMirror5Test(BaseTest):
|
||||
"aptly mirror create --ignore-signatures failure ${url} hardy main",
|
||||
]
|
||||
fixtureWebServer = "test_release2"
|
||||
configOverride = {
|
||||
"downloadRetries": 0,
|
||||
}
|
||||
runCmd = "aptly mirror update --ignore-signatures failure"
|
||||
expectedCode = 1
|
||||
|
||||
@@ -85,6 +97,10 @@ class UpdateMirror6Test(BaseTest):
|
||||
"aptly mirror create --ignore-signatures failure ${url} hardy main",
|
||||
]
|
||||
fixtureWebServer = "test_release2"
|
||||
configOverride = {
|
||||
"downloadRetries": 0,
|
||||
}
|
||||
|
||||
runCmd = "aptly mirror update -ignore-checksums --ignore-signatures failure"
|
||||
|
||||
def gold_processor(self, gold):
|
||||
@@ -95,6 +111,7 @@ class UpdateMirror7Test(BaseTest):
|
||||
"""
|
||||
update mirrors: flat repository
|
||||
"""
|
||||
sortOutput = True
|
||||
fixtureGpg = True
|
||||
fixtureCmds = [
|
||||
"aptly mirror create --keyring=aptlytest.gpg -architectures=amd64 flat https://cloud.r-project.org/bin/linux/debian jessie-cran35/",
|
||||
@@ -102,14 +119,13 @@ class UpdateMirror7Test(BaseTest):
|
||||
runCmd = "aptly mirror update --keyring=aptlytest.gpg flat"
|
||||
outputMatchPrepare = filterOutSignature
|
||||
|
||||
def output_processor(self, output):
|
||||
return "\n".join(sorted(output.split("\n")))
|
||||
|
||||
|
||||
class UpdateMirror8Test(BaseTest):
|
||||
"""
|
||||
update mirrors: with sources (already in pool)
|
||||
"""
|
||||
configOverride = {"max-tries": 1}
|
||||
|
||||
fixtureGpg = True
|
||||
fixturePool = True
|
||||
fixtureCmds = [
|
||||
@@ -123,6 +139,7 @@ class UpdateMirror9Test(BaseTest):
|
||||
"""
|
||||
update mirrors: flat repository + sources
|
||||
"""
|
||||
sortOutput = True
|
||||
fixtureGpg = True
|
||||
fixtureCmds = [
|
||||
"aptly mirror create --keyring=aptlytest.gpg -with-sources flat-src https://cloud.r-project.org/bin/linux/debian jessie-cran35/",
|
||||
@@ -130,14 +147,12 @@ class UpdateMirror9Test(BaseTest):
|
||||
runCmd = "aptly mirror update --keyring=aptlytest.gpg flat-src"
|
||||
outputMatchPrepare = filterOutSignature
|
||||
|
||||
def output_processor(self, output):
|
||||
return "\n".join(sorted(output.split("\n")))
|
||||
|
||||
|
||||
class UpdateMirror10Test(BaseTest):
|
||||
"""
|
||||
update mirrors: filtered
|
||||
"""
|
||||
sortOutput = True
|
||||
fixtureGpg = True
|
||||
fixtureCmds = [
|
||||
"aptly mirror create -keyring=aptlytest.gpg -with-sources -filter='!(Name (% r-*)), !($$PackageType (source))' flat-src https://cloud.r-project.org/bin/linux/debian jessie-cran35/",
|
||||
@@ -145,89 +160,88 @@ class UpdateMirror10Test(BaseTest):
|
||||
runCmd = "aptly mirror update --keyring=aptlytest.gpg flat-src"
|
||||
outputMatchPrepare = filterOutSignature
|
||||
|
||||
def output_processor(self, output):
|
||||
return "\n".join(sorted(output.split("\n")))
|
||||
|
||||
|
||||
class UpdateMirror11Test(BaseTest):
|
||||
"""
|
||||
update mirrors: update over FTP
|
||||
"""
|
||||
configOverride = {"max-tries": 1}
|
||||
sortOutput = True
|
||||
longTest = False
|
||||
fixtureGpg = True
|
||||
requiresFTP = True
|
||||
fixtureCmds = [
|
||||
"aptly mirror create -keyring=aptlytest.gpg -filter='Priority (required), Name (% s*)' -architectures=i386 stretch-main ftp://ftp.ru.debian.org/debian/ stretch main",
|
||||
"aptly mirror create -keyring=aptlytest.gpg -filter='Priority (required), Name (% s*)' "
|
||||
"-architectures=i386 stretch-main https://snapshot.debian.org/archive/debian/20220201T025006Z/ stretch main",
|
||||
]
|
||||
outputMatchPrepare = filterOutSignature
|
||||
runCmd = "aptly mirror update -keyring=aptlytest.gpg stretch-main"
|
||||
|
||||
def output_processor(self, output):
|
||||
return "\n".join(sorted(output.split("\n")))
|
||||
|
||||
|
||||
class UpdateMirror12Test(BaseTest):
|
||||
"""
|
||||
update mirrors: update with udebs
|
||||
"""
|
||||
configOverride = {"max-tries": 1}
|
||||
sortOutput = True
|
||||
longTest = False
|
||||
fixtureGpg = True
|
||||
fixtureCmds = [
|
||||
"aptly -architectures=i386,amd64 mirror create -keyring=aptlytest.gpg -filter='$$Source (gnupg2)' -with-udebs stretch http://mirror.yandex.ru/debian/ stretch main non-free",
|
||||
"aptly -architectures=i386,amd64 mirror create -keyring=aptlytest.gpg -filter='$$Source (gnupg2)' -with-udebs stretch http://cdn-fastly.deb.debian.org/debian/ stretch main non-free",
|
||||
]
|
||||
runCmd = "aptly mirror update -keyring=aptlytest.gpg stretch"
|
||||
outputMatchPrepare = filterOutSignature
|
||||
|
||||
def output_processor(self, output):
|
||||
return "\n".join(sorted(output.split("\n")))
|
||||
|
||||
|
||||
class UpdateMirror13Test(BaseTest):
|
||||
"""
|
||||
update mirrors: regular update with --skip-existing-packages option
|
||||
"""
|
||||
sortOutput = True
|
||||
longTest = False
|
||||
fixtureCmds = [
|
||||
"aptly -architectures=i386,amd64 mirror create --ignore-signatures varnish https://packagecloud.io/varnishcache/varnish30/debian/ wheezy main",
|
||||
]
|
||||
runCmd = "aptly mirror update --ignore-signatures --skip-existing-packages varnish"
|
||||
|
||||
def output_processor(self, output):
|
||||
return "\n".join(sorted(output.split("\n")))
|
||||
outputMatchPrepare = filterOutRedirects
|
||||
|
||||
|
||||
class UpdateMirror14Test(BaseTest):
|
||||
"""
|
||||
update mirrors: regular update with --skip-existing-packages option
|
||||
"""
|
||||
sortOutput = True
|
||||
longTest = False
|
||||
fixtureCmds = [
|
||||
"aptly -architectures=i386,amd64 mirror create --ignore-signatures varnish https://packagecloud.io/varnishcache/varnish30/debian/ wheezy main",
|
||||
"aptly mirror update --ignore-signatures --skip-existing-packages varnish"
|
||||
]
|
||||
runCmd = "aptly mirror update --ignore-signatures --skip-existing-packages varnish"
|
||||
|
||||
def output_processor(self, output):
|
||||
return "\n".join(sorted(output.split("\n")))
|
||||
outputMatchPrepare = filterOutRedirects
|
||||
|
||||
|
||||
class UpdateMirror15Test(BaseTest):
|
||||
"""
|
||||
update mirrors: update for mirror without MD5 checksums
|
||||
"""
|
||||
# TODO spin up a Python server to serve that data from fixtures directory, instead of using bintray
|
||||
# e.g. python3 -m http.server --directory src/aptly/system/t04_mirror/test_release/
|
||||
# but that fixture seems to have the wrong hashes...
|
||||
skipTest = "Using deprecated service - bintray"
|
||||
sortOutput = True
|
||||
longTest = False
|
||||
fixtureCmds = [
|
||||
"aptly mirror create --ignore-signatures bintray https://dl.bintray.com/smira/deb/ ./",
|
||||
# TODO note the ./ is "flat" whereas putting "hardy" looks into dists/hardy
|
||||
# "aptly mirror create --ignore-signatures bintray http://localhost:8000/ hardy",
|
||||
]
|
||||
runCmd = "aptly mirror update --ignore-signatures bintray"
|
||||
|
||||
def output_processor(self, output):
|
||||
return "\n".join(sorted(output.split("\n")))
|
||||
|
||||
def check(self):
|
||||
super(UpdateMirror15Test, self).check()
|
||||
# check pool
|
||||
self.check_exists('pool/c7/6b/4bd12fd92e4dfe1b55b18a67a669_libboost-program-options-dev_1.49.0.1_i386.deb')
|
||||
self.check_exists(
|
||||
'pool/c7/6b/4bd12fd92e4dfe1b55b18a67a669_libboost-program-options-dev_1.49.0.1_i386.deb')
|
||||
|
||||
|
||||
class UpdateMirror16Test(BaseTest):
|
||||
@@ -236,19 +250,19 @@ class UpdateMirror16Test(BaseTest):
|
||||
|
||||
as mirror lacks MD5 checksum, file would be downloaded but not re-imported
|
||||
"""
|
||||
skipTest = "Using deprecated service - bintray"
|
||||
sortOutput = True
|
||||
longTest = False
|
||||
fixtureCmds = [
|
||||
"aptly mirror create --ignore-signatures bintray https://dl.bintray.com/smira/deb/ ./",
|
||||
]
|
||||
runCmd = "aptly mirror update --ignore-signatures bintray"
|
||||
|
||||
def output_processor(self, output):
|
||||
return "\n".join(sorted(output.split("\n")))
|
||||
|
||||
def prepare(self):
|
||||
super(UpdateMirror16Test, self).prepare()
|
||||
|
||||
os.makedirs(os.path.join(os.environ["HOME"], ".aptly", "pool", "00", "35"))
|
||||
os.makedirs(os.path.join(
|
||||
os.environ["HOME"], ".aptly", "pool", "00", "35"))
|
||||
|
||||
shutil.copy(os.path.join(os.path.dirname(inspect.getsourcefile(BaseTest)), "files", "libboost-program-options-dev_1.49.0.1_i386.deb"),
|
||||
os.path.join(os.environ["HOME"], ".aptly", "pool", "00", "35"))
|
||||
@@ -256,26 +270,26 @@ class UpdateMirror16Test(BaseTest):
|
||||
def check(self):
|
||||
super(UpdateMirror16Test, self).check()
|
||||
# check pool
|
||||
self.check_not_exists('pool/c7/6b/4bd12fd92e4dfe1b55b18a67a669_libboost-program-options-dev_1.49.0.1_i386.deb')
|
||||
self.check_not_exists(
|
||||
'pool/c7/6b/4bd12fd92e4dfe1b55b18a67a669_libboost-program-options-dev_1.49.0.1_i386.deb')
|
||||
|
||||
|
||||
class UpdateMirror17Test(BaseTest):
|
||||
"""
|
||||
update mirrors: update for mirror but with file in pool on legacy MD5 location
|
||||
"""
|
||||
sortOutput = True
|
||||
longTest = False
|
||||
fixtureCmds = [
|
||||
"aptly mirror create -ignore-signatures -architectures=i386 -filter=libboost-program-options-dev stretch http://mirror.yandex.ru/debian stretch main",
|
||||
"aptly mirror create -ignore-signatures -architectures=i386 -filter=libboost-program-options-dev stretch http://cdn-fastly.deb.debian.org/debian stretch main",
|
||||
]
|
||||
runCmd = "aptly mirror update -ignore-signatures stretch"
|
||||
|
||||
def output_processor(self, output):
|
||||
return "\n".join(sorted(output.split("\n")))
|
||||
|
||||
def prepare(self):
|
||||
super(UpdateMirror17Test, self).prepare()
|
||||
|
||||
os.makedirs(os.path.join(os.environ["HOME"], ".aptly", "pool", "e0", "bb"))
|
||||
os.makedirs(os.path.join(
|
||||
os.environ["HOME"], ".aptly", "pool", "e0", "bb"))
|
||||
|
||||
shutil.copy(os.path.join(os.path.dirname(inspect.getsourcefile(BaseTest)), "files", "libboost-program-options-dev_1.62.0.1_i386.deb"),
|
||||
os.path.join(os.environ["HOME"], ".aptly", "pool", "e0", "bb"))
|
||||
@@ -283,27 +297,27 @@ class UpdateMirror17Test(BaseTest):
|
||||
def check(self):
|
||||
super(UpdateMirror17Test, self).check()
|
||||
# check pool
|
||||
self.check_not_exists('pool/db/a2/f225645a2a8bd8378e2f64bd1faa_libboost-program-options-dev_1.62.0.1_i386.deb')
|
||||
self.check_not_exists(
|
||||
'pool/db/a2/f225645a2a8bd8378e2f64bd1faa_libboost-program-options-dev_1.62.0.1_i386.deb')
|
||||
|
||||
|
||||
class UpdateMirror18Test(BaseTest):
|
||||
"""
|
||||
update mirrors: update for mirror but with file in pool on legacy MD5 location and disabled legacy path support
|
||||
"""
|
||||
sortOutput = True
|
||||
longTest = False
|
||||
fixtureCmds = [
|
||||
"aptly mirror create -ignore-signatures -architectures=i386 -filter=libboost-program-options-dev stretch http://mirror.yandex.ru/debian stretch main",
|
||||
"aptly mirror create -ignore-signatures -architectures=i386 -filter=libboost-program-options-dev stretch http://cdn-fastly.deb.debian.org/debian stretch main",
|
||||
]
|
||||
runCmd = "aptly mirror update -ignore-signatures stretch"
|
||||
configOverride = {'skipLegacyPool': True}
|
||||
|
||||
def output_processor(self, output):
|
||||
return "\n".join(sorted(output.split("\n")))
|
||||
|
||||
def prepare(self):
|
||||
super(UpdateMirror18Test, self).prepare()
|
||||
|
||||
os.makedirs(os.path.join(os.environ["HOME"], ".aptly", "pool", "e0", "bb"))
|
||||
os.makedirs(os.path.join(
|
||||
os.environ["HOME"], ".aptly", "pool", "e0", "bb"))
|
||||
|
||||
shutil.copy(os.path.join(os.path.dirname(inspect.getsourcefile(BaseTest)), "files", "libboost-program-options-dev_1.62.0.1_i386.deb"),
|
||||
os.path.join(os.environ["HOME"], ".aptly", "pool", "e0", "bb"))
|
||||
@@ -311,56 +325,56 @@ class UpdateMirror18Test(BaseTest):
|
||||
def check(self):
|
||||
super(UpdateMirror18Test, self).check()
|
||||
# check pool
|
||||
self.check_exists('pool/db/a2/f225645a2a8bd8378e2f64bd1faa_libboost-program-options-dev_1.62.0.1_i386.deb')
|
||||
self.check_exists(
|
||||
'pool/db/a2/f225645a2a8bd8378e2f64bd1faa_libboost-program-options-dev_1.62.0.1_i386.deb')
|
||||
|
||||
|
||||
class UpdateMirror19Test(BaseTest):
|
||||
"""
|
||||
update mirrors: correct matching of Release checksums
|
||||
"""
|
||||
configOverride = {"max-tries": 1}
|
||||
longTest = False
|
||||
fixtureGpg = True
|
||||
fixtureCmds = [
|
||||
"aptly mirror create --keyring=aptlytest.gpg pagerduty http://packages.pagerduty.com/pdagent deb/"
|
||||
"aptly mirror create --keyring=aptlytest.gpg pagerduty https://packages.pagerduty.com/pdagent deb/"
|
||||
]
|
||||
runCmd = "aptly mirror update --keyring=aptlytest.gpg pagerduty"
|
||||
outputMatchPrepare = filterOutSignature
|
||||
|
||||
def output_processor(self, output):
|
||||
return "\n".join(line for line in output.split("\n") if ".deb" not in line)
|
||||
return "\n".join(line for line in self.ensure_utf8(output).split("\n") if ".deb" not in line)
|
||||
|
||||
|
||||
class UpdateMirror20Test(BaseTest):
|
||||
"""
|
||||
update mirrors: flat repository (internal GPG implementation)
|
||||
"""
|
||||
sortOutput = True
|
||||
fixtureGpg = True
|
||||
fixtureCmds = [
|
||||
"aptly mirror create --keyring=aptlytest.gpg -architectures=amd64 flat https://cloud.r-project.org/bin/linux/debian jessie-cran35/",
|
||||
"aptly mirror create --keyring=aptlytest.gpg -architectures=amd64 --filter='r-cran-class' flat https://cloud.r-project.org/bin/linux/debian jessie-cran35/",
|
||||
]
|
||||
configOverride = {"gpgProvider": "internal"}
|
||||
runCmd = "aptly mirror update --keyring=aptlytest.gpg flat"
|
||||
outputMatchPrepare = filterOutSignature
|
||||
|
||||
def output_processor(self, output):
|
||||
return "\n".join(sorted(output.split("\n")))
|
||||
|
||||
|
||||
class UpdateMirror21Test(BaseTest):
|
||||
"""
|
||||
update mirrors: correct matching of Release checksums (internal pgp implementation)
|
||||
"""
|
||||
longTest = False
|
||||
configOverride = {"gpgProvider": "internal"}
|
||||
configOverride = {"gpgProvider": "internal", "max-tries": 1}
|
||||
fixtureGpg = True
|
||||
fixtureCmds = [
|
||||
"aptly mirror create --keyring=aptlytest.gpg pagerduty http://packages.pagerduty.com/pdagent deb/"
|
||||
"aptly mirror create --keyring=aptlytest.gpg pagerduty https://packages.pagerduty.com/pdagent deb/"
|
||||
]
|
||||
runCmd = "aptly mirror update --keyring=aptlytest.gpg pagerduty"
|
||||
outputMatchPrepare = filterOutSignature
|
||||
|
||||
def output_processor(self, output):
|
||||
return "\n".join(line for line in output.split("\n") if ".deb" not in line)
|
||||
return "\n".join(line for line in self.ensure_utf8(output).split("\n") if ".deb" not in line)
|
||||
|
||||
|
||||
class UpdateMirror22Test(BaseTest):
|
||||
@@ -382,29 +396,27 @@ class UpdateMirror23Test(BaseTest):
|
||||
"""
|
||||
update mirrors: update with installer
|
||||
"""
|
||||
configOverride = {"max-tries": 1}
|
||||
sortOutput = True
|
||||
longTest = False
|
||||
fixtureGpg = True
|
||||
fixtureCmds = [
|
||||
"aptly -architectures=s390x mirror create -keyring=aptlytest.gpg -filter='installer' -with-installer stretch http://mirror.yandex.ru/debian/ stretch main non-free",
|
||||
"aptly -architectures=s390x mirror create -keyring=aptlytest.gpg -filter='installer' -with-installer stretch http://cdn-fastly.deb.debian.org/debian/ stretch main non-free",
|
||||
]
|
||||
runCmd = "aptly mirror update -keyring=aptlytest.gpg stretch"
|
||||
outputMatchPrepare = filterOutSignature
|
||||
|
||||
def output_processor(self, output):
|
||||
return "\n".join(sorted(output.split("\n")))
|
||||
|
||||
|
||||
class UpdateMirror24Test(BaseTest):
|
||||
"""
|
||||
update mirrors: update with installer with separate gpg file
|
||||
"""
|
||||
configOverride = {"max-tries": 1}
|
||||
sortOutput = True
|
||||
longTest = False
|
||||
fixtureGpg = True
|
||||
fixtureCmds = [
|
||||
"aptly -architectures=amd64 mirror create -keyring=aptlytest.gpg -filter='installer' -with-installer trusty http://mirror.yandex.ru/ubuntu/ trusty main restricted",
|
||||
"aptly -architectures=amd64 mirror create -keyring=aptlytest.gpg -filter='installer' -with-installer trusty http://us.archive.ubuntu.com/ubuntu/ trusty main restricted",
|
||||
]
|
||||
runCmd = "aptly mirror update -keyring=aptlytest.gpg trusty"
|
||||
outputMatchPrepare = filterOutSignature
|
||||
|
||||
def output_processor(self, output):
|
||||
return "\n".join(sorted(output.split("\n")))
|
||||
|
||||
Reference in New Issue
Block a user