Beispiel #1
0
 def test_get_boot_image_purposes(self):
     osystem = SUSEOS()
     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])
Beispiel #2
0
        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)
Beispiel #3
0
 def test_get_release_title(self):
     osystem = SUSEOS()
     release = random.choice(list(DISTRO_SERIES_CHOICES))
     self.assertEqual(DISTRO_SERIES_CHOICES[release],
                      osystem.get_release_title(release))
Beispiel #4
0
 def test_get_default_release(self):
     osystem = SUSEOS()
     expected = osystem.get_default_release()
     self.assertEqual(expected, DISTRO_SERIES_DEFAULT)