l.a.t.t.TestUploadProcessor(TestUploadProcessorBase) : class documentation

Part of lp.archiveuploader.tests.test_uploadprocessor View In Hierarchy

Basic tests on uploadprocessor class.

This test case is able to setup a fresh distroseries in Ubuntu.

Method testInstantiate UploadProcessor should instantiate
Method testLocateDirectories Return a sorted list of subdirs in a directory.
Method testMoveUpload moveUpload should move the upload directory.
Method testMoveProcessUploadAccepted Undocumented
Method testMoveProcessUploadFailed moveProcessedUpload moves if the result was not successful.
Method testRemoveUpload RemoveUpload removes the upload directory.
Method testRejectionEmailForUnhandledException Test there's a rejection email when nascentupload breaks.
Method testUploadToFrozenDistro Uploads to a frozen distroseries should work, but be unapproved.
Method testCopyArchiveUploadToCurrentDistro Check binary copy archive uploads to RELEASE pockets.
Method testCopyArchiveUploadToSupportedDistro Check binary copy archive uploads to RELEASE pockets.
Method testDuplicatedBinaryUploadGetsRejected The upload processor rejects duplicated binary uploads.
Method testBinaryUploadToCopyArchive Copy archive binaries are not checked against the primary archive.
Method testPartnerArchiveMissingForPartnerUploadFails A missing partner archive should produce a rejection email.
Method testMixedPartnerUploadFails Uploads with partner and non-partner files are rejected.
Method testPartnerReusingOrigFromPartner Partner uploads reuse 'orig.tar.gz' from the partner archive.
Method testPartnerUpload Partner packages should be uploaded to the partner archive.
Method testUploadAncestry Check that an upload correctly finds any file ancestors.
Method testPartnerUploadToProposedPocket Upload a partner package to the proposed pocket.
Method testPartnerUploadToReleasePocketInStableDistroseries Partner package upload to release pocket in stable distroseries.
Method disabled_testPartnerUploadToNonReleaseOrProposedPocket Test partner upload pockets.
Method assertRejectionMessage Undocumented
Method testUploadWithUnknownSectionIsRejected Undocumented
Method testUploadWithMalformedSectionIsRejected Undocumented
Method testUploadWithUnknownComponentIsRejected Undocumented
Method testSourceUploadToBuilddPath Source uploads to buildd upload paths are not permitted.
Method checkComponentOverride Helper function to check overridden source component names.
Method testUploadContribComponentOverride Test the overriding of the contrib component on uploads.
Method testUploadNonfreeComponentOverride Test the overriding of the non-free component on uploads.
Method testUploadDefaultComponentOverride Test the overriding of the component on uploads.
Method checkBinaryComponentOverride Helper function to check overridden binary component names.
Method testBinaryPackageDefaultComponent The default component is universe.
Method testBinaryPackageSourcePublicationOverride The source publication's component is used.
Method testOopsCreation Test that an unhandled exception generates an OOPS.
Method testLZMADebUpload Make sure that data files compressed with lzma in Debs work.
Method testXZDebUpload Make sure that data files compressed with xz in Debs work.
Method testSourceUploadWithoutBinaryField Source uploads may omit the Binary field.
Method testUploadResultingInNoBuilds Source uploads resulting in no builds.
Method testPackageUploadPermissions Test package-specific upload permissions.
Method testPackagesetUploadPermissions Test package set based upload permissions.
Method testUploadPathErrorIntendedForHumans Undocumented
Method test30QuiltUploadToUnsupportingSeriesIsRejected Ensure that uploads to series without format support are rejected.
Method test30QuiltUpload Ensure that 3.0 (quilt) uploads work properly.
Method test30QuiltUploadWithSameComponentOrig Ensure that 3.0 (quilt) uploads with shared component origs work.
Method test30NativeUpload Ensure that 3.0 (native) uploads work properly.
Method test10Bzip2UploadIsRejected Ensure that 1.0 sources with bzip2 compression are rejected.
Method testUploadToWrongPocketIsRejected Undocumented
Method testPGPSignatureNotPreserved PGP signatures should be removed from .changes files.
Method test_unsigned_upload_is_silently_rejected Undocumented
Method test_deactivated_key_upload_sends_mail Undocumented
Method test_expired_key_upload_sends_mail Undocumented
Method test_ddeb_upload_overrides Undocumented
Method test_redirect_release_uploads Undocumented
Method test_source_buildinfo Undocumented
Method test_binary_buildinfo Undocumented
Method test_binary_buildinfo_arch_indep Undocumented
Method _checkPartnerUploadEmailSuccess Ensure partner uploads generate the right email.
Method _makeUpload Create a dummy upload for testing the move/remove methods.
Method _checkCopyArchiveUploadToDistro Check binary copy archive uploads for given pocket and status.
Method _uploadPartnerToNonReleasePocketAndCheckFail Upload partner package to non-release pocket.

