From 8c837066841ac7a18a332b5bcad843999e57736f Mon Sep 17 00:00:00 2001 From: Andrey Smirnov Date: Fri, 7 Feb 2014 21:09:46 +0400 Subject: [PATCH] Test disable signing & verifying via config file. --- system/t04_mirror/CreateMirror13Test_gold | 4 +++ .../t04_mirror/CreateMirror13Test_mirror_show | 18 +++++++++++ system/t04_mirror/create.py | 12 +++++++ system/t06_publish/PublishSnapshot15Test_gold | 8 +++++ .../t06_publish/PublishSnapshot15Test_release | 9 ++++++ system/t06_publish/snapshot.py | 31 +++++++++++++++++++ 6 files changed, 82 insertions(+) create mode 100644 system/t04_mirror/CreateMirror13Test_gold create mode 100644 system/t04_mirror/CreateMirror13Test_mirror_show create mode 100644 system/t06_publish/PublishSnapshot15Test_gold create mode 100644 system/t06_publish/PublishSnapshot15Test_release diff --git a/system/t04_mirror/CreateMirror13Test_gold b/system/t04_mirror/CreateMirror13Test_gold new file mode 100644 index 00000000..89457d8b --- /dev/null +++ b/system/t04_mirror/CreateMirror13Test_gold @@ -0,0 +1,4 @@ +Downloading http://mirror.yandex.ru/debian/dists/wheezy/Release... + +Mirror [mirror13]: http://mirror.yandex.ru/debian/ wheezy successfully added. +You can run 'aptly mirror update mirror13' to download repository contents. diff --git a/system/t04_mirror/CreateMirror13Test_mirror_show b/system/t04_mirror/CreateMirror13Test_mirror_show new file mode 100644 index 00000000..d533df2f --- /dev/null +++ b/system/t04_mirror/CreateMirror13Test_mirror_show @@ -0,0 +1,18 @@ +Name: mirror13 +Archive Root URL: http://mirror.yandex.ru/debian/ +Distribution: wheezy +Components: main, contrib, non-free +Architectures: amd64, armel, armhf, i386, ia64, kfreebsd-amd64, kfreebsd-i386, mips, mipsel, powerpc, s390, s390x, sparc +Last update: never + +Information from release file: +Architectures: amd64 armel armhf i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel powerpc s390 s390x sparc +Codename: wheezy +Components: main contrib non-free +Date: Sat, 14 Dec 2013 10:51:30 UTC +Description: Debian 7.3 Released 14 December 2013 + +Label: Debian +Origin: Debian +Suite: stable +Version: 7.3 diff --git a/system/t04_mirror/create.py b/system/t04_mirror/create.py index 36dc593f..5471e2f2 100644 --- a/system/t04_mirror/create.py +++ b/system/t04_mirror/create.py @@ -135,3 +135,15 @@ class CreateMirror12Test(BaseTest): gold_processor = BaseTest.expand_environ outputMatchPrepare = lambda _, s: re.sub(r'Signature made .* using', '', s) expectedCode = 1 + + +class CreateMirror13Test(BaseTest): + """ + create mirror: skip verification using config file + """ + runCmd = "aptly mirror create mirror13 http://mirror.yandex.ru/debian/ wheezy" + configOverride = {"gpgDisableVerify": True} + + def check(self): + self.check_output() + self.check_cmd_output("aptly mirror show mirror13", "mirror_show") diff --git a/system/t06_publish/PublishSnapshot15Test_gold b/system/t06_publish/PublishSnapshot15Test_gold new file mode 100644 index 00000000..05d4489b --- /dev/null +++ b/system/t06_publish/PublishSnapshot15Test_gold @@ -0,0 +1,8 @@ + +Snapshot snap15 has been successfully published. +Please setup your webserver to serve directory '${HOME}/.aptly/public' with autoindexing. +Now you can add following line to apt sources: + deb http://your-server/ maverick main +Don't forget to add your GPG key to apt with apt-key. + +You can also use `aptly serve` to publish your repositories over HTTP quickly. diff --git a/system/t06_publish/PublishSnapshot15Test_release b/system/t06_publish/PublishSnapshot15Test_release new file mode 100644 index 00000000..9444c59b --- /dev/null +++ b/system/t06_publish/PublishSnapshot15Test_release @@ -0,0 +1,9 @@ +Origin: . maverick +Label: . maverick +Codename: maverick +Architectures: amd64 i386 +Components: main +Description: Generated by aptly +MD5Sum: +SHA1: +SHA256: diff --git a/system/t06_publish/snapshot.py b/system/t06_publish/snapshot.py index d1c3e5dd..cfcfd0e4 100644 --- a/system/t06_publish/snapshot.py +++ b/system/t06_publish/snapshot.py @@ -326,3 +326,34 @@ class PublishSnapshot14Test(BaseTest): ] runCmd = "aptly publish snapshot --distribution=mars --skip-signing snap14" expectedCode = 1 + + +class PublishSnapshot15Test(BaseTest): + """ + publish snapshot: skip signing via config + """ + fixtureDB = True + fixturePool = True + fixtureCmds = [ + "aptly snapshot create snap15 from mirror gnuplot-maverick", + ] + runCmd = "aptly publish snapshot snap15" + configOverride = {"gpgDisableSign": True} + gold_processor = BaseTest.expand_environ + + def check(self): + super(PublishSnapshot15Test, self).check() + + self.check_not_exists('public/dists/maverick/InRelease') + self.check_exists('public/dists/maverick/Release') + self.check_not_exists('public/dists/maverick/Release.gpg') + + 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/main/binary-amd64/Packages') + self.check_exists('public/dists/maverick/main/binary-amd64/Packages.gz') + self.check_exists('public/dists/maverick/main/binary-amd64/Packages.bz2') + + # verify contents except of sums + self.check_file_contents('public/dists/maverick/Release', 'release', match_prepare=strip_processor)