diff --git a/system/t04_mirror/UpdateMirror16Test_gold b/system/t04_mirror/UpdateMirror16Test_gold new file mode 100644 index 00000000..3c11f1ff --- /dev/null +++ b/system/t04_mirror/UpdateMirror16Test_gold @@ -0,0 +1,9 @@ + + +Building download queue... +Download queue: 1 items (2.67 KiB) +Downloading & parsing package files... +Downloading https://dl.bintray.com/smira/deb/Packages.bz2... +Downloading https://dl.bintray.com/smira/deb/Release... +Downloading https://dl.bintray.com/smira/deb/libboost-program-options-dev_1.49.0.1_i386.deb... +Mirror `bintray` has been successfully updated. \ No newline at end of file diff --git a/system/t04_mirror/UpdateMirror17Test_gold b/system/t04_mirror/UpdateMirror17Test_gold new file mode 100644 index 00000000..cf10e132 --- /dev/null +++ b/system/t04_mirror/UpdateMirror17Test_gold @@ -0,0 +1,10 @@ + + +Applying filter... +Building download queue... +Download queue: 0 items (0 B) +Downloading & parsing package files... +Downloading http://mirror.yandex.ru/debian/dists/wheezy/Release... +Downloading http://mirror.yandex.ru/debian/dists/wheezy/main/binary-i386/Packages.bz2... +Mirror `wheezy` has been successfully updated. +Packages filtered: 36024 -> 1. \ No newline at end of file diff --git a/system/t04_mirror/update.py b/system/t04_mirror/update.py index 8e2cf494..15edcc36 100644 --- a/system/t04_mirror/update.py +++ b/system/t04_mirror/update.py @@ -1,5 +1,8 @@ import string import re +import os +import shutil +import inspect from lib import BaseTest @@ -220,3 +223,59 @@ class UpdateMirror15Test(BaseTest): super(UpdateMirror15Test, self).check() # check pool self.check_exists('pool/c7/6b/4bd12fd92e4dfe1b55b18a67a669_libboost-program-options-dev_1.49.0.1_i386.deb') + + +class UpdateMirror16Test(BaseTest): + """ + update mirrors: update for mirror without MD5 checksums but with file in pool on legacy MD5 location + + as mirror lacks MD5 checksum, file would be downloaded but not re-imported + """ + 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")) + + 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")) + + 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') + + +class UpdateMirror17Test(BaseTest): + """ + update mirrors: update for mirror but with file in pool on legacy MD5 location + """ + longTest = False + fixtureCmds = [ + "aptly mirror create -ignore-signatures -architectures=i386 -filter=libboost-program-options-dev wheezy http://mirror.yandex.ru/debian wheezy main", + ] + runCmd = "aptly mirror update -ignore-signatures wheezy" + + 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", "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")) + + def check(self): + super(UpdateMirror17Test, self).check() + # check pool + self.check_not_exists('pool/c7/6b/4bd12fd92e4dfe1b55b18a67a669_libboost-program-options-dev_1.49.0.1_i386.deb')