daklib.checks

module provided pre-acceptance tests

Please read the documentation for the Check class for the interface.

Functions

check_fields_for_valid_utf8(filename, control)

Check all fields of a control file for valid UTF-8

Classes

ACLCheck()

Check the uploader is allowed to upload the packages in .changes

ArchAllBinNMUCheck()

Check for arch:all binNMUs

BinaryCheck()

Check binary packages for syntax errors.

BinaryMembersCheck()

check members of .deb file

BinaryTimestampCheck()

check timestamps of files in binary packages

ChangesCheck()

Check changes file for syntax errors.

Check()

base class for checks

ExternalHashesCheck()

Checks hashes in .changes and .dsc against an external database.

LintianCheck()

Check package using lintian

NewOverrideCheck()

Override NEW requirement

NoSourceOnlyCheck()

SignatureAndHashesCheck()

Check signature of changes and dsc file (if included in upload)

SignatureTimestampCheck()

Check timestamp of .changes signature

SingleDistributionCheck()

Check that the .changes targets only a single distribution.

SourceCheck()

Check source package for syntax errors.

SourceFormatCheck()

Check source format is allowed in the target suite

SuiteArchitectureCheck()

SuiteCheck()

TransitionCheck()

check for a transition

VersionCheck()

Check version constraints

WeakSignatureCheck()

Check that .changes and .dsc are not signed using a weak algorithm

Exceptions

Reject

exception raised by failing checks

RejectACL(acl, reason)

exception raise by failing ACL checks

RejectExternalFilesMismatch

exception raised by failing the external hashes check

class daklib.checks.ACLCheck[source]

Check the uploader is allowed to upload the packages in .changes

_check_acl(session, upload, acl)[source]
_does_hijack(session, upload, suite)[source]
check(upload)[source]

do checks

Parameters:

upload – upload to check

Raises:

Reject – upload should be rejected

per_suite_check(upload, suite)[source]

do per-suite checks

Parameters:
  • upload – upload to check

  • suite – suite to check

Raises:

Reject – upload should be rejected

class daklib.checks.ArchAllBinNMUCheck[source]

Check for arch:all binNMUs

check(upload)[source]

do checks

Parameters:

upload – upload to check

Raises:

Reject – upload should be rejected

class daklib.checks.BinaryCheck[source]

Check binary packages for syntax errors.

check(upload)[source]

do checks

Parameters:

upload – upload to check

Raises:

Reject – upload should be rejected

check_binary(upload, binary)[source]
class daklib.checks.BinaryMembersCheck[source]

check members of .deb file

_check_binary(filename: str, path: str) None[source]
check(upload)[source]

do checks

Parameters:

upload – upload to check

Raises:

Reject – upload should be rejected

class daklib.checks.BinaryTimestampCheck[source]

check timestamps of files in binary packages

Files in the near future cause ugly warnings and extreme time travel can cause errors on extraction.

check(upload)[source]

do checks

Parameters:

upload – upload to check

Raises:

Reject – upload should be rejected

class daklib.checks.ChangesCheck[source]

Check changes file for syntax errors.

check(upload)[source]

do checks

Parameters:

upload – upload to check

Raises:

Reject – upload should be rejected

class daklib.checks.Check[source]

base class for checks

checks are called by daklib.archive.ArchiveUpload. Failing tests should raise a daklib.checks.Reject exception including a human-readable description why the upload should be rejected.

check(upload: ArchiveUpload)[source]

do checks

Parameters:

upload – upload to check

Raises:

Reject – upload should be rejected

property forcable: bool

allow to force ignore failing test

True if it is acceptable to force ignoring a failing test, False otherwise

per_suite_check(upload: ArchiveUpload, suite: Suite)[source]

do per-suite checks

Parameters:
  • upload – upload to check

  • suite – suite to check

Raises:

Reject – upload should be rejected

class daklib.checks.ExternalHashesCheck[source]

Checks hashes in .changes and .dsc against an external database.

check(upload)[source]

