mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-06-15 07:00:52 +00:00
New upstream version 1.3.0
This commit is contained in:
@@ -61,6 +61,7 @@ class BaseTest(object):
|
||||
fixtureDB = False
|
||||
fixtureGpg = False
|
||||
fixtureWebServer = False
|
||||
requiresFTP = False
|
||||
|
||||
expectedCode = 0
|
||||
configFile = {
|
||||
@@ -118,6 +119,8 @@ class BaseTest(object):
|
||||
return False
|
||||
if self.fixtureDB and not os.path.exists(self.fixtureDBDir):
|
||||
return False
|
||||
if self.requiresFTP and os.environ.get('NO_FTP_ACCESS', '') == 'yes':
|
||||
return False
|
||||
|
||||
return True
|
||||
|
||||
|
||||
+3
-1
@@ -8,8 +8,10 @@ try:
|
||||
if 'AWS_SECRET_ACCESS_KEY' in os.environ and 'AWS_ACCESS_KEY_ID' in os.environ:
|
||||
s3_conn = boto.connect_s3()
|
||||
else:
|
||||
print "S3 tests disabled: AWS creds not found in the environment"
|
||||
s3_conn = None
|
||||
except ImportError:
|
||||
except ImportError, e:
|
||||
print "S3 tests disabled: can't import boto", e
|
||||
s3_conn = None
|
||||
|
||||
|
||||
|
||||
+3
-1
@@ -23,8 +23,10 @@ try:
|
||||
swift_conn = swiftclient.Connection(auth_url, auth_username,
|
||||
auth_password, auth_version=1)
|
||||
else:
|
||||
print "Swift tests disabled: OpenStack creds not found in the environment"
|
||||
swift_conn = None
|
||||
except ImportError:
|
||||
except ImportError, e:
|
||||
print "Swift tests disabled: unable to import swiftclient", e
|
||||
swift_conn = None
|
||||
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ openpgp: Good signature from "NVIDIA CORPORATION (Open Source Projects) <cudatoo
|
||||
Downloading & parsing package files...
|
||||
Downloading https://nvidia.github.io/libnvidia-container/ubuntu16.04/amd64/Packages.xz...
|
||||
Applying filter...
|
||||
Packages filtered: 8 -> 0.
|
||||
Packages filtered: 20 -> 0.
|
||||
Building download queue...
|
||||
Download queue: 0 items (0 B)
|
||||
|
||||
|
||||
@@ -253,7 +253,8 @@ class CreateMirror20Test(BaseTest):
|
||||
expectedCode = 1
|
||||
|
||||
def outputMatchPrepare(_, s):
|
||||
return s.replace('getsockopt: ', '').replace('proxyconnect tcp', 'http: error connecting to proxy http://127.0.0.1:3137')
|
||||
return s.replace('getsockopt: ', '').replace('connect: ', ''). \
|
||||
replace('proxyconnect tcp', 'http: error connecting to proxy http://127.0.0.1:3137')
|
||||
|
||||
|
||||
class CreateMirror21Test(BaseTest):
|
||||
|
||||
@@ -107,5 +107,6 @@ class EditMirror10Test(BaseTest):
|
||||
"""
|
||||
edit mirror: change archive url
|
||||
"""
|
||||
requiresFTP = True
|
||||
fixtureCmds = ["aptly mirror create -ignore-signatures mirror10 ftp://ftp.ru.debian.org/debian wheezy main"]
|
||||
runCmd = "aptly mirror edit -ignore-signatures -archive-url ftp://ftp.ch.debian.org/debian mirror10"
|
||||
|
||||
@@ -155,6 +155,7 @@ class UpdateMirror11Test(BaseTest):
|
||||
"""
|
||||
longTest = False
|
||||
fixtureGpg = True
|
||||
requiresFTP = True
|
||||
fixtureCmds = [
|
||||
"aptly mirror create -keyring=aptlytest.gpg -filter='Priority (required), Name (% s*)' -architectures=i386 wheezy-main ftp://ftp.ru.debian.org/debian/ wheezy main",
|
||||
]
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
FILE LOCATION
|
||||
usr/share/doc/libboost-program-options-dev/changelog.gz libdevel/libboost-program-options-dev
|
||||
usr/share/doc/libboost-program-options-dev/copyright libdevel/libboost-program-options-dev
|
||||
@@ -54,6 +54,7 @@ class PublishRepo1Test(BaseTest):
|
||||
self.check_file_contents('public/dists/maverick/main/source/Sources', 'sources', match_prepare=lambda s: "\n".join(sorted(s.split("\n"))))
|
||||
self.check_file_contents('public/dists/maverick/main/binary-i386/Packages', 'binary', match_prepare=lambda s: "\n".join(sorted(s.split("\n"))))
|
||||
self.check_file_contents('public/dists/maverick/main/Contents-i386.gz', 'contents_i386', match_prepare=ungzip_if_required)
|
||||
self.check_file_contents('public/dists/maverick/Contents-i386.gz', 'contents_i386_legacy', match_prepare=ungzip_if_required)
|
||||
|
||||
# verify signatures
|
||||
self.run_cmd(["gpg", "--no-auto-check-trustdb", "--keyring", os.path.join(os.path.dirname(inspect.getsourcefile(BaseTest)), "files", "aptly.pub"),
|
||||
@@ -92,7 +93,8 @@ class PublishRepo1Test(BaseTest):
|
||||
|
||||
if pathsSeen != set(['main/binary-i386/Packages', 'main/binary-i386/Packages.bz2', 'main/binary-i386/Packages.gz',
|
||||
'main/source/Sources', 'main/source/Sources.gz', 'main/source/Sources.bz2',
|
||||
'main/binary-i386/Release', 'main/source/Release', 'main/Contents-i386.gz']):
|
||||
'main/binary-i386/Release', 'main/source/Release', 'main/Contents-i386.gz',
|
||||
'Contents-i386.gz']):
|
||||
raise Exception("path seen wrong: %r" % (pathsSeen, ))
|
||||
|
||||
|
||||
@@ -492,7 +494,7 @@ class PublishRepo17Test(BaseTest):
|
||||
'contrib/source/Sources', 'contrib/source/Sources.gz', 'contrib/source/Sources.bz2',
|
||||
'main/source/Release', 'contrib/source/Release',
|
||||
'main/binary-i386/Release', 'contrib/binary-i386/Release',
|
||||
'main/Contents-i386.gz']):
|
||||
'main/Contents-i386.gz', 'Contents-i386.gz']):
|
||||
raise Exception("path seen wrong: %r" % (pathsSeen, ))
|
||||
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ class PublishSnapshot1Test(BaseTest):
|
||||
if pathsSeen != set(['main/binary-amd64/Packages', 'main/binary-i386/Packages', 'main/binary-i386/Packages.gz',
|
||||
'main/binary-amd64/Packages.gz', 'main/binary-amd64/Packages.bz2', 'main/binary-i386/Packages.bz2',
|
||||
'main/binary-amd64/Release', 'main/binary-i386/Release', 'main/Contents-amd64.gz',
|
||||
'main/Contents-i386.gz']):
|
||||
'main/Contents-i386.gz', 'Contents-i386.gz', 'Contents-amd64.gz']):
|
||||
raise Exception("path seen wrong: %r" % (pathsSeen, ))
|
||||
|
||||
|
||||
@@ -754,7 +754,8 @@ class PublishSnapshot26Test(BaseTest):
|
||||
'contrib/source/Sources', 'contrib/source/Sources.gz', 'contrib/source/Sources.bz2',
|
||||
'main/binary-amd64/Release', 'main/binary-i386/Release', 'main/source/Release',
|
||||
'contrib/binary-amd64/Release', 'contrib/binary-i386/Release', 'contrib/source/Release',
|
||||
'contrib/Contents-i386.gz', 'main/Contents-i386.gz', 'main/Contents-amd64.gz']):
|
||||
'contrib/Contents-i386.gz', 'main/Contents-i386.gz', 'main/Contents-amd64.gz',
|
||||
'Contents-i386.gz', 'Contents-amd64.gz']):
|
||||
raise Exception("path seen wrong: %r" % (pathsSeen, ))
|
||||
|
||||
|
||||
@@ -975,6 +976,7 @@ class PublishSnapshot35Test(BaseTest):
|
||||
pathsExepcted.add("main/%sbinary-%s/Packages%s" % (udeb, arch, ext))
|
||||
|
||||
pathsExepcted.add("main/Contents-%s%s.gz" % ("udeb-" if udeb != "" else "", arch))
|
||||
pathsExepcted.add("Contents-%s%s.gz" % ("udeb-" if udeb != "" else "", arch))
|
||||
|
||||
pathsExepcted.add("main/%sbinary-%s/Release" % (udeb, arch))
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ class PublishSwitch1Test(BaseTest):
|
||||
if pathsSeen != set(['main/binary-amd64/Packages', 'main/binary-i386/Packages', 'main/binary-i386/Packages.gz',
|
||||
'main/binary-amd64/Packages.gz', 'main/binary-amd64/Packages.bz2', 'main/binary-i386/Packages.bz2',
|
||||
'main/binary-amd64/Release', 'main/binary-i386/Release', 'main/Contents-amd64.gz',
|
||||
'main/Contents-i386.gz']):
|
||||
'main/Contents-i386.gz', 'Contents-i386.gz', 'Contents-amd64.gz']):
|
||||
raise Exception("path seen wrong: %r" % (pathsSeen, ))
|
||||
|
||||
|
||||
@@ -354,7 +354,7 @@ class PublishSwitch8Test(BaseTest):
|
||||
'a/binary-i386/Release', 'b/binary-i386/Release', 'c/binary-i386/Release',
|
||||
'a/source/Release', 'b/source/Release', 'c/source/Release',
|
||||
'b/Contents-amd64.gz', 'c/Contents-i386.gz', 'a/Contents-i386.gz',
|
||||
'a/Contents-amd64.gz', 'b/Contents-i386.gz']):
|
||||
'a/Contents-amd64.gz', 'b/Contents-i386.gz', 'Contents-i386.gz', 'Contents-amd64.gz']):
|
||||
raise Exception("path seen wrong: %r" % (pathsSeen, ))
|
||||
|
||||
|
||||
@@ -531,5 +531,5 @@ class PublishSwitch14Test(BaseTest):
|
||||
if pathsSeen != set(['main/binary-amd64/Packages', 'main/binary-i386/Packages', 'main/binary-i386/Packages.gz',
|
||||
'main/binary-amd64/Packages.gz', 'main/binary-amd64/Packages.bz2', 'main/binary-i386/Packages.bz2',
|
||||
'main/binary-amd64/Release', 'main/binary-i386/Release', 'main/Contents-amd64.gz',
|
||||
'main/Contents-i386.gz']):
|
||||
'main/Contents-i386.gz', 'Contents-i386.gz', 'Contents-amd64.gz']):
|
||||
raise Exception("path seen wrong: %r" % (pathsSeen, ))
|
||||
|
||||
@@ -31,6 +31,7 @@ class PublishUpdate1Test(BaseTest):
|
||||
self.check_exists('public/dists/maverick/main/binary-i386/Packages')
|
||||
self.check_exists('public/dists/maverick/main/binary-i386/Packages.gz')
|
||||
self.check_exists('public/dists/maverick/main/binary-i386/Packages.bz2')
|
||||
self.check_exists('public/dists/maverick/Contents-i386.gz')
|
||||
self.check_exists('public/dists/maverick/main/Contents-i386.gz')
|
||||
self.check_exists('public/dists/maverick/main/source/Sources')
|
||||
self.check_exists('public/dists/maverick/main/source/Sources.gz')
|
||||
@@ -84,7 +85,8 @@ class PublishUpdate1Test(BaseTest):
|
||||
|
||||
if pathsSeen != set(['main/binary-i386/Packages', 'main/binary-i386/Packages.bz2', 'main/binary-i386/Packages.gz',
|
||||
'main/source/Sources', 'main/source/Sources.gz', 'main/source/Sources.bz2',
|
||||
'main/binary-i386/Release', 'main/source/Release', 'main/Contents-i386.gz']):
|
||||
'main/binary-i386/Release', 'main/source/Release', 'main/Contents-i386.gz',
|
||||
'Contents-i386.gz']):
|
||||
raise Exception("path seen wrong: %r" % (pathsSeen, ))
|
||||
|
||||
|
||||
@@ -370,6 +372,7 @@ class PublishUpdate12Test(BaseTest):
|
||||
self.check_exists('public/dists/maverick/main/binary-i386/Packages')
|
||||
self.check_exists('public/dists/maverick/main/binary-i386/Packages.gz')
|
||||
self.check_exists('public/dists/maverick/main/binary-i386/Packages.bz2')
|
||||
self.check_exists('public/dists/maverick/Contents-i386.gz')
|
||||
self.check_exists('public/dists/maverick/main/Contents-i386.gz')
|
||||
self.check_exists('public/dists/maverick/main/source/Sources')
|
||||
self.check_exists('public/dists/maverick/main/source/Sources.gz')
|
||||
@@ -423,5 +426,6 @@ class PublishUpdate12Test(BaseTest):
|
||||
|
||||
if pathsSeen != set(['main/binary-i386/Packages', 'main/binary-i386/Packages.bz2', 'main/binary-i386/Packages.gz',
|
||||
'main/source/Sources', 'main/source/Sources.gz', 'main/source/Sources.bz2',
|
||||
'main/binary-i386/Release', 'main/source/Release', 'main/Contents-i386.gz']):
|
||||
'main/binary-i386/Release', 'main/source/Release', 'main/Contents-i386.gz',
|
||||
'Contents-i386.gz']):
|
||||
raise Exception("path seen wrong: %r" % (pathsSeen, ))
|
||||
|
||||
@@ -36,6 +36,7 @@ class PublishAPITestRepo(APITest):
|
||||
"Signing": DefaultSigningOptions,
|
||||
})
|
||||
repo_expected = {
|
||||
'AcquireByHash': False,
|
||||
'Architectures': ['i386', 'source'],
|
||||
'Distribution': 'wheezy',
|
||||
'Label': '',
|
||||
@@ -72,6 +73,7 @@ class PublishAPITestRepo(APITest):
|
||||
"Architectures": ["i386", "amd64"],
|
||||
})
|
||||
repo2_expected = {
|
||||
'AcquireByHash': False,
|
||||
'Architectures': ['amd64', 'i386'],
|
||||
'Distribution': distribution,
|
||||
'Label': '',
|
||||
@@ -120,6 +122,7 @@ class PublishSnapshotAPITest(APITest):
|
||||
prefix = self.random_name()
|
||||
resp = self.post("/api/publish/" + prefix,
|
||||
json={
|
||||
"AcquireByHash": True,
|
||||
"SourceKind": "snapshot",
|
||||
"Sources": [{"Name": snapshot_name}],
|
||||
"Signing": DefaultSigningOptions,
|
||||
@@ -129,6 +132,7 @@ class PublishSnapshotAPITest(APITest):
|
||||
})
|
||||
self.check_equal(resp.status_code, 201)
|
||||
self.check_equal(resp.json(), {
|
||||
'AcquireByHash': True,
|
||||
'Architectures': ['i386'],
|
||||
'Distribution': 'squeeze',
|
||||
'Label': '',
|
||||
@@ -142,6 +146,7 @@ class PublishSnapshotAPITest(APITest):
|
||||
'Storage': ''})
|
||||
|
||||
self.check_exists("public/" + prefix + "/dists/squeeze/Release")
|
||||
self.check_exists("public/" + prefix + "/dists/squeeze/main/binary-i386/by-hash")
|
||||
self.check_exists("public/" + prefix + "/dists/squeeze/main/binary-i386/Packages")
|
||||
self.check_exists("public/" + prefix + "/dists/squeeze/main/Contents-i386.gz")
|
||||
self.check_exists("public/" + prefix + "/pool/main/b/boost-defaults/libboost-program-options-dev_1.49.0.1_i386.deb")
|
||||
@@ -187,11 +192,14 @@ class PublishUpdateAPITestRepo(APITest):
|
||||
self.check_equal(self.delete("/api/repos/" + repo_name + "/packages/",
|
||||
json={"PackageRefs": ['Psource pyspi 0.6.1-1.4 f8f1daa806004e89']}).status_code, 200)
|
||||
|
||||
# Update and switch AcquireByHash on.
|
||||
resp = self.put("/api/publish/" + prefix + "/wheezy",
|
||||
json={
|
||||
"AcquireByHash": True,
|
||||
"Signing": DefaultSigningOptions,
|
||||
})
|
||||
repo_expected = {
|
||||
'AcquireByHash': True,
|
||||
'Architectures': ['i386', 'source'],
|
||||
'Distribution': 'wheezy',
|
||||
'Label': '',
|
||||
@@ -207,6 +215,8 @@ class PublishUpdateAPITestRepo(APITest):
|
||||
self.check_equal(resp.status_code, 200)
|
||||
self.check_equal(resp.json(), repo_expected)
|
||||
|
||||
self.check_exists("public/" + prefix + "/dists/wheezy/main/binary-i386/by-hash")
|
||||
|
||||
self.check_exists("public/" + prefix + "/pool/main/b/boost-defaults/libboost-program-options-dev_1.49.0.1_i386.deb")
|
||||
self.check_not_exists("public/" + prefix + "/pool/main/p/pyspi/pyspi-0.6.1-1.3.stripped.dsc")
|
||||
|
||||
@@ -273,6 +283,7 @@ class PublishUpdateSkipCleanupAPITestRepo(APITest):
|
||||
"SkipCleanup": True,
|
||||
})
|
||||
repo_expected = {
|
||||
'AcquireByHash': False,
|
||||
'Architectures': ['i386', 'source'],
|
||||
'Distribution': 'wheezy',
|
||||
'Label': '',
|
||||
@@ -328,6 +339,7 @@ class PublishSwitchAPITestRepo(APITest):
|
||||
|
||||
self.check_equal(resp.status_code, 201)
|
||||
repo_expected = {
|
||||
'AcquireByHash': False,
|
||||
'Architectures': ['i386', 'source'],
|
||||
'Distribution': 'wheezy',
|
||||
'Label': '',
|
||||
@@ -362,6 +374,7 @@ class PublishSwitchAPITestRepo(APITest):
|
||||
"SkipContents": True,
|
||||
})
|
||||
repo_expected = {
|
||||
'AcquireByHash': False,
|
||||
'Architectures': ['i386', 'source'],
|
||||
'Distribution': 'wheezy',
|
||||
'Label': '',
|
||||
@@ -416,6 +429,7 @@ class PublishSwitchAPISkipCleanupTestRepo(APITest):
|
||||
|
||||
self.check_equal(resp.status_code, 201)
|
||||
repo_expected = {
|
||||
'AcquireByHash': False,
|
||||
'Architectures': ['i386', 'source'],
|
||||
'Distribution': 'wheezy',
|
||||
'Label': '',
|
||||
@@ -445,6 +459,7 @@ class PublishSwitchAPISkipCleanupTestRepo(APITest):
|
||||
|
||||
self.check_equal(resp.status_code, 201)
|
||||
repo_expected = {
|
||||
'AcquireByHash': False,
|
||||
'Architectures': ['i386', 'source'],
|
||||
'Distribution': 'otherdist',
|
||||
'Label': '',
|
||||
@@ -477,6 +492,7 @@ class PublishSwitchAPISkipCleanupTestRepo(APITest):
|
||||
"SkipContents": True,
|
||||
})
|
||||
repo_expected = {
|
||||
'AcquireByHash': False,
|
||||
'Architectures': ['i386', 'source'],
|
||||
'Distribution': 'wheezy',
|
||||
'Label': '',
|
||||
|
||||
Reference in New Issue
Block a user