~mpontillo/maas/dns-template-changes-1.7

« back to all changes in this revision

Viewing changes to src/maasserver/models/tests/test_bootresource.py

  • Committer: MaaS Lander
  • Author(s): Raphael Badin
  • Date: 2014-10-17 16:21:20 UTC
  • mfrom: (3263.2.1 revert-r-3263)
  • Revision ID: maas_lander-20141017162120-2f1sa7apve0uiryq
[r=andreserl][bug=][author=rvb] Revert revision 3263;  this change broke the CI: nodes cannot be commissioned (no-such-image error) with this change.

Show diffs side-by-side

added added

removed removed

Lines of Context:
363
363
            [resource],
364
364
            BootResource.objects.get_resources_matching_boot_images(images))
365
365
 
366
 
    def test__returns_multiple_resource_for_hwe_resources(self):
367
 
        os = factory.make_name('os')
368
 
        series = factory.make_name('series')
369
 
        name = '%s/%s' % (os, series)
370
 
        arch = factory.make_name('arch')
371
 
        subarches = [factory.make_name('hwe') for _ in range(3)]
372
 
        resources = [
373
 
            factory.make_usable_boot_resource(
374
 
                rtype=BOOT_RESOURCE_TYPE.SYNCED,
375
 
                name=name, architecture='%s/%s' % (arch, subarch))
376
 
            for subarch in subarches
377
 
            ]
378
 
        images = []
379
 
        for resource in resources:
380
 
            label = resource.get_latest_complete_set().label
381
 
            purposes = [factory.make_name('purpose') for _ in range(3)]
382
 
            arch, subarch = resource.split_arch()
383
 
            images.extend([
384
 
                make_rpc_boot_image(
385
 
                    osystem=os, release=series,
386
 
                    architecture=arch, subarchitecture=subarch,
387
 
                    label=label, purpose=purpose)
388
 
                for purpose in purposes
389
 
                ])
390
 
        self.assertItemsEqual(
391
 
            resources,
392
 
            BootResource.objects.get_resources_matching_boot_images(images))
393
 
 
394
366
    def test__returns_resource_for_generated_resource(self):
395
367
        resource = factory.make_usable_boot_resource(
396
368
            rtype=BOOT_RESOURCE_TYPE.GENERATED)