Esempio n. 1
0
    def test_compute_config_with_raid(self):
        args = arg_parse(
            ["cloud",
             "nodecounter",
             "macaddress",
             "controller_raid_volumes",
             "cephvolumenumber",
             "drbdserial",
             "computenodememory",
             "controllernodememory",
             "libvirttype",
             "vcpus",
             "emulator",
             "vdiskdir"])
        args.cloud = "cloud"
        args.nodecounter = "1"
        args.macaddress = "52:54:01:77:77:01"
        args.controller_raid_volumes = 2
        args.cephvolumenumber = "2"
        args.computenodememory = "2097152"
        args.controllernodememory = "5242880"
        args.libvirttype = "kvm"
        args.vcpus = "1"
        args.emulator = "/usr/bin/qemu-system-x86_64"
        args.vdiskdir = "/dev/cloud"
        args.drbdserial = ""
        args.bootorder = "3"
        cpu_flags = libvirt_setup.readfile(
            "{0}/cpu-intel.xml".format(TEMPLATE_DIR))

        should_config = libvirt_setup.readfile(
            "{0}/cloud-node1-raid.xml".format(FIXTURE_DIR))
        is_config = libvirt_setup.compute_config(args, cpu_flags)
        self.assertEqual(is_config, should_config)
    def test_compute_config(self):
        args = arg_parse([
            "cloud", "nodecounter", "macaddress", "cephvolumenumber",
            "drbdserial", "computenodememory", "controllernodememory",
            "libvirttype", "vcpus", "emulator", "vdiskdir"
        ])
        args.cloud = "cloud"
        args.nodecounter = "1"
        args.macaddress = "52:54:01:77:77:01"
        args.cephvolumenumber = "1"
        args.computenodememory = "2097152"
        args.controllernodememory = "2097152"
        args.libvirttype = "kvm"
        args.vcpus = "1"
        args.emulator = "/usr/bin/qemu-system-x86_64"
        args.vdiskdir = "/dev/cloud"
        args.drbdserial = ""
        args.bootorder = "2"
        cpu_flags = libvirt_setup.readfile(
            "{0}/cpu-intel.xml".format(TEMPLATE_DIR))

        should_config = libvirt_setup.readfile(
            "{0}/cloud-node1.xml".format(FIXTURE_DIR))
        is_config = libvirt_setup.compute_config(args, cpu_flags)
        self.assertEqual(is_config, should_config)
 def test_xen_compute_config(self):
     args = Arguments()
     default_test_args(args)
     args.libvirttype = "xen"
     cpu_flags = libvirt_setup.readfile(
         "{0}/cpu-intel.xml".format(TEMPLATE_DIR))
     should_config = libvirt_setup.readfile(
         "{0}/cloud-node1-xen.xml".format(FIXTURE_DIR))
     is_config = filter_vm_xml(libvirt_setup.compute_config(
         args, cpu_flags))
     self.assertEqual(is_config, should_config)
Esempio n. 4
0
 def test_xen_compute_config(self):
     args = Arguments()
     default_test_args(args)
     args.libvirttype = "xen"
     cpu_flags = libvirt_setup.readfile(
         "{0}/cpu-intel.xml".format(TEMPLATE_DIR))
     should_config = libvirt_setup.readfile(
         "{0}/cloud-node1-xen.xml".format(FIXTURE_DIR))
     is_config = filter_vm_xml(
         libvirt_setup.compute_config(args, cpu_flags))
     self.assertEqual(is_config, should_config)
    def test_compute_config_with_raid(self):
        args = Arguments()
        default_test_args(args)
        args.controller_raid_volumes = 2
        args.cephvolumenumber = 2
        cpu_flags = libvirt_setup.readfile(
            "{0}/cpu-intel.xml".format(TEMPLATE_DIR))

        should_config = libvirt_setup.readfile(
            "{0}/cloud-node1-raid.xml".format(FIXTURE_DIR))
        is_config = filter_vm_xml(libvirt_setup.compute_config(
            args, cpu_flags))
        self.assertEqual(is_config, should_config)
Esempio n. 6
0
    def test_compute_config_with_raid(self):
        args = Arguments()
        default_test_args(args)
        args.controller_raid_volumes = 2
        args.cephvolumenumber = 2
        cpu_flags = libvirt_setup.readfile(
            "{0}/cpu-intel.xml".format(TEMPLATE_DIR))

        should_config = libvirt_setup.readfile(
            "{0}/cloud-node1-raid.xml".format(FIXTURE_DIR))
        is_config = filter_vm_xml(
            libvirt_setup.compute_config(args, cpu_flags))
        self.assertEqual(is_config, should_config)
 def test_xen_compute_config(self):
     args = Arguments()
     args.cloud = "cloud"
     args.nodecounter = 1
     args.macaddress = "52:54:01:77:77:01"
     args.controller_raid_volumes = 0
     args.cephvolumenumber = 1
     args.computenodememory = 2097152
     args.controllernodememory = 5242880
     args.libvirttype = "xen"
     args.vcpus = 1
     args.emulator = "/usr/bin/qemu-system-x86_64"
     args.vdiskdir = "/dev/cloud"
     args.drbdserial = ""
     args.bootorder = 3
     args.numcontrollers = 1
     cpu_flags = libvirt_setup.readfile(
         "{0}/cpu-intel.xml".format(TEMPLATE_DIR))
     should_config = libvirt_setup.readfile(
         "{0}/cloud-node1-xen.xml".format(FIXTURE_DIR))
     is_config = libvirt_setup.compute_config(args, cpu_flags)
     self.assertEqual(is_config, should_config)
Esempio n. 8
0
 def test_compute_config(self):
     should_config = libvirt_setup.readfile(
         "{0}/cloud-node1.xml".format(FIXTURE_DIR))
     is_config = libvirt_setup.compute_config(self.args, self.cpu_flags)
     self.assertEqual(filter_vm_xml(is_config), should_config)
Esempio n. 9
0
 def _compare_configs(self, args, xml_format):
     should_config = libvirt_setup.readfile(
         "{0}/cloud-node1-{1}.xml".format(FIXTURE_DIR, xml_format))
     is_config = libvirt_setup.compute_config(args, self.cpu_flags)
     self.assertEqual(filter_vm_xml(is_config), should_config)
Esempio n. 10
0
 def test_compute_config(self):
     should_config = libvirt_setup.readfile(
         "{0}/cloud-node1.xml".format(FIXTURE_DIR))
     is_config = libvirt_setup.compute_config(self.args, self.cpu_flags)
     self.assertEqual(filter_vm_xml(is_config), should_config)
Esempio n. 11
0
 def _compare_configs(self, args, xml_format):
     should_config = libvirt_setup.readfile(
         "{0}/cloud-node1-{1}.xml".format(FIXTURE_DIR, xml_format))
     is_config = libvirt_setup.compute_config(args, self.cpu_flags)
     self.assertEqual(filter_vm_xml(is_config), should_config)