def test_get_boot_image_purposes(self): osystem = CaringoOS() archs = [factory.make_name("arch") for _ in range(2)] subarchs = [factory.make_name("subarch") for _ in range(2)] releases = [factory.make_name("release") for _ in range(2)] labels = [factory.make_name("label") for _ in range(2)] for arch, subarch, release, label in product(archs, subarchs, releases, labels): expected = osystem.get_boot_image_purposes(arch, subarchs, release, label) self.assertIsInstance(expected, list) self.assertEqual(expected, [BOOT_IMAGE_PURPOSE.EPHEMERAL])
return "root-tgz", "tgz" class OperatingSystemRegistry(Registry): """Registry for operating system classes.""" from provisioningserver.drivers.osystem.ubuntu import UbuntuOS from provisioningserver.drivers.osystem.ubuntucore import UbuntuCoreOS from provisioningserver.drivers.osystem.bootloader import BootLoaderOS from provisioningserver.drivers.osystem.centos import CentOS from provisioningserver.drivers.osystem.rhel import RHELOS from provisioningserver.drivers.osystem.custom import CustomOS from provisioningserver.drivers.osystem.windows import WindowsOS from provisioningserver.drivers.osystem.suse import SUSEOS from provisioningserver.drivers.osystem.caringo import CaringoOS builtin_osystems = [ UbuntuOS(), UbuntuCoreOS(), BootLoaderOS(), CentOS(), RHELOS(), CustomOS(), WindowsOS(), SUSEOS(), CaringoOS(), ] for osystem in builtin_osystems: OperatingSystemRegistry.register_item(osystem.name, osystem)
def test_get_release_title(self): osystem = CaringoOS() self.assertEqual(osystem.get_release_title("9.0"), "9.0")
def test_get_default_release(self): osystem = CaringoOS() expected = osystem.get_default_release() self.assertEqual(expected, "")