Inherited from TestUploadProcessorBase:

Method switchToUploader Undocumented
Method switchToAdmin Undocumented
Method setUp Undocumented
Method tearDown Undocumented
Method getUploadProcessor Undocumented
Method publishPackage Publish a single package that is currently NEW in the queue.
Method assertLogContains Assert if a given line is present in the log messages.
Method assertRaisesAndReturnError See TestCase.assertRaises.
Method setupBreezy Create a fresh distroseries in ubuntu.
Method addMockFile Return a librarian file.
Method queueUpload Queue one of our test uploads.
Method processUpload Process an upload queue entry directory.
Method setupBreezyAndGetUploadProcessor Setup Breezy and return an upload processor for it.
Method assertEmails Check recent email content and recipients.
Method PGPSignatureNotPreserved PGP signatures should be removed from .changes files.

Inherited from TestCaseWithFactory (via TestUploadProcessorBase):

Method getUserBrowser Return a Browser logged in as a fresh user, maybe opened at url.
Method getNonRedirectingBrowser Undocumented
Method createBranchAtURL Create a branch at the supplied URL.
Method create_branch_and_tree Create a database branch, bzr branch and bzr checkout.
Method createBzrBranch Create a bzr branch for a database branch.
Static Method getBranchPath Return the path of the branch in the mirrored area.
Method useTempBzrHome Undocumented
Method useBzrBranches Prepare for using bzr branches.

Inherited from TestCase (via TestUploadProcessorBase, TestCaseWithFactory):

Method becomeDbUser Commit, then log into the database as dbuser.
Method __str__ The string representation of a test is its id.
Method useContext Use the supplied context in this test.
Method makeTemporaryDirectory Create a temporary directory, and return its path.
Method installKarmaRecorder Set up and return a KarmaRecorder.
Method assertProvides Assert 'obj' correctly provides 'interface'.
Method assertNotifies Assert that a callable performs a given notification.
Method assertNoNotification Assert that no notifications are generated by the callable.
Method assertSqlAttributeEqualsDate Fail unless the value of the attribute is equal to the date.
Method assertTextMatchesExpressionIgnoreWhitespace Undocumented
Method assertIsInstance Assert that an instance is an instance of assert_class.
Method assertIsNot Assert that expected is not the same object as observed.
Method assertContentEqual Assert that 'iter1' has the same content as 'iter2'.
Method assertRaisesWithContent Check if the given exception is raised with given content.
Method assertBetween Assert that 'variable' is strictly between two boundaries.
Method assertVectorEqual Apply assertEqual to all given pairs in one go.
Method expectedLog Expect a log to be written that matches the regex.
Method pushConfig Push some key-value pairs into a section of the config.
Method attachOopses Undocumented
Method attachLibrarianLog Include the logChunks from fixture in the test details.
Method assertStatementCount Assert that the expected number of SQL statements occurred.
Method useTempDir Use a temporary directory for this test.
Method assertEmailHeadersEqual Assert that two email headers are equal.
Method assertStartsWith Undocumented
Method assertEndsWith Asserts that s ends with suffix.
Method checkPermissions Check if the used_permissions match expected_permissions.
Method assertEmailQueueLength Pop the email queue, assert its length, and return it.
Method _unfoldEmailHeader Unfold a multiline email header.
def _checkPartnerUploadEmailSuccess(self):
Ensure partner uploads generate the right email.
def testInstantiate(self):
UploadProcessor should instantiate
def testLocateDirectories(self):
Return a sorted list of subdirs in a directory.
def _makeUpload(self, testdir):
Create a dummy upload for testing the move/remove methods.
def testMoveUpload(self):
moveUpload should move the upload directory.
def testMoveProcessUploadAccepted(self):
Undocumented
def testMoveProcessUploadFailed(self):
moveProcessedUpload moves if the result was not successful.
def testRemoveUpload(self):
RemoveUpload removes the upload directory.
def testRejectionEmailForUnhandledException(self):
Test there's a rejection email when nascentupload breaks.

