Merge lp:~stevenk/launchpad/copies-into-derived-series-fix into lp:launchpad

Proposed by Steve Kowalik
Status: Merged
Approved by: Steve Kowalik
Approved revision: no longer in the source branch.
Merged at revision: 13116
Proposed branch: lp:~stevenk/launchpad/copies-into-derived-series-fix
Merge into: lp:launchpad
Diff against target: 34 lines (+14/-0)
2 files modified
database/schema/security.cfg (+1/-0)
lib/lp/soyuz/scripts/tests/test_copypackage.py (+13/-0)
To merge this branch: bzr merge lp:~stevenk/launchpad/copies-into-derived-series-fix
Reviewer Review Type Date Requested Status
Jeroen T. Vermeulen (community) code Approve
Review via email: mp+62228@code.launchpad.net

Commit message

[r=jtv][bug=787904] Allow copies into derived series using the copy-package.py db user.

Description of the change

While QAing other work yesterday, I tripped over this. Add a test to make sure we can copy into a derived series, and give archivepublisher permission to SELECT from distroseriesparent.

To post a comment you must log in.
Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

One note: my only hint about what the test is specifically good for is in this MP. Could you rename the test and/or add a comment to say not what kind of scenario the test goes through, but what fact the test is meant to establish?

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'database/schema/security.cfg'
--- database/schema/security.cfg 2011-05-19 14:14:36 +0000
+++ database/schema/security.cfg 2011-05-25 03:42:33 +0000
@@ -834,6 +834,7 @@
834public.cve = SELECT, INSERT834public.cve = SELECT, INSERT
835public.distributionjob = SELECT, INSERT, DELETE835public.distributionjob = SELECT, INSERT, DELETE
836public.distributionsourcepackage = SELECT, INSERT, UPDATE836public.distributionsourcepackage = SELECT, INSERT, UPDATE
837public.distroseriesparent = SELECT
837public.flatpackagesetinclusion = SELECT, INSERT, UPDATE, DELETE838public.flatpackagesetinclusion = SELECT, INSERT, UPDATE, DELETE
838public.gpgkey = SELECT, INSERT, UPDATE839public.gpgkey = SELECT, INSERT, UPDATE
839public.job = SELECT, INSERT, UPDATE840public.job = SELECT, INSERT, UPDATE
840841
=== modified file 'lib/lp/soyuz/scripts/tests/test_copypackage.py'
--- lib/lp/soyuz/scripts/tests/test_copypackage.py 2011-05-23 10:18:53 +0000
+++ lib/lp/soyuz/scripts/tests/test_copypackage.py 2011-05-25 03:42:33 +0000
@@ -1364,6 +1364,19 @@
1364 self.assertComponentSectionAndPriority(1364 self.assertComponentSectionAndPriority(
1365 main, bin_hppa, copied_bin_hppa)1365 main, bin_hppa, copied_bin_hppa)
13661366
1367 def test_copy_into_derived_series(self):
1368 # We are able to successfully copy into a derived series.
1369 archive = self.test_publisher.ubuntutest.main_archive
1370 source = self.test_publisher.getPubSource(
1371 archive=archive, version='1.0-2', architecturehintlist='any')
1372 dsp = self.factory.makeDistroSeriesParent()
1373 target_archive = dsp.derived_series.main_archive
1374 self.layer.txn.commit()
1375 self.layer.switchDbUser('archivepublisher')
1376 # The real test is that the doCopy doesn't fail.
1377 [copied_source] = self.doCopy(
1378 source, target_archive, dsp.derived_series, source.pocket, False)
1379
13671380
1368class TestDoDelayedCopy(TestCaseWithFactory, BaseDoCopyTests):1381class TestDoDelayedCopy(TestCaseWithFactory, BaseDoCopyTests):
13691382