Exemplo n.º 1
0
    def test_get_domain_by_libvirt_name(self):
        """Cloubed.get_domain_by_libvirt_name() shoud find the Domain with
           libvirt name in parameter and return it else raise CloubedException
        """

        self.assertIsInstance(
            self.tbd.get_domain_by_libvirt_name("{user}:test_testbed:test_domain1" \
                                                  .format(user=getuser())),
            Domain)
        self.assertRaisesRegexp(CloubedException,
                                'domain fail not found in configuration',
                                self.tbd.get_domain_by_libvirt_name,
                                'fail')
Exemplo n.º 2
0
    def __init__(self, tbd, network_conf):

        self.tbd = tbd
        self.ctl = self.tbd.ctl

        self.name = network_conf.name
        use_namespace = True # should better be a conf parameter in the future
        if use_namespace:    # logic should moved be in an abstract parent class
            self.libvirt_name = \
                "{user}:{testbed}:{name}" \
                    .format(user = getuser(),
                            testbed = network_conf.testbed,
                            name = self.name)
        else:
            self.libvirt_name = self.name

        self._forward_mode = network_conf.forward_mode
        self._bridge_name = network_conf.bridge_name

        self._with_local_settings = False
        self.ip_host = None
        self._netmask = None
        if network_conf.has_local_settings():
            self._with_local_settings = True
            self.ip_host = network_conf.ip_host
            self._netmask = network_conf.netmask

        self._with_dhcp = False
        self._dhcp_range_start = None
        self._dhcp_range_stop = None
        if network_conf.has_dhcp():
            self._with_dhcp = True
            self._dhcp_range_start = network_conf.dhcp_start
            self._dhcp_range_end = network_conf.dhcp_end

        self._domain = network_conf.domain

        self._with_pxe = False
        self._tftproot = None
        self._bootfile = None
        if network_conf.has_pxe():
            self._with_pxe = True
            self._tftproot = network_conf.pxe_tftp_dir
            self._bootfile = network_conf.pxe_boot_file

        # list of statically declared hosts in the network
        self._hosts = []

        self._doc = None
Exemplo n.º 3
0
    def __init__(self, tbd, storage_pool_conf):

        self.tbd = tbd
        self.ctl = self.tbd.ctl

        self.name = storage_pool_conf.name
        use_namespace = True # should better be a conf parameter in the future
        if use_namespace:    # logic should moved be in an abstract parent class
            self.libvirt_name = \
                "{user}:{testbed}:{name}" \
                    .format(user = getuser(),
                            testbed = storage_pool_conf.testbed,
                            name = self.name)
        else:
            self.libvirt_name = self.name
        self.path = storage_pool_conf.path

        self._doc = None
Exemplo n.º 4
0
    def __init__(self, tbd, storage_volume_conf):

        self.tbd = tbd
        self.ctl = self.tbd.ctl

        sp_name = storage_volume_conf.storage_pool
        self.storage_pool = self.tbd.get_storage_pool_by_name(sp_name)
        self.name = storage_volume_conf.name
        use_namespace = True # should better be a conf parameter in the future
        if use_namespace:    # logic should moved be in an abstract parent class
            self.libvirt_name = \
                "{user}:{testbed}:{name}" \
                    .format(user = getuser(),
                            testbed = storage_volume_conf.testbed,
                            name = self.name)
        else:
            self.libvirt_name = self.name

        self._size = storage_volume_conf.size
        self._imgtype = storage_volume_conf.format

        self._backing = storage_volume_conf.backing

        self._doc = None