If a developer makes an upload which finds a bug in nascentupload, and an unhandled exception occurs, we should try to send a rejection email. We'll test that this works, in a case where we will have the right information to send the email before the error occurs.

If we haven't extracted enough information to send a rejection email when things break, trying to send one will raise a new exception, and the upload will fail silently as before. We don't test this case.

See bug 35965.

def testUploadToFrozenDistro(self):
Uploads to a frozen distroseries should work, but be unapproved.

The rule for a frozen distroseries is that uploads should still be permitted, but that the usual rule for auto-accepting uploads of existing packages should be suspended. New packages will still go into NEW, but new versions will be UNAPPROVED, rather than ACCEPTED.

To test this, we will upload two versions of the same package, accepting and publishing the first, and freezing the distroseries before the second. If all is well, the second upload should go through ok, but end up in status UNAPPROVED, and with the appropriate email contents.

See bug 58187.

def _checkCopyArchiveUploadToDistro(self, pocket_to_check, status_to_check):
Check binary copy archive uploads for given pocket and status.

This helper method tests that buildd binary uploads to copy
archives work when the
    * destination pocket is `pocket_to_check`
    * associated distroseries is in state `status_to_check`.

See bug 369512.
def testCopyArchiveUploadToCurrentDistro(self):
Check binary copy archive uploads to RELEASE pockets.

Buildd binary uploads to COPY archives (resulting from successful builds) should be allowed to go to the RELEASE pocket even though the distro series has a CURRENT status.

See bug 369512.

def testCopyArchiveUploadToSupportedDistro(self):
Check binary copy archive uploads to RELEASE pockets.

Buildd binary uploads to COPY archives (resulting from successful builds) should be allowed to go to the RELEASE pocket even though the distro series has a SUPPORTED status.

See bug 369512.

def testDuplicatedBinaryUploadGetsRejected(self):
The upload processor rejects duplicated binary uploads.

Duplicated binary uploads should be rejected, because they can't be published on disk, since it will be introducing different contents to the same filename in the archive.

Such situation happens when a source gets copied to another suite in the same archive. The binary rebuild will have the same (name, version) of the original binary and will certainly have a different content (at least, the ar-compressed timestamps) making it impossible to be published in the archive.

def testBinaryUploadToCopyArchive(self):
Copy archive binaries are not checked against the primary archive.

When a buildd binary upload to a copy archive is performed the version should not be checked against the primary archive but against the copy archive in question.

def testPartnerArchiveMissingForPartnerUploadFails(self):
A missing partner archive should produce a rejection email.

If the partner archive is missing (i.e. there is a data problem) when a partner package is uploaded to it, a sensible rejection error email should be generated.

def testMixedPartnerUploadFails(self):
Uploads with partner and non-partner files are rejected.

Test that a package that has partner and non-partner files in it is rejected. Partner uploads should be entirely partner.

def testPartnerReusingOrigFromPartner(self):
Partner uploads reuse 'orig.tar.gz' from the partner archive.
def testPartnerUpload(self):
Partner packages should be uploaded to the partner archive.

Packages that have files in the 'partner' component should be uploaded to a separate IArchive that has a purpose of ArchivePurpose.PARTNER.

def testUploadAncestry(self):
Check that an upload correctly finds any file ancestors.

When uploading a package, any previous versions will have ancestor files which affects whether this upload is NEW or not. In particular, when an upload's archive has been overridden, we must make sure that the ancestry check looks in all the distro archives. This can be done by two partner package uploads, as partner packages have their archive overridden.

def testPartnerUploadToProposedPocket(self):
Upload a partner package to the proposed pocket.
def testPartnerUploadToReleasePocketInStableDistroseries(self):
Partner package upload to release pocket in stable distroseries.

Uploading a partner package to the release pocket in a stable distroseries is allowed.

def _uploadPartnerToNonReleasePocketAndCheckFail(self):
Upload partner package to non-release pocket.

Helper function to upload a partner package to a non-release pocket and ensure it fails.

def disabled_testPartnerUploadToNonReleaseOrProposedPocket(self):
Test partner upload pockets.

Partner uploads must be targeted to the RELEASE pocket only,

