# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1216867968 25200
# Node ID 12caeec9fd69e72808b0d9a5eb989e2063cfcb6a
# Parent 32d78f23f6e73f5443022179410128767896465d
[TEST] #2 Update Network.02 and helper functions for LXC support
Updates:
Add network devices in LXC guest, also take a mac address argument in guest define
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r 32d78f23f6e7 -r 12caeec9fd69
suites/libvirt-cim/cimtest/NetworkPort/02_np_gi_errors.py
--- a/suites/libvirt-cim/cimtest/NetworkPort/02_np_gi_errors.py Wed Jul 23 00:32:36 2008
-0700
+++ b/suites/libvirt-cim/cimtest/NetworkPort/02_np_gi_errors.py Wed Jul 23 19:52:48 2008
-0700
@@ -31,11 +31,11 @@
from XenKvmLib import assoc
from XenKvmLib.common_util import try_getinstance
from XenKvmLib.classes import get_typed_class
-from XenKvmLib.vxml import XenXML, KVMXML, get_class
+from XenKvmLib.vxml import XenXML, KVMXML, LXCXML, get_class
from CimTest.ReturnCodes import PASS, SKIP
from CimTest.Globals import logger, CIM_USER, CIM_PASS, CIM_NS, do_main
-sup_types = ['Xen', 'KVM', 'XenFV']
+sup_types = ['Xen', 'KVM', 'XenFV', 'LXC']
expr_values = {
diff -r 32d78f23f6e7 -r 12caeec9fd69 suites/libvirt-cim/lib/XenKvmLib/const.py
--- a/suites/libvirt-cim/lib/XenKvmLib/const.py Wed Jul 23 00:32:36 2008 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/const.py Wed Jul 23 19:52:48 2008 -0700
@@ -89,3 +89,4 @@
LXC_default_tty = '/dev/ptmx'
LXC_default_mp = '/tmp'
LXC_default_source = '/tmp/lxc_files'
+LXC_default_mac = '11:22:33:aa:bb:cc'
diff -r 32d78f23f6e7 -r 12caeec9fd69 suites/libvirt-cim/lib/XenKvmLib/vxml.py
--- a/suites/libvirt-cim/lib/XenKvmLib/vxml.py Wed Jul 23 00:32:36 2008 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/vxml.py Wed Jul 23 19:52:48 2008 -0700
@@ -700,19 +700,21 @@
def __init__(self, test_dom=const.default_domname,
mem=const.default_memory,
vcpus=const.default_vcpus,
+ mac=const.LXC_default_mac,
+ ntype=const.default_net_type,
tty=const.LXC_default_tty):
VirtXML.__init__(self, 'lxc', test_dom, set_uuid(), mem, vcpus)
self._os(const.LXC_init_path)
- self._devices(const.LXC_default_tty)
+ self._devices(mac, ntype, const.LXC_default_tty)
self.create_lxc_file(CIM_IP, const.LXC_init_path)
def _os(self, os_init):
os = self.get_node('/domain/os')
self.add_sub_node(os, 'init', os_init)
- def _devices(self, tty_set):
+ def _devices(self, net_mac, net_type, tty_set):
devices = self.get_node('/domain/devices')
-
+ self.set_interface_details(devices, net_mac, net_type, virt_type='LXC')
interface = self.add_sub_node(devices, 'console', tty = tty_set)
def create_lxc_file(self, ip, lxc_file):