mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-07-16 12:08:04 +00:00
Check contents of contents index being generated. #142
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import os
|
||||
import hashlib
|
||||
import inspect
|
||||
import zlib
|
||||
from lib import BaseTest
|
||||
|
||||
|
||||
@@ -8,6 +9,13 @@ def strip_processor(output):
|
||||
return "\n".join([l for l in output.split("\n") if not l.startswith(' ') and not l.startswith('Date:')])
|
||||
|
||||
|
||||
def ungzip_if_required(output):
|
||||
if output.startswith("\x1f\x8b"):
|
||||
return zlib.decompress(output, 16+zlib.MAX_WBITS)
|
||||
|
||||
return output
|
||||
|
||||
|
||||
class PublishRepo1Test(BaseTest):
|
||||
"""
|
||||
publish repo: default
|
||||
@@ -44,6 +52,7 @@ class PublishRepo1Test(BaseTest):
|
||||
self.check_file_contents('public/dists/maverick/Release', 'release', match_prepare=strip_processor)
|
||||
self.check_file_contents('public/dists/maverick/main/source/Sources', 'sources', match_prepare=lambda s: "\n".join(sorted(s.split("\n"))))
|
||||
self.check_file_contents('public/dists/maverick/main/binary-i386/Packages', 'binary', match_prepare=lambda s: "\n".join(sorted(s.split("\n"))))
|
||||
self.check_file_contents('public/dists/maverick/main/Contents-i386.gz', 'contents_i386', match_prepare=ungzip_if_required)
|
||||
|
||||
# verify signatures
|
||||
self.run_cmd(["gpg", "--no-auto-check-trustdb", "--keyring", os.path.join(os.path.dirname(inspect.getsourcefile(BaseTest)), "files", "aptly.pub"),
|
||||
|
||||
Reference in New Issue
Block a user