l.s.s.t.t.TestPopulateArchiveScript(TestCaseWithFactory) : class documentation

Part of lp.soyuz.scripts.tests.test_populatearchive View In Hierarchy

Test the populate-archive.py script.
Method runWrapperScript Run populate-archive.py, returning the result and output.
Method getScript Return an ArchivePopulator instance.
Method testCopyArchiveCreation Start archive population, check data before and after.
Method runScript Run the script to test.
Method testInvalidCopyArchiveName Try copy archive creation/population with an invalid archive name.
Method testInvalidSuite Try copy archive creation/population with a non-existent suite.
Method testInvalidUserName Try copy archive population with an invalid user name.
Method testUnknownPackagesetName Try copy archive population with an unknown packageset name.
Method testNonvirtualized --nonvirtualized means the archive won't require virtualization.
Method testPackagesetDelta Try to calculate the delta between two source package sets.
Method testMergeCopy Try repeated copy archive population (merge copy).
Method testUnknownOriginArchive Try copy archive population with a unknown origin archive.
Method testUnknownOriginPPA Try copy archive population with an invalid PPA owner name.
Method testInvalidOriginArchiveName Try copy archive population with an invalid origin archive name.
Method testInvalidProcessorName Try copy archive population with an invalid architecture tag.
Method testProcessorsForExistingArchives Try specifying processor names for existing archive.
Method testMissingCreationReason Try copy archive population without a copy archive creation reason.
Method testMergecopyToMissingArchive Try merge copy to non-existent archive.
Method testArchiveNameClash Try creating an archive with same name and distribution twice.
Method testMissingProcessor Try copy archive population without a single architecture tag.
Method testBuildsPendingAndSuspended All builds in the new copy archive are pending and suspended.
Method testPrivateOriginArchive Try copying from a private archive.
Method testDisabledDestinationArchive Try copying to a disabled archive.
Method _verifyClonedSourcePackages Verify that the expected source packages have been cloned.
Method _getPendingPackageNames Undocumented
Method _prepareMergeCopy Add a fresher and a new package to ubuntu/hoary.
Method _verifyPackagesInSampleData Verify that the expected source packages are in the sample data.

Inherited from TestCaseWithFactory:

Method setUp Undocumented
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 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 runWrapperScript(self, extra_args=None):
Run populate-archive.py, returning the result and output.

Runs the wrapper script using Popen(), returns a tuple of the process's return code, stdout output and stderr output.

def getScript(self, test_args=None):
Return an ArchivePopulator instance.
def testCopyArchiveCreation(self):
Start archive population, check data before and after.

Use the hoary-RELEASE suite along with the main component.

def runScript(self, archive_name=None, suite='hoary', user='salgado', exists_before=None, exists_after=None, exception_type=None, exception_text=None, extra_args=None, copy_archive_name=None, reason=None, output_substr=None, nonvirtualized=False):
Run the script to test.
Parametersarchive_namethe name of the copy archive to create. (type: str)
suitethe name of the copy archive suite. (type: str)
userthe name of the user creating the archive. (type: str)
exists_beforecopy archive with given name should already exist if True. (type: bool)
exists_afterthe copy archive is expected to exist after script invocation if True. (type: True)
exception_typethe type of exception expected in case of failure. (type: type)
exception_textexpected exception text prefix in case of failure. (type: str)
extra_argsadditional arguments to be passed to the script (if any). (type: list of strings)
copy_archive_nameoptional copy archive instance, used for merge copy testing. (type: IArchive)
reasonif empty do not provide '--reason' cmd line arg to the script
output_substrthis must be part of the script's output
def testInvalidCopyArchiveName(self):
Try copy archive creation/population with an invalid archive name.

When trying to create and populate a copy archive with an invalid name the script should fail with an appropriate error message.

def testInvalidSuite(self):
Try copy archive creation/population with a non-existent suite.

A suite is a combination of a distro series and pocket e.g. hoary-updates or hardy-security. In the case where a non-existent suite is specified the script should abort with an appropriate error message.

def testInvalidUserName(self):
Try copy archive population with an invalid user name.

The destination/copy archive will be created for some Launchpad user. If the user name passed is invalid the script should abort with an appropriate error message.

def testUnknownPackagesetName(self):
Try copy archive population with an unknown packageset name.

The caller can request copying specific packagesets. We test what happens if they request a packageset that doesn't exist.

def testNonvirtualized(self):
--nonvirtualized means the archive won't require virtualization.
def testPackagesetDelta(self):
Try to calculate the delta between two source package sets.
def testMergeCopy(self):
Try repeated copy archive population (merge copy).

In this (test) case an archive is populated twice and only fresher or new packages are copied to it.

def testUnknownOriginArchive(self):
Try copy archive population with a unknown origin archive.

This test should provoke a SoyuzScriptError exception.

def testUnknownOriginPPA(self):
Try copy archive population with an invalid PPA owner name.

This test should provoke a SoyuzScriptError exception.

def testInvalidOriginArchiveName(self):
Try copy archive population with an invalid origin archive name.

This test should provoke a SoyuzScriptError exception.

def testInvalidProcessorName(self):
Try copy archive population with an invalid architecture tag.

This test should provoke a SoyuzScriptError exception.

def testProcessorsForExistingArchives(self):
Try specifying processor names for existing archive.

The user is not supposed to specify processor on the command line for existing copy archives. The processor will be read from the database instead. Please see also the end of the testMultipleArchTags test.

This test should provoke a SoyuzScriptError exception.

def testMissingCreationReason(self):
Try copy archive population without a copy archive creation reason.

This test should provoke a SoyuzScriptError exception because the copy archive does not exist yet and will need to be created.

This is different from a merge copy scenario where the destination copy archive exists already and hence no archive creation reason is needed.

def testMergecopyToMissingArchive(self):
Try merge copy to non-existent archive.

This test should provoke a SoyuzScriptError exception because the copy archive does not exist yet and we specified the '--merge-copy' command line option. The latter specifies the repeated population of existing archives.

def testArchiveNameClash(self):
Try creating an archive with same name and distribution twice.

This test should provoke a SoyuzScriptError exception because there is a uniqueness constraint based on (distribution, name) for all non-PPA archives i.e. we do not allow the creation of a second archive with the same name and distribution.

def testMissingProcessor(self):
Try copy archive population without a single architecture tag.

This test should provoke a SoyuzScriptError exception.

def testBuildsPendingAndSuspended(self):
All builds in the new copy archive are pending and suspended.
def testPrivateOriginArchive(self):
Try copying from a private archive.

This test should provoke a SoyuzScriptError exception because presently copy archives can only be created as public archives. The copying of packages from private archives to public ones thus constitutes a security breach.

def testDisabledDestinationArchive(self):
Try copying to a disabled archive.

This test should provoke a SoyuzScriptError exception because the destination archive is disabled.

def _verifyClonedSourcePackages(self, copy_archive, series, obsolete=None, new=None):
Verify that the expected source packages have been cloned.

The destination copy archive should be populated with the expected source packages.

Parameterscopy_archivethe destination copy archive to check. (type: Archive)
seriesthe destination distro series. (type: DistroSeries)
def _getPendingPackageNames(self, archive, series):
Undocumented
def _prepareMergeCopy(self):
Add a fresher and a new package to ubuntu/hoary.

This is used to test merge copy functionality.

def _verifyPackagesInSampleData(self, series, archive_name=None):
Verify that the expected source packages are in the sample data.
Parametersseriesthe origin distro series. (type: DistroSeries)
API Documentation for Launchpad, generated by pydoctor at 2019-07-23 00:00:05.