aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/tests/unit/benchmark/contexts/standalone/test_model.py
diff options
context:
space:
mode:
Diffstat (limited to 'yardstick/tests/unit/benchmark/contexts/standalone/test_model.py')
-rw-r--r--yardstick/tests/unit/benchmark/contexts/standalone/test_model.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/yardstick/tests/unit/benchmark/contexts/standalone/test_model.py b/yardstick/tests/unit/benchmark/contexts/standalone/test_model.py
index 98d2b1836..e76a3ca27 100644
--- a/yardstick/tests/unit/benchmark/contexts/standalone/test_model.py
+++ b/yardstick/tests/unit/benchmark/contexts/standalone/test_model.py
@@ -17,6 +17,7 @@ import os
import uuid
import mock
+import netaddr
import unittest
from xml.etree import ElementTree
@@ -54,7 +55,7 @@ class ModelLibvirtTestCase(unittest.TestCase):
numa_cpus=0 - 10,
socket=1, threads=1,
vm_image="/var/lib/libvirt/images/yardstick-nsb-image.img",
- cpuset=2 - 10, cputune='')
+ cpuset=2 - 10, cputune='', machine='pc')
def setUp(self):
self.pci_address_str = '0001:04:03.2'
@@ -123,7 +124,7 @@ class ModelLibvirtTestCase(unittest.TestCase):
def test_add_ovs_interfaces(self):
xml_input = copy.deepcopy(XML_SAMPLE)
xml_output = model.Libvirt.add_ovs_interface(
- '/usr/local', 0, self.pci_address_str, self.mac, xml_input)
+ '/usr/local', 0, self.pci_address_str, self.mac, xml_input, 4)
root = ElementTree.fromstring(xml_output)
et_out = ElementTree.ElementTree(element=root)
@@ -292,6 +293,7 @@ class ModelLibvirtTestCase(unittest.TestCase):
hostname = root.find('name').text
mac = "00:11:22:33:44:55"
ip = "{0}/{1}".format(node.get('ip'), node.get('netmask'))
+ ip = "{0}/{1}".format(node.get('ip'), netaddr.IPNetwork(ip).prefixlen)
model.StandaloneContextHelper.check_update_key(self.mock_ssh, node, hostname, id_name,
cdrom_img, mac)
mock_gen_cdrom_image.assert_called_once_with(self.mock_ssh, cdrom_img, hostname,
@@ -350,7 +352,8 @@ class ModelLibvirtTestCase(unittest.TestCase):
xml_ref = model.VM_TEMPLATE.format(vm_name='vm_name',
random_uuid=_uuid, mac_addr=mac, memory='1024', vcpu='8', cpu='4',
numa_cpus='0-7', socket='3', threads='2',
- vm_image='qemu_image', cpuset='4,5', cputune='cool')
+ vm_image='qemu_image', cpuset='4,5', cputune='cool',
+ machine='pc-i440fx-xenial')
xml_ref = model.Libvirt.add_cdrom(cdrom_img, xml_ref)
self.assertEqual(xml_out, xml_ref)
mock_get_mac_address.assert_called_once_with(0x00)