mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-07-27 13:57:46 +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
|
||||
|
||||
|
||||
@@ -12,6 +13,13 @@ def sorted_processor(output):
|
||||
return "\n".join(sorted(output.split("\n")))
|
||||
|
||||
|
||||
def ungzip_if_required(output):
|
||||
if output.startswith("\x1f\x8b"):
|
||||
return zlib.decompress(output, 16+zlib.MAX_WBITS)
|
||||
|
||||
return output
|
||||
|
||||
|
||||
class PublishSnapshot1Test(BaseTest):
|
||||
"""
|
||||
publish snapshot: defaults
|
||||
@@ -55,6 +63,9 @@ class PublishSnapshot1Test(BaseTest):
|
||||
self.check_file_contents('public/dists/maverick/main/binary-i386/Packages', 'packages_i386', match_prepare=sorted_processor)
|
||||
self.check_file_contents('public/dists/maverick/main/binary-amd64/Packages', 'packages_amd64', match_prepare=sorted_processor)
|
||||
|
||||
self.check_file_contents('public/dists/maverick/main/Contents-i386.gz', 'contents_i386', match_prepare=ungzip_if_required)
|
||||
self.check_file_contents('public/dists/maverick/main/Contents-amd64.gz', 'contents_amd64', 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"),
|
||||
"--verify", os.path.join(os.environ["HOME"], ".aptly", 'public/dists/maverick/InRelease')])
|
||||
|
||||
Reference in New Issue
Block a user