1429
1434
self.assertDep('i386', 'foo-universe', [universe_bins[0]])
1437
class TestOverlays(TestCaseWithFactory):
1439
layer = LaunchpadZopelessLayer
1441
def _createDep(self, derived_series, parent_series,
1442
parent_distro, component_name=None, pocket=None,
1443
overlay=True, arch_tag='i386',
1444
publish_base_url=u'http://archive.launchpad.dev/'):
1445
# Helper to create a parent/child relationshipi.
1446
if type(parent_distro) == str:
1447
depdistro = self.factory.makeDistribution(parent_distro,
1448
publish_base_url=publish_base_url)
1450
depdistro = parent_distro
1451
if type(parent_series) == str:
1452
depseries = self.factory.makeDistroSeries(
1453
name=parent_series, distribution=depdistro)
1454
deparchseries = self.factory.makeDistroArchSeries(
1455
distroseries=depseries, architecturetag=arch_tag)
1457
depseries = parent_series
1458
if component_name is not None:
1459
component = getUtility(IComponentSet)[component_name]
1463
self.factory.makeDistroSeriesParent(
1464
derived_series=derived_series, parent_series=depseries,
1465
initialized=True, is_overlay=overlay, pocket=pocket,
1466
component=component)
1467
return depseries, depdistro
1469
def test_overlay_dependencies(self):
1470
# sources.list is properly generated for a complex overlay structure.
1471
# Pocket dependencies and component dependencies are taken into
1472
# account when generating sources.list.
1474
# breezy type of relation:
1476
# ----------------------- | o
1478
# o o | no overlay overlay
1480
# series11 series21 series31
1486
test_publisher = SoyuzTestPublisher()
1487
test_publisher.prepareBreezyAutotest()
1488
breezy = test_publisher.breezy_autotest
1489
pub_source = test_publisher.getPubSource(
1490
version='1.1', archive=breezy.main_archive)
1491
[build] = pub_source.createMissingBuilds()
1492
series11, depdistro = self._createDep(
1493
breezy, 'series11', 'depdistro', 'universe',
1494
PackagePublishingPocket.SECURITY)
1496
breezy, 'series21', 'depdistro2', 'multiverse',
1497
PackagePublishingPocket.UPDATES)
1498
self._createDep(breezy, 'series31', 'depdistro3', overlay=False)
1500
series11, 'series12', 'depdistro4', 'multiverse',
1501
PackagePublishingPocket.UPDATES)
1502
sources_list = get_sources_list_for_building(build,
1503
build.distro_arch_series, build.source_package_release.name)
1506
"\n".join(sources_list),
1508
".../ubuntutest breezy-autotest main\n"
1509
".../depdistro series11 main universe\n"
1510
".../depdistro series11-security main universe\n"
1511
".../depdistro2 series21 "
1512
"main restricted universe multiverse\n"
1513
".../depdistro2 series21-security "
1514
"main restricted universe multiverse\n"
1515
".../depdistro2 series21-updates "
1516
"main restricted universe multiverse\n"
1517
".../depdistro4 series12 main restricted "
1518
"universe multiverse\n"
1519
".../depdistro4 series12-security main "
1520
"restricted universe multiverse\n"
1521
".../depdistro4 series12-updates "
1522
"main restricted universe multiverse\n"
1523
, doctest.ELLIPSIS))
1432
1526
class TestComponents(TestCaseWithFactory):
1434
1528
layer = DatabaseFunctionalLayer