# HG changeset patch
# User Zhengang Li <lizg(a)cn.ibm.com>
# Date 1208848869 -28800
# Node ID 84009d4d2ed87240fd82c694d398df3b6bf91bed
# Parent 41a6c5cd50733a67d56d6612dad02705377a8b88
[TEST] Move the global provider version info into libvirt-cim suite
Move the CIM_REV & CIM_SET from Cimtest.Globals.py to XenKvmLib.const.py
Most possible reference of CIM_REV will be numeric comparing against
an expected revision for an older or newer result. I change the CIM_REV
to an integer type. CIM_SET is a hexadecimal number, and doesn't have
such incremental features across the changesets. I left it as a string.
Signed-off-by: Zhengang Li <lizg(a)cn.ibm.com>
diff -r 41a6c5cd5073 -r 84009d4d2ed8 lib/CimTest/Globals.py
--- a/lib/CimTest/Globals.py Mon Apr 21 16:55:52 2008 +0800
+++ b/lib/CimTest/Globals.py Tue Apr 22 15:21:09 2008 +0800
@@ -34,8 +34,6 @@ global platform_sup
global platform_sup
global CIM_IP
global CIM_PORT
-global CIM_REV
-global CIM_SET
global CIM_ERROR_ASSOCIATORNAMES
global CIM_ERROR_ENUMERATE
@@ -49,8 +47,6 @@ CIM_FUUID = os.getenv("CIM_FUUID")
CIM_FUUID = os.getenv("CIM_FUUID")
CIM_TC = os.getenv("CIM_TC")
CIM_IP = os.getenv("CIM_IP")
-CIM_REV = os.getenv("CIM_REV")
-CIM_SET = os.getenv("CIM_SET")
CIM_PORT = "5988"
NM = "TEST LOG"
platform_sup = ["Xen", "KVM", "XenFV"]
@@ -91,8 +87,6 @@ if not CIM_IP:
if not CIM_IP:
CIM_IP = "localhost"
-if not CIM_REV or not CIM_SET:
- CIM_REV = CIM_SET = "Unknown"
def log_param(debug=None):
#FIXME debug=None is a temporary work around to avoid duplicate
diff -r 41a6c5cd5073 -r 84009d4d2ed8 suites/libvirt-cim/lib/XenKvmLib/const.py
--- a/suites/libvirt-cim/lib/XenKvmLib/const.py Mon Apr 21 16:55:52 2008 +0800
+++ b/suites/libvirt-cim/lib/XenKvmLib/const.py Tue Apr 22 15:21:09 2008 +0800
@@ -22,6 +22,16 @@ import platform
import platform
from VirtLib.live import fv_cap
from CimTest.Globals import CIM_IP
+
+global CIM_REV
+global CIM_SET
+
+CIM_REV = int(os.getenv("CIM_REV"))
+CIM_SET = os.getenv("CIM_SET")
+
+if not CIM_REV or not CIM_SET:
+ CIM_REV = 0
+ CIM_SET = 'Unknown'
# vxml.NetXML
default_bridge_name = 'testbridge'
diff -r 41a6c5cd5073 -r 84009d4d2ed8 suites/libvirt-cim/main.py
--- a/suites/libvirt-cim/main.py Mon Apr 21 16:55:52 2008 +0800
+++ b/suites/libvirt-cim/main.py Tue Apr 22 15:21:09 2008 +0800
@@ -92,7 +92,7 @@ def get_version(virt, ip):
revision = inst[0]['Revision']
changeset = inst[0]['Changeset']
except Exception:
- return 'Unknown', 'Unknown'
+ return '0', 'Unknown'
return revision, changeset
def main():