From cf4619784e8ba1780fe6dc59c9ec51727227cc3e Mon Sep 17 00:00:00 2001 From: Andrey Smirnov Date: Wed, 16 Jul 2014 13:56:26 +0400 Subject: [PATCH] System tests for mirror show & update with filters. #64 --- system/t04_mirror/ShowMirror4Test_gold | 22 ++++++++++++++++++++++ system/t04_mirror/UpdateMirror10Test_gold | 19 +++++++++++++++++++ system/t04_mirror/show.py | 11 +++++++++++ system/t04_mirror/update.py | 15 +++++++++++++++ 4 files changed, 67 insertions(+) create mode 100644 system/t04_mirror/ShowMirror4Test_gold create mode 100644 system/t04_mirror/UpdateMirror10Test_gold diff --git a/system/t04_mirror/ShowMirror4Test_gold b/system/t04_mirror/ShowMirror4Test_gold new file mode 100644 index 00000000..7a8182b7 --- /dev/null +++ b/system/t04_mirror/ShowMirror4Test_gold @@ -0,0 +1,22 @@ +Name: mirror4 +Archive Root URL: http://security.debian.org/ +Distribution: wheezy/updates +Components: main +Architectures: amd64, armel, armhf, i386, ia64, kfreebsd-amd64, kfreebsd-i386, mips, mipsel, powerpc, s390, s390x, sparc +Download Sources: no +Filter: nginx | Priority (required) +Filter With Deps: yes +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: updates/main updates/contrib updates/non-free +Date: Sun, 13 Jul 2014 12:12:08 UTC +Description: Debian 7.0 Security Updates + +Label: Debian-Security +Origin: Debian +Suite: stable +Valid-Until: Wed, 23 Jul 2014 12:12:08 UTC +Version: 7.0 diff --git a/system/t04_mirror/UpdateMirror10Test_gold b/system/t04_mirror/UpdateMirror10Test_gold new file mode 100644 index 00000000..e66164f5 --- /dev/null +++ b/system/t04_mirror/UpdateMirror10Test_gold @@ -0,0 +1,19 @@ + + +Applying filter... +Building download queue... +Download queue: 2 items (17.38 KiB) +Downloading & parsing package files... +Downloading http://download.opensuse.org/repositories/home:/DeepDiver1975/xUbuntu_10.04/InRelease... +Downloading http://download.opensuse.org/repositories/home:/DeepDiver1975/xUbuntu_10.04/Packages.bz2... +Downloading http://download.opensuse.org/repositories/home:/DeepDiver1975/xUbuntu_10.04/Packages.gz... +Downloading http://download.opensuse.org/repositories/home:/DeepDiver1975/xUbuntu_10.04/Release... +Downloading http://download.opensuse.org/repositories/home:/DeepDiver1975/xUbuntu_10.04/Release.gpg... +Downloading http://download.opensuse.org/repositories/home:/DeepDiver1975/xUbuntu_10.04/Sources.bz2... +Downloading http://download.opensuse.org/repositories/home:/DeepDiver1975/xUbuntu_10.04/Sources.gz... +Downloading http://download.opensuse.org/repositories/home:/DeepDiver1975/xUbuntu_10.04/amd64/libiniparser_3.1-1_amd64.deb... +Downloading http://download.opensuse.org/repositories/home:/DeepDiver1975/xUbuntu_10.04/i386/libiniparser_3.1-1_i386.deb... +Mirror `flat-src` has been successfully updated. +Packages filtered: 5 -> 2. +gpgv: Good signature from "home:DeepDiver1975 OBS Project " +gpgv: Signature made Tue May 21 23:01:30 2013 MSK using DSA key ID 1048C1FF \ No newline at end of file diff --git a/system/t04_mirror/show.py b/system/t04_mirror/show.py index b945555b..51bfcd41 100644 --- a/system/t04_mirror/show.py +++ b/system/t04_mirror/show.py @@ -25,3 +25,14 @@ 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) + + +class ShowMirror4Test(BaseTest): + """ + show mirror: mirror with filter + """ + fixtureCmds = [ + "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) diff --git a/system/t04_mirror/update.py b/system/t04_mirror/update.py index c4ee86e1..430eee53 100644 --- a/system/t04_mirror/update.py +++ b/system/t04_mirror/update.py @@ -125,3 +125,18 @@ class UpdateMirror9Test(BaseTest): def output_processor(self, output): return "\n".join(sorted(output.split("\n"))) + + +class UpdateMirror10Test(BaseTest): + """ + update mirrors: filtered + """ + fixtureGpg = True + fixtureCmds = [ + "aptly mirror create -keyring=aptlytest.gpg -with-sources -filter='!(Name (% *-dev)), !($$PackageType (source))' flat-src http://download.opensuse.org/repositories/home:/DeepDiver1975/xUbuntu_10.04/ ./", + ] + runCmd = "aptly mirror update --keyring=aptlytest.gpg flat-src" + outputMatchPrepare = lambda _, s: re.sub(r'Signature made .* using', '', s) + + def output_processor(self, output): + return "\n".join(sorted(output.split("\n")))