def testCpuset(self): normaltest = utils.open_testdefault() utils.set_conn(normaltest) g = utils.get_basic_fullyvirt_guest() # Cpuset cpustr = virtinst.DomainNumatune.generate_cpuset(g.conn, g.memory) g.cpuset = cpustr g.vcpus = 7 g.cpu.model = "footest" g.cpu.vendor = "Intel" g.cpu.match = "minimum" g.cpu.threads = "2" g.cpu.sockets = "4" g.cpu.cores = "5" g.cpu.add_feature("x2apic", "force") g.cpu.add_feature("lahf_lm", "forbid") self._compare(g, "boot-cpuset", False) # Test CPU topology determining cpu = virtinst.CPU(g.conn) cpu.sockets = "2" cpu.set_topology_defaults(6) self.assertEquals([cpu.sockets, cpu.cores, cpu.threads], [2, 3, 1]) cpu = virtinst.CPU(g.conn) cpu.cores = "4" cpu.set_topology_defaults(9) self.assertEquals([cpu.sockets, cpu.cores, cpu.threads], [2, 4, 1]) cpu = virtinst.CPU(g.conn) cpu.threads = "3" cpu.set_topology_defaults(14) self.assertEquals([cpu.sockets, cpu.cores, cpu.threads], [4, 1, 3]) cpu = virtinst.CPU(g.conn) cpu.sockets = 5 cpu.cores = 2 self.assertEquals(cpu.vcpus_from_topology(), 10) cpu = virtinst.CPU(g.conn) self.assertEquals(cpu.vcpus_from_topology(), 1)
import os import logging import sys import unittest from tests import utils from virtinst import Guest from virtinst import urlfetcher from virtinst import util from virtinst.initrdinject import perform_initrd_injections cleanup = [] _alldistros = {} testconn = utils.open_testdefault() guest = Guest(testconn) guest.os.os_type = "hvm" guest.os.arch = "x86_64" meter = util.make_meter(quiet=False) DEVFEDORA_URL = "http://dl.fedoraproject.org/pub/fedora/linux/development/%s/Server/%s/os/" FEDORA_URL = "http://dl.fedoraproject.org/pub/fedora/linux/releases/%s/Server/%s/os/" (WARN_RHEL4, WARN_RHEL5, WARN_LATEST) = range(1, 4) def prompt(): sys.stdout.write("(press enter to continue)")
import os import sys import unittest from tests import INITRD_TEST_DISTROS from tests import utils from virtinst import Guest from virtinst import urlfetcher from virtinst import util from virtinst.distroinstaller import _perform_initrd_injections cleanup = [] _alldistros = {} testconn = utils.open_testdefault() guest = Guest(testconn) guest.os.os_type = "hvm" guest.os.arch = "x86_64" meter = util.make_meter(quiet=False) DEVFEDORA_URL = "http://dl.fedoraproject.org/pub/fedora/linux/development/%s/%s/os/" OLD_FEDORA_URL = "http://dl.fedoraproject.org/pub/fedora/linux/releases/%s/Fedora/%s/os/" FEDORA_URL = "http://dl.fedoraproject.org/pub/fedora/linux/releases/%s/Server/%s/os/" (WARN_RHEL4, WARN_RHEL5, WARN_LATEST) = range(1, 4) def prompt():
def setUp(self): self.conn = utils.open_testdefault()