def test_get_boot_image_purposes(self): osystem = ESXi() 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.XINSTALL])
def test_get_release_title(self): name_titles = { "6": "VMware ESXi 6", "6.7": "VMware ESXi 6.7", "6.7.0": "VMware ESXi 6.7.0", "6-custom": "VMware ESXi 6 custom", "6.7-custom": "VMware ESXi 6.7 custom", "6.7.0-custom": "VMware ESXi 6.7.0 custom", "custom": "VMware ESXi custom", } osystem = ESXi() for name, title in name_titles.items(): self.expectThat(osystem.get_release_title(name), Equals(title))
def test_get_release_title(self): name_titles = { '6': 'VMware ESXi 6', '6.7': 'VMware ESXi 6.7', '6.7.0': 'VMware ESXi 6.7.0', '6-custom': 'VMware ESXi 6 custom', '6.7-custom': 'VMware ESXi 6.7 custom', '6.7.0-custom': 'VMware ESXi 6.7.0 custom', 'custom': 'VMware ESXi custom', } osystem = ESXi() for name, title in name_titles.items(): self.expectThat(osystem.get_release_title(name), Equals(title))
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 from provisioningserver.drivers.osystem.esxi import ESXi builtin_osystems = [ UbuntuOS(), UbuntuCoreOS(), BootLoaderOS(), CentOS(), RHELOS(), CustomOS(), WindowsOS(), SUSEOS(), CaringoOS(), ESXi(), ] for osystem in builtin_osystems: OperatingSystemRegistry.register_item(osystem.name, osystem)
def test_get_default_release(self): osystem = ESXi() expected = osystem.get_default_release() self.assertEqual(expected, "6.7")