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
1=== modified file 'database/schema/security.cfg'
2--- database/schema/security.cfg 2011-05-19 14:14:36 +0000
3+++ database/schema/security.cfg 2011-05-25 03:42:33 +0000
4@@ -834,6 +834,7 @@
5 public.cve = SELECT, INSERT
6 public.distributionjob = SELECT, INSERT, DELETE
7 public.distributionsourcepackage = SELECT, INSERT, UPDATE
8+public.distroseriesparent = SELECT
9 public.flatpackagesetinclusion = SELECT, INSERT, UPDATE, DELETE
10 public.gpgkey = SELECT, INSERT, UPDATE
11 public.job = SELECT, INSERT, UPDATE
12
13=== modified file 'lib/lp/soyuz/scripts/tests/test_copypackage.py'
14--- lib/lp/soyuz/scripts/tests/test_copypackage.py 2011-05-23 10:18:53 +0000
15+++ lib/lp/soyuz/scripts/tests/test_copypackage.py 2011-05-25 03:42:33 +0000
16@@ -1364,6 +1364,19 @@
17 self.assertComponentSectionAndPriority(
18 main, bin_hppa, copied_bin_hppa)
19
20+ def test_copy_into_derived_series(self):
21+ # We are able to successfully copy into a derived series.
22+ archive = self.test_publisher.ubuntutest.main_archive
23+ source = self.test_publisher.getPubSource(
24+ archive=archive, version='1.0-2', architecturehintlist='any')
25+ dsp = self.factory.makeDistroSeriesParent()
26+ target_archive = dsp.derived_series.main_archive
27+ self.layer.txn.commit()
28+ self.layer.switchDbUser('archivepublisher')
29+ # The real test is that the doCopy doesn't fail.
30+ [copied_source] = self.doCopy(
31+ source, target_archive, dsp.derived_series, source.pocket, False)
32+
33
34 class TestDoDelayedCopy(TestCaseWithFactory, BaseDoCopyTests):
35