Esempio n. 1
0
 def test_make_hwe_kernel_ui_text_finds_release_from_bootsourcecache(self):
     self.useFixture(SignalsDisabled("bootsources"))
     release = factory.pick_ubuntu_release()
     kernel = "hwe-" + release[0]
     factory.make_BootSourceCache(os="ubuntu/%s" % release,
                                  subarch=kernel,
                                  release=release)
     self.assertEqual("%s (%s)" % (release, kernel),
                      make_hwe_kernel_ui_text(kernel))
Esempio n. 2
0
 def test_commissioningform_contains_real_and_ui_choice(self):
     release = factory.pick_ubuntu_release()
     name = 'ubuntu/%s' % release
     arch = factory.make_name('arch')
     kernel = 'hwe-' + release[0]
     # Disable boot sources signals otherwise the test fails due to unrun
     # post-commit tasks at the end of the test.
     self.useFixture(SignalsDisabled('bootsources'))
     factory.make_BootSourceCache(os=name, subarch=kernel, release=release)
     factory.make_usable_boot_resource(name=name,
                                       architecture='%s/%s' %
                                       (arch, kernel),
                                       rtype=BOOT_RESOURCE_TYPE.SYNCED)
     Config.objects.set_config('commissioning_distro_series', release)
     form = CommissioningForm()
     self.assertItemsEqual([('', '--- No minimum kernel ---'),
                            (kernel, '%s (%s)' % (release, kernel))],
                           form.fields['default_min_hwe_kernel'].choices)
Esempio n. 3
0
 def test_commissioningform_contains_real_and_ui_choice(self):
     release = factory.pick_ubuntu_release()
     name = "ubuntu/%s" % release
     arch = factory.make_name("arch")
     kernel = "hwe-" + release[0]
     # Disable boot sources signals otherwise the test fails due to unrun
     # post-commit tasks at the end of the test.
     self.useFixture(SignalsDisabled("bootsources"))
     factory.make_BootSourceCache(os=name, subarch=kernel, release=release)
     factory.make_usable_boot_resource(
         name=name,
         architecture="%s/%s" % (arch, kernel),
         rtype=BOOT_RESOURCE_TYPE.SYNCED,
     )
     Config.objects.set_config("commissioning_distro_series", release)
     form = CommissioningForm()
     self.assertItemsEqual(
         [
             ("", "--- No minimum kernel ---"),
             (kernel, "%s (%s)" % (release, kernel)),
         ],
         form.fields["default_min_hwe_kernel"].choices,
     )