mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-05-08 22:30:41 +00:00
Add system's requirements.txt, enforce flake8 linter
Fix style issues in functional tests.
This commit is contained in:
@@ -1,12 +1,3 @@
|
||||
"""
|
||||
Testing mirror management
|
||||
"""
|
||||
|
||||
from .create import *
|
||||
from .show import *
|
||||
from .list import *
|
||||
from .update import *
|
||||
from .drop import *
|
||||
from .rename import *
|
||||
from .edit import *
|
||||
from .search import *
|
||||
|
||||
+30
-11
@@ -92,7 +92,9 @@ class CreateMirror9Test(BaseTest):
|
||||
"""
|
||||
runCmd = "aptly mirror create --keyring=aptlytest.gpg mirror9 http://mirror.yandex.ru/debian/ wheezy-backports"
|
||||
fixtureGpg = True
|
||||
outputMatchPrepare = lambda _, s: re.sub(r'Signature made .* using|Warning: using insecure memory!\n', '', s)
|
||||
|
||||
def outputMatchPrepare(_, s):
|
||||
return re.sub(r'Signature made .* using|Warning: using insecure memory!\n', '', s)
|
||||
|
||||
def check(self):
|
||||
def removeDates(s):
|
||||
@@ -109,9 +111,11 @@ class CreateMirror10Test(BaseTest):
|
||||
runCmd = "aptly mirror create --keyring=aptlytest.gpg mirror10 http://mirror.yandex.ru/debian-backports/ squeeze-backports"
|
||||
fixtureGpg = False
|
||||
gold_processor = BaseTest.expand_environ
|
||||
outputMatchPrepare = lambda _, s: re.sub(r'Signature made .* using|gpgv: keyblock resource .*$|gpgv: Can\'t check signature: .*$', '', s, flags=re.MULTILINE)
|
||||
expectedCode = 1
|
||||
|
||||
def outputMatchPrepare(_, s):
|
||||
return re.sub(r'Signature made .* using|gpgv: keyblock resource .*$|gpgv: Can\'t check signature: .*$', '', s, flags=re.MULTILINE)
|
||||
|
||||
|
||||
class CreateMirror11Test(BaseTest):
|
||||
"""
|
||||
@@ -119,7 +123,9 @@ class CreateMirror11Test(BaseTest):
|
||||
"""
|
||||
runCmd = "aptly mirror create --keyring=aptlytest.gpg mirror11 http://mirror.yandex.ru/debian/ wheezy"
|
||||
fixtureGpg = True
|
||||
outputMatchPrepare = lambda _, s: re.sub(r'Signature made .* using', '', s)
|
||||
|
||||
def outputMatchPrepare(_, s):
|
||||
return re.sub(r'Signature made .* using', '', s)
|
||||
|
||||
def check(self):
|
||||
self.check_output()
|
||||
@@ -133,9 +139,11 @@ class CreateMirror12Test(BaseTest):
|
||||
runCmd = "aptly mirror create --keyring=aptlytest.gpg mirror12 http://mirror.yandex.ru/debian/ wheezy"
|
||||
fixtureGpg = False
|
||||
gold_processor = BaseTest.expand_environ
|
||||
outputMatchPrepare = lambda _, s: re.sub(r'Signature made .* using|gpgv: keyblock resource .*$|gpgv: Can\'t check signature: .*$', '', s, flags=re.MULTILINE)
|
||||
expectedCode = 1
|
||||
|
||||
def outputMatchPrepare(_, s):
|
||||
return re.sub(r'Signature made .* using|gpgv: keyblock resource .*$|gpgv: Can\'t check signature: .*$', '', s, flags=re.MULTILINE)
|
||||
|
||||
|
||||
class CreateMirror13Test(BaseTest):
|
||||
"""
|
||||
@@ -155,7 +163,9 @@ class CreateMirror14Test(BaseTest):
|
||||
"""
|
||||
runCmd = "aptly mirror create -keyring=aptlytest.gpg mirror14 https://cloud.r-project.org/bin/linux/debian jessie-cran3/"
|
||||
fixtureGpg = True
|
||||
outputMatchPrepare = lambda _, s: re.sub(r'Signature made .* using', '', s)
|
||||
|
||||
def outputMatchPrepare(_, s):
|
||||
return re.sub(r'Signature made .* using', '', s)
|
||||
|
||||
def check(self):
|
||||
self.check_output()
|
||||
@@ -195,8 +205,6 @@ class CreateMirror18Test(BaseTest):
|
||||
create mirror: mirror with ppa URL
|
||||
"""
|
||||
fixtureGpg = True
|
||||
outputMatchPrepare = lambda _, s: re.sub(r'Signature made .* using', '', s)
|
||||
|
||||
configOverride = {
|
||||
"ppaDistributorID": "ubuntu",
|
||||
"ppaCodename": "maverick",
|
||||
@@ -204,6 +212,9 @@ class CreateMirror18Test(BaseTest):
|
||||
|
||||
runCmd = "aptly mirror create -keyring=aptlytest.gpg mirror18 ppa:gladky-anton/gnuplot"
|
||||
|
||||
def outputMatchPrepare(_, s):
|
||||
return re.sub(r'Signature made .* using', '', s)
|
||||
|
||||
def check(self):
|
||||
self.check_output()
|
||||
self.check_cmd_output("aptly mirror show mirror18", "mirror_show")
|
||||
@@ -214,10 +225,12 @@ class CreateMirror19Test(BaseTest):
|
||||
create mirror: mirror with / in distribution
|
||||
"""
|
||||
fixtureGpg = True
|
||||
outputMatchPrepare = lambda _, s: re.sub(r'Signature made .* using', '', s)
|
||||
|
||||
runCmd = "aptly -architectures='i386' mirror create -keyring=aptlytest.gpg -with-sources mirror19 http://security.debian.org/ wheezy/updates main"
|
||||
|
||||
def outputMatchPrepare(_, s):
|
||||
return re.sub(r'Signature made .* using', '', s)
|
||||
|
||||
def check(self):
|
||||
def removeDates(s):
|
||||
return re.sub(r"(Date|Valid-Until): [,0-9:+A-Za-z -]+\n", "", s)
|
||||
@@ -231,12 +244,14 @@ class CreateMirror20Test(BaseTest):
|
||||
create mirror: using failing HTTP_PROXY
|
||||
"""
|
||||
fixtureGpg = True
|
||||
outputMatchPrepare = lambda _, s: s.replace('getsockopt: ', '').replace('proxyconnect tcp', 'http: error connecting to proxy http://127.0.0.1:3137')
|
||||
|
||||
runCmd = "aptly -architectures='i386' mirror create -keyring=aptlytest.gpg -with-sources mirror20 http://security.debian.org/ wheezy/updates main"
|
||||
environmentOverride = {"HTTP_PROXY": "127.0.0.1:3137"}
|
||||
expectedCode = 1
|
||||
|
||||
def outputMatchPrepare(_, s):
|
||||
return s.replace('getsockopt: ', '').replace('proxyconnect tcp', 'http: error connecting to proxy http://127.0.0.1:3137')
|
||||
|
||||
|
||||
class CreateMirror21Test(BaseTest):
|
||||
"""
|
||||
@@ -244,7 +259,9 @@ class CreateMirror21Test(BaseTest):
|
||||
"""
|
||||
runCmd = "aptly mirror create -keyring=aptlytest.gpg mirror21 http://pkg.jenkins-ci.org/debian-stable binary/"
|
||||
fixtureGpg = True
|
||||
outputMatchPrepare = lambda _, s: re.sub(r'Signature made .* using', '', s)
|
||||
|
||||
def outputMatchPrepare(_, s):
|
||||
return re.sub(r'Signature made .* using', '', s)
|
||||
|
||||
def check(self):
|
||||
def removeSHA512(s):
|
||||
@@ -285,7 +302,9 @@ class CreateMirror24Test(BaseTest):
|
||||
"""
|
||||
runCmd = "aptly mirror create -ignore-signatures=false -keyring=aptlytest.gpg mirror24 http://security.debian.org/ wheezy/updates main"
|
||||
fixtureGpg = True
|
||||
outputMatchPrepare = lambda _, s: re.sub(r'Signature made .* using', '', s)
|
||||
|
||||
def outputMatchPrepare(_, s):
|
||||
return re.sub(r'Signature made .* using', '', s)
|
||||
|
||||
configOverride = {
|
||||
"gpgDisableVerify": True
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
from lib import BaseTest
|
||||
|
||||
|
||||
def sortLines(_, s):
|
||||
return "\n".join(sorted(s.split("\n")))
|
||||
|
||||
|
||||
class SearchMirror1Test(BaseTest):
|
||||
"""
|
||||
search mirror: regular search
|
||||
"""
|
||||
fixtureDB = True
|
||||
outputMatchPrepare = lambda _, s: "\n".join(sorted(s.split("\n")))
|
||||
outputMatchPrepare = sortLines
|
||||
runCmd = "aptly mirror search wheezy-main '$$Architecture (i386), Name (% *-dev)'"
|
||||
|
||||
|
||||
@@ -32,7 +36,7 @@ class SearchMirror4Test(BaseTest):
|
||||
search mirror: with-deps search
|
||||
"""
|
||||
fixtureDB = True
|
||||
outputMatchPrepare = lambda _, s: "\n".join(sorted(s.split("\n")))
|
||||
outputMatchPrepare = sortLines
|
||||
runCmd = "aptly mirror search -with-deps wheezy-main 'Name (nginx)'"
|
||||
|
||||
|
||||
@@ -41,7 +45,7 @@ class SearchMirror5Test(BaseTest):
|
||||
search mirror: regular search
|
||||
"""
|
||||
fixtureDB = True
|
||||
outputMatchPrepare = lambda _, s: "\n".join(sorted(s.split("\n")))
|
||||
outputMatchPrepare = sortLines
|
||||
runCmd = "aptly mirror search -format='{{.Package}}#{{.Version}}' wheezy-main '$$Architecture (i386), Name (% *-dev)'"
|
||||
|
||||
|
||||
@@ -50,5 +54,5 @@ class SearchMirror6Test(BaseTest):
|
||||
search mirror: no query
|
||||
"""
|
||||
fixtureDB = True
|
||||
outputMatchPrepare = lambda _, s: "\n".join(sorted(s.split("\n")))
|
||||
outputMatchPrepare = sortLines
|
||||
runCmd = "aptly mirror search -format='{{.Package}}#{{.Version}}' wheezy-main"
|
||||
|
||||
@@ -24,7 +24,9 @@ class ShowMirror3Test(BaseTest):
|
||||
"""
|
||||
fixtureDB = True
|
||||
runCmd = "aptly mirror show --with-packages wheezy-contrib"
|
||||
outputMatchPrepare = lambda _, s: re.sub(r"Last update: [0-9:+A-Za-z -]+\n", "", s)
|
||||
|
||||
def outputMatchPrepare(_, s):
|
||||
return re.sub(r"Last update: [0-9:+A-Za-z -]+\n", "", s)
|
||||
|
||||
|
||||
class ShowMirror4Test(BaseTest):
|
||||
@@ -35,4 +37,6 @@ class ShowMirror4Test(BaseTest):
|
||||
"aptly mirror create -ignore-signatures -filter='nginx | Priority (required)' -filter-with-deps=true mirror4 http://security.debian.org/ wheezy/updates main"
|
||||
]
|
||||
runCmd = "aptly mirror show mirror4"
|
||||
outputMatchPrepare = lambda _, s: re.sub(r"(Date|Valid-Until): [,0-9:+A-Za-z -]+\n", "", s)
|
||||
|
||||
def outputMatchPrepare(_, s):
|
||||
return re.sub(r"(Date|Valid-Until): [,0-9:+A-Za-z -]+\n", "", s)
|
||||
|
||||
@@ -6,6 +6,10 @@ import inspect
|
||||
from lib import BaseTest
|
||||
|
||||
|
||||
def filterOutSignature(_, s):
|
||||
return re.sub(r'Signature made .* using', '', s)
|
||||
|
||||
|
||||
class UpdateMirror1Test(BaseTest):
|
||||
"""
|
||||
update mirrors: regular update
|
||||
@@ -96,7 +100,7 @@ class UpdateMirror7Test(BaseTest):
|
||||
"aptly mirror create --keyring=aptlytest.gpg -architectures=amd64 flat https://cloud.r-project.org/bin/linux/debian jessie-cran3/",
|
||||
]
|
||||
runCmd = "aptly mirror update --keyring=aptlytest.gpg flat"
|
||||
outputMatchPrepare = lambda _, s: re.sub(r'Signature made .* using', '', s)
|
||||
outputMatchPrepare = filterOutSignature
|
||||
|
||||
def output_processor(self, output):
|
||||
return "\n".join(sorted(output.split("\n")))
|
||||
@@ -112,7 +116,7 @@ class UpdateMirror8Test(BaseTest):
|
||||
"aptly mirror create --keyring=aptlytest.gpg gnuplot-maverick-src http://ppa.launchpad.net/gladky-anton/gnuplot/ubuntu/ maverick",
|
||||
]
|
||||
runCmd = "aptly mirror update --keyring=aptlytest.gpg gnuplot-maverick-src"
|
||||
outputMatchPrepare = lambda _, s: re.sub(r'Signature made .* using', '', s)
|
||||
outputMatchPrepare = filterOutSignature
|
||||
|
||||
|
||||
class UpdateMirror9Test(BaseTest):
|
||||
@@ -124,7 +128,7 @@ class UpdateMirror9Test(BaseTest):
|
||||
"aptly mirror create --keyring=aptlytest.gpg -with-sources flat-src https://cloud.r-project.org/bin/linux/debian jessie-cran3/",
|
||||
]
|
||||
runCmd = "aptly mirror update --keyring=aptlytest.gpg flat-src"
|
||||
outputMatchPrepare = lambda _, s: re.sub(r'Signature made .* using', '', s)
|
||||
outputMatchPrepare = filterOutSignature
|
||||
|
||||
def output_processor(self, output):
|
||||
return "\n".join(sorted(output.split("\n")))
|
||||
@@ -139,7 +143,7 @@ class UpdateMirror10Test(BaseTest):
|
||||
"aptly mirror create -keyring=aptlytest.gpg -with-sources -filter='!(Name (% r-*)), !($$PackageType (source))' flat-src https://cloud.r-project.org/bin/linux/debian jessie-cran3/",
|
||||
]
|
||||
runCmd = "aptly mirror update --keyring=aptlytest.gpg flat-src"
|
||||
outputMatchPrepare = lambda _, s: re.sub(r'Signature made .* using', '', s)
|
||||
outputMatchPrepare = filterOutSignature
|
||||
|
||||
def output_processor(self, output):
|
||||
return "\n".join(sorted(output.split("\n")))
|
||||
@@ -154,7 +158,7 @@ class UpdateMirror11Test(BaseTest):
|
||||
fixtureCmds = [
|
||||
"aptly mirror create -keyring=aptlytest.gpg -filter='Priority (required), Name (% s*)' -architectures=i386 wheezy-main ftp://ftp.ru.debian.org/debian/ wheezy main",
|
||||
]
|
||||
outputMatchPrepare = lambda _, s: re.sub(r'Signature made .* using', '', s)
|
||||
outputMatchPrepare = filterOutSignature
|
||||
runCmd = "aptly mirror update -keyring=aptlytest.gpg wheezy-main"
|
||||
|
||||
def output_processor(self, output):
|
||||
@@ -171,7 +175,7 @@ class UpdateMirror12Test(BaseTest):
|
||||
"aptly -architectures=i386,amd64 mirror create -keyring=aptlytest.gpg -filter='$$Source (gnupg)' -with-udebs wheezy http://mirror.yandex.ru/debian/ wheezy main non-free",
|
||||
]
|
||||
runCmd = "aptly mirror update -keyring=aptlytest.gpg wheezy"
|
||||
outputMatchPrepare = lambda _, s: re.sub(r'Signature made .* using', '', s)
|
||||
outputMatchPrepare = filterOutSignature
|
||||
|
||||
def output_processor(self, output):
|
||||
return "\n".join(sorted(output.split("\n")))
|
||||
|
||||
Reference in New Issue
Block a user