diff --git a/system/t04_mirror/EditMirror6Test_gold b/system/t04_mirror/EditMirror6Test_gold new file mode 100644 index 00000000..2a8ac06c --- /dev/null +++ b/system/t04_mirror/EditMirror6Test_gold @@ -0,0 +1,2 @@ +Downloading http://mirror.yandex.ru/debian/dists/wheezy/Release... +Mirror [wheezy-main]: http://mirror.yandex.ru/debian/ wheezy successfully updated. diff --git a/system/t04_mirror/EditMirror6Test_mirror_show b/system/t04_mirror/EditMirror6Test_mirror_show new file mode 100644 index 00000000..e47d2258 --- /dev/null +++ b/system/t04_mirror/EditMirror6Test_mirror_show @@ -0,0 +1,19 @@ +Name: wheezy-main +Archive Root URL: http://mirror.yandex.ru/debian/ +Distribution: wheezy +Components: main +Architectures: amd64, s390 +Download Sources: no +Number of packages: 56121 + +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, 12 Jul 2014 10:59:25 UTC +Description: Debian 7.6 Released 12 July 2014 + +Label: Debian +Origin: Debian +Suite: stable +Version: 7.6 diff --git a/system/t04_mirror/EditMirror7Test_gold b/system/t04_mirror/EditMirror7Test_gold new file mode 100644 index 00000000..04552006 --- /dev/null +++ b/system/t04_mirror/EditMirror7Test_gold @@ -0,0 +1,2 @@ +Downloading http://mirror.yandex.ru/debian/dists/wheezy/Release... +ERROR: unable to edit: architecture x56 not available in repo [wheezy-main]: http://mirror.yandex.ru/debian/ wheezy diff --git a/system/t04_mirror/edit.py b/system/t04_mirror/edit.py index 6453ad11..f6778819 100644 --- a/system/t04_mirror/edit.py +++ b/system/t04_mirror/edit.py @@ -58,3 +58,24 @@ class EditMirror5Test(BaseTest): self.check_output() self.check_cmd_output("aptly mirror show mirror5", "mirror_show", match_prepare=removeDates) + + +class EditMirror6Test(BaseTest): + """ + edit mirror: change architectures + """ + fixtureDB = True + runCmd = "aptly mirror edit -architectures=amd64,s390 wheezy-main" + + def check(self): + self.check_output() + self.check_cmd_output("aptly mirror show wheezy-main", "mirror_show", match_prepare=lambda s: re.sub(r"Last update: [0-9:+A-Za-z -]+\n", "", s)) + + +class EditMirror7Test(BaseTest): + """ + edit mirror: change architectures to missing archs + """ + fixtureDB = True + runCmd = "aptly mirror edit -architectures=amd64,x56 wheezy-main" + expectedCode = 1