Skip to content

Commit cb3d616

Browse files
committed
add test for publishing distribution with slash (/)
1 parent d9cfa99 commit cb3d616

File tree

5 files changed

+166
-0
lines changed

5 files changed

+166
-0
lines changed

deb/publish_test.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,9 @@ func (s *PublishedRepoSuite) TestNewPublishedRepo(c *C) {
187187

188188
_, err := NewPublishedRepo("", ".", "a", nil, []string{"main", "main"}, []interface{}{s.snapshot, s.snapshot2}, s.factory)
189189
c.Check(err, ErrorMatches, "duplicate component name: main")
190+
191+
_, err = NewPublishedRepo("", ".", "wheezy/updates", nil, []string{"main"}, []interface{}{s.snapshot}, s.factory)
192+
c.Check(err, IsNil)
190193
}
191194

192195
func (s *PublishedRepoSuite) TestPrefixNormalization(c *C) {
@@ -287,6 +290,13 @@ func (s *PublishedRepoSuite) TestDistributionComponentGuessing(c *C) {
287290
c.Check(repo.Distribution, Equals, "precise")
288291
c.Check(repo.Components(), DeepEquals, []string{"contrib"})
289292

293+
s.localRepo.DefaultDistribution = "precise/updates"
294+
295+
repo, err = NewPublishedRepo("", "ppa", "", nil, []string{""}, []interface{}{s.localRepo}, s.factory)
296+
c.Check(err, IsNil)
297+
c.Check(repo.Distribution, Equals, "precise/updates")
298+
c.Check(repo.Components(), DeepEquals, []string{"contrib"})
299+
290300
repo, err = NewPublishedRepo("", "ppa", "", nil, []string{"", "contrib"}, []interface{}{s.snapshot, s.snapshot2}, s.factory)
291301
c.Check(err, IsNil)
292302
c.Check(repo.Distribution, Equals, "squeeze")
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
2+
Download Error: http://repo.aptly.info/system-tests/archive.debian.org/debian-security/dists/stretch/updates/main/binary-i386/Packages
3+
Download Error: http://repo.aptly.info/system-tests/archive.debian.org/debian-security/dists/stretch/updates/main/binary-i386/Packages.gz
4+
Download Error: http://repo.aptly.info/system-tests/archive.debian.org/debian-security/dists/stretch/updates/main/binary-i386/Packages.xz
5+
Downloading & parsing package files...
6+
Downloading: http://repo.aptly.info/system-tests/archive.debian.org/debian-security/dists/stretch/updates/InRelease
7+
Downloading: http://repo.aptly.info/system-tests/archive.debian.org/debian-security/dists/stretch/updates/main/binary-i386/Packages
8+
Downloading: http://repo.aptly.info/system-tests/archive.debian.org/debian-security/dists/stretch/updates/main/binary-i386/Packages.gz
9+
Downloading: http://repo.aptly.info/system-tests/archive.debian.org/debian-security/dists/stretch/updates/main/binary-i386/Packages.xz
10+
ERROR: unable to update: HTTP code 404 while fetching http://repo.aptly.info/system-tests/archive.debian.org/debian-security/dists/stretch/updates/main/binary-i386/Packages
11+
Error (retrying): HTTP code 404 while fetching http://repo.aptly.info/system-tests/archive.debian.org/debian-security/dists/stretch/updates/main/binary-i386/Packages
12+
Error (retrying): HTTP code 404 while fetching http://repo.aptly.info/system-tests/archive.debian.org/debian-security/dists/stretch/updates/main/binary-i386/Packages.gz
13+
Error (retrying): HTTP code 404 while fetching http://repo.aptly.info/system-tests/archive.debian.org/debian-security/dists/stretch/updates/main/binary-i386/Packages.xz
14+
Retrying 0 http://repo.aptly.info/system-tests/archive.debian.org/debian-security/dists/stretch/updates/main/binary-i386/Packages...
15+
Retrying 0 http://repo.aptly.info/system-tests/archive.debian.org/debian-security/dists/stretch/updates/main/binary-i386/Packages.gz...
16+
Retrying 0 http://repo.aptly.info/system-tests/archive.debian.org/debian-security/dists/stretch/updates/main/binary-i386/Packages.xz...
17+
gpgv: using RSA key 379483D8B60160B155B372DDAA8E81B4331F7F50
18+
gpgv: using RSA key 5237CEEEF212F3D51C74ABE0112695A0E562B32A
19+
gpgv: Good signature from "Debian Security Archive Automatic Signing Key (10/buster) <ftpmaster@debian.org>"
20+
gpgv: Good signature from "Debian Security Archive Automatic Signing Key (9/stretch) <ftpmaster@debian.org>"
21+
gpgv: Signature made Sat Feb 18 04:22:45 2023 UTC
22+
gpgv: Signature made Sat Feb 18 04:22:45 2023 UTC
23+
gpgv: can't allocate lock for '/home/runner/.gnupg/aptlytest.gpg'

system/t04_mirror/update.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,3 +436,18 @@ class UpdateMirror24Test(BaseTest):
436436
]
437437
runCmd = "aptly mirror update -keyring=aptlytest.gpg trusty"
438438
outputMatchPrepare = filterOutSignature
439+
440+
441+
class UpdateMirror25Test(BaseTest):
442+
"""
443+
update mirrors: mirror with / in distribution
444+
"""
445+
configOverride = {"max-tries": 1}
446+
sortOutput = True
447+
longTest = False
448+
fixtureGpg = True
449+
fixtureCmds = [
450+
"aptly -architectures='i386' mirror create -keyring=aptlytest.gpg -with-sources mirror19 http://repo.aptly.info/system-tests/archive.debian.org/debian-security/ stretch/updates main"
451+
]
452+
runCmd = "aptly mirror update -keyring=aptlytest.gpg mirror19"
453+
outputMatchPrepare = filterOutSignature
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Loading packages...
2+
Generating metadata files and linking package files...
3+
Finalizing metadata files...
4+
Signing file 'Release' with gpg, please enter your passphrase when prompted:
5+
Clearsigning file 'Release' with gpg, please enter your passphrase when prompted:
6+
7+
Snapshot snap41 has been successfully published.
8+
Please setup your webserver to serve directory '/home/runner/.aptly/public' with autoindexing.
9+
Now you can add following line to apt sources:
10+
deb http://your-server/ buster/updates main
11+
deb-src http://your-server/ buster/updates main
12+
Don't forget to add your GPG key to apt with apt-key.
13+
14+
You can also use `aptly serve` to publish your repositories over HTTP quickly.

system/t06_publish/snapshot.py

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1240,3 +1240,107 @@ def check(self):
12401240
self.check_exists('public/dists/maverick/main/binary-amd64/Packages')
12411241
self.check_exists('public/dists/maverick/main/binary-amd64/Packages.gz')
12421242
self.check_not_exists('public/dists/maverick/main/binary-amd64/Packages.bz2')
1243+
1244+
1245+
class PublishSnapshot41Test(BaseTest):
1246+
"""
1247+
publish snapshot: mirror with / in distribution
1248+
"""
1249+
configOverride = {"max-tries": 1}
1250+
fixtureGpg = True
1251+
fixtureCmds = [
1252+
"aptly -architectures='i386' mirror create -keyring=aptlytest.gpg -with-sources -filter='nginx | Priority (required)'" # continued on next line
1253+
" -filter-with-deps=true ps41 http://repo.aptly.info/system-tests/security.debian.org/debian-security buster/updates main",
1254+
"aptly mirror update -keyring=aptlytest.gpg ps41",
1255+
"aptly snapshot create snap41 from mirror ps41",
1256+
]
1257+
runCmd = "aptly publish snapshot -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec snap41"
1258+
gold_processor = BaseTest.expand_environ
1259+
1260+
def check(self):
1261+
super(PublishSnapshot41Test, self).check()
1262+
1263+
self.check_exists('public/dists/buster/updates/Release')
1264+
self.check_exists('public/dists/buster/updates/Release.gpg')
1265+
self.check_exists('public/dists/buster/updates/InRelease')
1266+
self.check_exists('public/dists/buster/updates/main/source/Release')
1267+
self.check_exists('public/dists/buster/updates/main/source/Sources')
1268+
self.check_exists('public/dists/buster/updates/main/source/Sources.gz')
1269+
self.check_exists('public/dists/buster/updates/main/source/Sources.bz2')
1270+
self.check_exists('public/dists/buster/updates/main/binary-i386/Packages')
1271+
self.check_exists('public/dists/buster/updates/main/binary-i386/Packages.gz')
1272+
self.check_exists('public/dists/buster/updates/main/binary-i386/Packages.bz2')
1273+
self.check_exists('public/dists/buster/updates/main/binary-i386/Release')
1274+
self.check_exists('public/dists/buster/updates/main/Contents-i386.gz')
1275+
self.check_exists('public/dists/buster/updates/Contents-i386.gz')
1276+
self.check_exists('public/pool/main/u/util-linux/bsdutils_2.33.1-0.1+deb10u1_i386.deb')
1277+
self.check_exists('public/pool/main/u/util-linux/fdisk_2.33.1-0.1+deb10u1_i386.deb')
1278+
self.check_exists('public/pool/main/u/util-linux/libblkid1_2.33.1-0.1+deb10u1_i386.deb')
1279+
self.check_exists('public/pool/main/u/util-linux/libfdisk1_2.33.1-0.1+deb10u1_i386.deb')
1280+
self.check_exists('public/pool/main/u/util-linux/libmount1_2.33.1-0.1+deb10u1_i386.deb')
1281+
self.check_exists('public/pool/main/u/util-linux/libsmartcols1_2.33.1-0.1+deb10u1_i386.deb')
1282+
self.check_exists('public/pool/main/u/util-linux/libuuid1_2.33.1-0.1+deb10u1_i386.deb')
1283+
self.check_exists('public/pool/main/u/util-linux/mount_2.33.1-0.1+deb10u1_i386.deb')
1284+
self.check_exists('public/pool/main/u/util-linux/util-linux_2.33.1-0.1+deb10u1_i386.deb')
1285+
self.check_exists('public/pool/main/d/dpkg/dpkg_1.19.8_i386.deb')
1286+
self.check_exists('public/pool/main/e/e2fsprogs/e2fslibs_1.44.5-1+deb10u2_i386.deb')
1287+
self.check_exists('public/pool/main/e/e2fsprogs/e2fsprogs_1.44.5-1+deb10u2_i386.deb')
1288+
self.check_exists('public/pool/main/e/e2fsprogs/libcom-err2_1.44.5-1+deb10u2_i386.deb')
1289+
self.check_exists('public/pool/main/e/e2fsprogs/libcomerr2_1.44.5-1+deb10u2_i386.deb')
1290+
self.check_exists('public/pool/main/e/e2fsprogs/libext2fs2_1.44.5-1+deb10u2_i386.deb')
1291+
self.check_exists('public/pool/main/e/e2fsprogs/libss2_1.44.5-1+deb10u2_i386.deb')
1292+
self.check_exists('public/pool/main/g/gzip/gzip_1.9-3+deb10u1_i386.deb')
1293+
self.check_exists('public/pool/main/g/glibc/libc-bin_2.28-10+deb10u2_i386.deb')
1294+
self.check_exists('public/pool/main/g/glibc/libc6_2.28-10+deb10u2_i386.deb')
1295+
self.check_exists('public/pool/main/g/glibc/multiarch-support_2.28-10+deb10u2_i386.deb')
1296+
self.check_exists('public/pool/main/b/bzip2/libbz2-1.0_1.0.6-9.2~deb10u2_i386.deb')
1297+
self.check_exists('public/pool/main/f/freetype/libfreetype6_2.9.1-3+deb10u2_i386.deb')
1298+
self.check_exists('public/pool/main/libg/libgd2/libgd3_2.2.5-5.2+deb10u1_i386.deb')
1299+
self.check_exists('public/pool/main/i/icu/libicu63_63.1-6+deb10u2_i386.deb')
1300+
self.check_exists('public/pool/main/l/lz4/liblz4-1_1.8.3-1+deb10u1_i386.deb')
1301+
self.check_exists('public/pool/main/x/xz-utils/liblzma5_5.2.4-1+deb10u1_i386.deb')
1302+
self.check_exists('public/pool/main/n/ncurses/libncursesw6_6.1+20181013-2+deb10u5_i386.deb')
1303+
self.check_exists('public/pool/main/n/ncurses/libtinfo5_6.1+20181013-2+deb10u5_i386.deb')
1304+
self.check_exists('public/pool/main/n/ncurses/libtinfo6_6.1+20181013-2+deb10u5_i386.deb')
1305+
self.check_exists('public/pool/main/n/ncurses/ncurses-base_6.1+20181013-2+deb10u5_all.deb')
1306+
self.check_exists('public/pool/main/n/ncurses/ncurses-bin_6.1+20181013-2+deb10u5_i386.deb')
1307+
self.check_exists('public/pool/main/n/nginx/libnginx-mod-http-auth-pam_1.14.2-2+deb10u5_i386.deb')
1308+
self.check_exists('public/pool/main/n/nginx/libnginx-mod-http-cache-purge_1.14.2-2+deb10u5_i386.deb')
1309+
self.check_exists('public/pool/main/n/nginx/libnginx-mod-http-dav-ext_1.14.2-2+deb10u5_i386.deb')
1310+
self.check_exists('public/pool/main/n/nginx/libnginx-mod-http-echo_1.14.2-2+deb10u5_i386.deb')
1311+
self.check_exists('public/pool/main/n/nginx/libnginx-mod-http-fancyindex_1.14.2-2+deb10u5_i386.deb')
1312+
self.check_exists('public/pool/main/n/nginx/libnginx-mod-http-geoip_1.14.2-2+deb10u5_i386.deb')
1313+
self.check_exists('public/pool/main/n/nginx/libnginx-mod-http-headers-more-filter_1.14.2-2+deb10u5_i386.deb')
1314+
self.check_exists('public/pool/main/n/nginx/libnginx-mod-http-image-filter_1.14.2-2+deb10u5_i386.deb')
1315+
self.check_exists('public/pool/main/n/nginx/libnginx-mod-http-lua_1.14.2-2+deb10u5_i386.deb')
1316+
self.check_exists('public/pool/main/n/nginx/libnginx-mod-http-ndk_1.14.2-2+deb10u5_i386.deb')
1317+
self.check_exists('public/pool/main/n/nginx/libnginx-mod-http-perl_1.14.2-2+deb10u5_i386.deb')
1318+
self.check_exists('public/pool/main/n/nginx/libnginx-mod-http-subs-filter_1.14.2-2+deb10u5_i386.deb')
1319+
self.check_exists('public/pool/main/n/nginx/libnginx-mod-http-uploadprogress_1.14.2-2+deb10u5_i386.deb')
1320+
self.check_exists('public/pool/main/n/nginx/libnginx-mod-http-upstream-fair_1.14.2-2+deb10u5_i386.deb')
1321+
self.check_exists('public/pool/main/n/nginx/libnginx-mod-http-xslt-filter_1.14.2-2+deb10u5_i386.deb')
1322+
self.check_exists('public/pool/main/n/nginx/libnginx-mod-mail_1.14.2-2+deb10u5_i386.deb')
1323+
self.check_exists('public/pool/main/n/nginx/libnginx-mod-nchan_1.14.2-2+deb10u5_i386.deb')
1324+
self.check_exists('public/pool/main/n/nginx/libnginx-mod-stream_1.14.2-2+deb10u5_i386.deb')
1325+
self.check_exists('public/pool/main/n/nginx/nginx_1.14.2-2+deb10u5_all.deb')
1326+
self.check_exists('public/pool/main/n/nginx/nginx_1.14.2-2+deb10u5.debian.tar.xz')
1327+
self.check_exists('public/pool/main/n/nginx/nginx_1.14.2-2+deb10u5.dsc')
1328+
self.check_exists('public/pool/main/n/nginx/nginx_1.14.2.orig.tar.gz')
1329+
self.check_exists('public/pool/main/n/nginx/nginx-common_1.14.2-2+deb10u5_all.deb')
1330+
self.check_exists('public/pool/main/n/nginx/nginx-extras_1.14.2-2+deb10u5_i386.deb')
1331+
self.check_exists('public/pool/main/n/nginx/nginx-full_1.14.2-2+deb10u5_i386.deb')
1332+
self.check_exists('public/pool/main/n/nginx/nginx-light_1.14.2-2+deb10u5_i386.deb')
1333+
self.check_exists('public/pool/main/o/openssl/libssl1.1_1.1.1n-0+deb10u6_i386.deb')
1334+
self.check_exists('public/pool/main/s/systemd/libsystemd0_241-7~deb10u10_i386.deb')
1335+
self.check_exists('public/pool/main/s/systemd/libudev1_241-7~deb10u10_i386.deb')
1336+
self.check_exists('public/pool/main/t/tiff/libtiff5_4.1.0+git191117-2~deb10u9_i386.deb')
1337+
self.check_exists('public/pool/main/t/tar/tar_1.30+dfsg-6+deb10u1_i386.deb')
1338+
self.check_exists('public/pool/main/t/tzdata/tzdata_2021a-0+deb10u12_all.deb')
1339+
self.check_exists('public/pool/main/libw/libwebp/libwebp6_0.6.1-2+deb10u3_i386.deb')
1340+
self.check_exists('public/pool/main/libx/libx11/libx11-6_1.6.7-1+deb10u4_i386.deb')
1341+
self.check_exists('public/pool/main/libx/libx11/libx11-data_1.6.7-1+deb10u4_all.deb')
1342+
self.check_exists('public/pool/main/libx/libxml2/libxml2_2.9.4+dfsg1-7+deb10u6_i386.deb')
1343+
self.check_exists('public/pool/main/libx/libxpm/libxpm4_3.5.12-1+deb10u2_i386.deb')
1344+
self.check_exists('public/pool/main/libx/libxslt/libxslt1.1_1.1.32-2.2~deb10u2_i386.deb')
1345+
self.check_exists('public/pool/main/libz/libzstd/libzstd1_1.3.8+dfsg-3+deb10u2_i386.deb')
1346+
self.check_exists('public/pool/main/z/zlib/zlib1g_1.2.11.dfsg-1+deb10u2_i386.deb')

0 commit comments

Comments
 (0)