do checks

Parameters:

upload – upload to check

Raises:

Reject – upload should be rejected

check_single(session, f)[source]
class daklib.checks.LintianCheck[source]

Check package using lintian

check(upload)[source]

do checks

Parameters:

upload – upload to check

Raises:

Reject – upload should be rejected

class daklib.checks.NewOverrideCheck[source]

Override NEW requirement

check(upload)[source]

do checks

Parameters:

upload – upload to check

Raises:

Reject – upload should be rejected

class daklib.checks.NoSourceOnlyCheck[source]
check(upload)[source]

do checks

Parameters:

upload – upload to check

Raises:

Reject – upload should be rejected

is_source_only_upload(upload) bool[source]
exception daklib.checks.Reject[source]

exception raised by failing checks

exception daklib.checks.RejectACL(acl, reason)[source]

exception raise by failing ACL checks

exception daklib.checks.RejectExternalFilesMismatch[source]

exception raised by failing the external hashes check

class daklib.checks.SignatureAndHashesCheck[source]

Check signature of changes and dsc file (if included in upload)

Make sure the signature is valid and done by a known user.

_check_hashes(upload: ArchiveUpload, filename: str, files: Iterable[HashedFile])[source]

Make sure hashes match existing files

Parameters:
  • upload – upload we are processing

  • filename – name of the file the expected hash values are taken from

  • files – files to check the hashes for

check(upload)[source]

do checks

Parameters:

upload – upload to check

Raises:

Reject – upload should be rejected

check_replay(upload) bool[source]
class daklib.checks.SignatureTimestampCheck[source]

Check timestamp of .changes signature

check(upload)[source]

do checks

Parameters:

upload – upload to check

Raises:

Reject – upload should be rejected

class daklib.checks.SingleDistributionCheck[source]

Check that the .changes targets only a single distribution.

check(upload)[source]

do checks

Parameters:

upload – upload to check

Raises:

Reject – upload should be rejected

class daklib.checks.SourceCheck[source]

Check source package for syntax errors.

check(upload)[source]

do checks

Parameters:

upload – upload to check

Raises:

Reject – upload should be rejected

check_filename(control, filename, regex: Pattern) None[source]
class daklib.checks.SourceFormatCheck[source]

Check source format is allowed in the target suite

per_suite_check(upload, suite)[source]

do per-suite checks

Parameters:
  • upload – upload to check

  • suite – suite to check

Raises:

Reject – upload should be rejected

class daklib.checks.SuiteArchitectureCheck[source]
per_suite_check(upload, suite)[source]

do per-suite checks

Parameters:
  • upload – upload to check

  • suite – suite to check

Raises:

Reject – upload should be rejected

class daklib.checks.SuiteCheck[source]
per_suite_check(upload, suite)[source]

do per-suite checks

Parameters:
  • upload – upload to check

  • suite – suite to check

Raises:

Reject – upload should be rejected

class daklib.checks.TransitionCheck[source]

check for a transition

check(upload)[source]

do checks

Parameters:

upload – upload to check

Raises:

Reject – upload should be rejected

get_transitions()[source]
class daklib.checks.VersionCheck[source]

Check version constraints

_highest_binary_version(session, binary_name, suite, architecture)[source]
_highest_source_version(session, source_name, suite)[source]
_version_checks(upload, suite, other_suite, op, op_name)[source]
property forcable: bool

allow to force ignore failing test

True if it is acceptable to force ignoring a failing test, False otherwise

per_suite_check(upload, suite)[source]

do per-suite checks

Parameters:
  • upload – upload to check

  • suite – suite to check

Raises:

Reject – upload should be rejected

class daklib.checks.WeakSignatureCheck[source]

Check that .changes and .dsc are not signed using a weak algorithm

check(upload)[source]

do checks

Parameters:

upload – upload to check

Raises:

Reject – upload should be rejected

daklib.checks.check_fields_for_valid_utf8(filename, control)[source]

Check all fields of a control file for valid UTF-8