def assertRejectionMessage(self, uploadprocessor, msg, with_file=True):
Undocumented
def testUploadWithUnknownSectionIsRejected(self):
Undocumented
def testUploadWithMalformedSectionIsRejected(self):
Undocumented
def testUploadWithUnknownComponentIsRejected(self):
Undocumented
def testSourceUploadToBuilddPath(self):
Source uploads to buildd upload paths are not permitted.
def checkComponentOverride(self, upload_dir_name, expected_component_name):
Helper function to check overridden source component names.

Upload a 'bar' package from upload_dir_name, then inspect the package 'bar' in the NEW queue and ensure its overridden component matches expected_component_name.

The original component comes from the source package contained in upload_dir_name.

def testUploadContribComponentOverride(self):
Test the overriding of the contrib component on uploads.
def testUploadNonfreeComponentOverride(self):
Test the overriding of the non-free component on uploads.
def testUploadDefaultComponentOverride(self):
Test the overriding of the component on uploads.

Components other than non-free and contrib should override to universe.

def checkBinaryComponentOverride(self, component_override=None, expected_component_name='universe'):
Helper function to check overridden binary component names.

Upload a 'bar' package from upload_dir_name, publish it, and then override the publication's component. When the binary release is published, it's component correspond to the source publication's component.

The original component comes from the source package contained in upload_dir_name.

def testBinaryPackageDefaultComponent(self):
The default component is universe.
def testBinaryPackageSourcePublicationOverride(self):
The source publication's component is used.
def testOopsCreation(self):
Test that an unhandled exception generates an OOPS.
def testLZMADebUpload(self):
Make sure that data files compressed with lzma in Debs work.

Each Deb contains a data.tar.xxx file where xxx is one of gz, bz2, lzma or xz. Here we make sure that lzma works.

def testXZDebUpload(self):
Make sure that data files compressed with xz in Debs work.

Each Deb contains a data.tar.xxx file where xxx is one of gz, bz2, lzma or xz. Here we make sure that xz works.

def testSourceUploadWithoutBinaryField(self):
Source uploads may omit the Binary field.

dpkg >= 1.19.3 omits the Binary field (as well as Description) from sourceful .changes files, so don't require it.

def testUploadResultingInNoBuilds(self):
Source uploads resulting in no builds.

Source uploads building only in unsupported architectures are accepted in primary archives.

If a new source upload results in no builds, it can be accepted from queue.

If a auto-accepted source upload results in no builds, like a known ubuntu or a PPA upload, it will made its way to the repository.

This scenario usually happens for sources targeted to architectures not yet supported in ubuntu, but for which we have plans to support soon.

Once a chroot is available for the architecture being prepared, a queue-builder run will be required to create the missing builds.

def testPackageUploadPermissions(self):
Test package-specific upload permissions.

Someone who has upload permissions to a component, but also has permission to a specific package in a different component should be able to upload that package. (Bug #250618)

def testPackagesetUploadPermissions(self):
Test package set based upload permissions.
def testUploadPathErrorIntendedForHumans(self):
Undocumented
def test30QuiltUploadToUnsupportingSeriesIsRejected(self):
Ensure that uploads to series without format support are rejected.

Series can restrict the source formats that they accept. Uploads should be rejected if an unsupported format is uploaded.

def test30QuiltUpload(self):
Ensure that 3.0 (quilt) uploads work properly.
def test30QuiltUploadWithSameComponentOrig(self):
Ensure that 3.0 (quilt) uploads with shared component origs work.
def test30NativeUpload(self):
Ensure that 3.0 (native) uploads work properly.
def test10Bzip2UploadIsRejected(self):
Ensure that 1.0 sources with bzip2 compression are rejected.
def testUploadToWrongPocketIsRejected(self):
Undocumented
def testPGPSignatureNotPreserved(self):
PGP signatures should be removed from .changes files.

Email notifications and the librarian file for the .changes file should both have the PGP signature removed.

def test_unsigned_upload_is_silently_rejected(self):
Undocumented
def test_deactivated_key_upload_sends_mail(self):
Undocumented
def test_expired_key_upload_sends_mail(self):
Undocumented
def test_ddeb_upload_overrides(self):
Undocumented
def test_redirect_release_uploads(self):
Undocumented
def test_source_buildinfo(self):
Undocumented
def test_binary_buildinfo(self):
Undocumented
def test_binary_buildinfo_arch_indep(self):
Undocumented
API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.