← Back to team overview

launchpad-reviewers team mailing list archive

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

 

Steve Kowalik has proposed merging lp:~stevenk/launchpad/copies-into-derived-series-fix into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~stevenk/launchpad/copies-into-derived-series-fix/+merge/62228

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.
-- 
https://code.launchpad.net/~stevenk/launchpad/copies-into-derived-series-fix/+merge/62228
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~stevenk/launchpad/copies-into-derived-series-fix into lp:launchpad.
=== modified file 'database/schema/security.cfg'
--- database/schema/security.cfg	2011-05-19 14:14:36 +0000
+++ database/schema/security.cfg	2011-05-25 02:07:28 +0000
@@ -834,6 +834,7 @@
 public.cve                              = SELECT, INSERT
 public.distributionjob                  = SELECT, INSERT, DELETE
 public.distributionsourcepackage        = SELECT, INSERT, UPDATE
+public.distroseriesparent               = SELECT
 public.flatpackagesetinclusion          = SELECT, INSERT, UPDATE, DELETE
 public.gpgkey                           = SELECT, INSERT, UPDATE
 public.job                              = SELECT, INSERT, UPDATE

=== 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 02:07:28 +0000
@@ -1364,6 +1364,18 @@
         self.assertComponentSectionAndPriority(
             main, bin_hppa, copied_bin_hppa)
 
+    def test_copy_into_derived_series(self):
+        archive = self.test_publisher.ubuntutest.main_archive
+        source = self.test_publisher.getPubSource(
+            archive=archive, version='1.0-2', architecturehintlist='any')
+        dsp = self.factory.makeDistroSeriesParent()
+        target_archive = dsp.derived_series.main_archive
+        self.layer.txn.commit()
+        self.layer.switchDbUser('archivepublisher')
+        # The real test is that the doCopy doesn't fail.
+        [copied_source] = self.doCopy(
+            source, target_archive, dsp.derived_series, source.pocket, False)
+
 
 class TestDoDelayedCopy(TestCaseWithFactory, BaseDoCopyTests):