[Libvirt-cim] [PATCH]Add the revision and the changeset of Cimtest to the test report

Toshifumi Fujimura fujimura.toshifumi at np.css.fujitsu.com
Tue Oct 28 04:50:06 UTC 2008


# HG changeset patch
# User Toshifumi Fujimura<fujimura.toshifumi at np.css.fujitsu.com>
# Date 1225162881 -32400
# Node ID e735bda49b6b5dc2ab96c8626808e97a64711b57
# Parent 0f340004e1cd48f5ede60a68283a850ae60c9ebe
[PATCH]Add the revision and the changeset of Cimtest to the test report

Hi,
This patch adds the revision and the changeset of Cimtest
to the test report "run_report.txt".
Since Cimtest updates frequently,
we need to know the cimtest version in the test reports,
After this change, the header is like follows.

================================================
KVM on Pegasus Test Run Summary for Oct 27 2008
=================================================
Distro: Fedora release 9.92 (Rawhide)
Kernel: 2.6.27.3-34.rc1.fc10.i686.PAE
libvirt: 0.4.6
Hypervisor: QEMU 0.9.1
CIMOM: Pegasus 2.7.1
Libvirt-cim revision: 725
Libvirt-cim changeset: e043f46f299e
Cimtest revision: 459
Cimtest changeset: 0f340004e1cd
=================================================

Signed-off-by: Toshifumi Fujimura <fujimura.toshifumi at np.css.fujitsu.com>

diff -r 0f340004e1cd suites/libvirt-cim/lib/XenKvmLib/reporting.py
--- a/suites/libvirt-cim/lib/XenKvmLib/reporting.py    Fri Oct 24 
01:04:38 2008 -0700
+++ b/suites/libvirt-cim/lib/XenKvmLib/reporting.py    Tue Oct 28 
09:52:47 2008 +0900
@@ -25,6 +25,14 @@
 from time import gmtime, strftime
 from VirtLib import utils
 from XenKvmLib.const import get_provider_version
+
+def get_cimtest_revision():
+    revision = commands.getoutput("hg parents --template \"{rev}\"")
+    return revision
+
+def get_cimtest_changeset():
+    changeset = commands.getoutput("hg parents --template 
\"{node|short}\"")
+    return changeset
 
 def get_cmd_val(cmd, ip):
     rc, out = utils.run_remote(ip, cmd)
@@ -137,6 +145,10 @@
 
     cimom, cimom_ver = get_cimom_ver(ip)
 
+    cimtest_revision = get_cimtest_revision()
+    cimtest_changeset = get_cimtest_changeset()
+    cimtest_info = "Cimtest revision: %s\nCimtest changeset: %s\n" % 
(cimtest_revision, cimtest_changeset)
+
     heading  = "%s on %s Test Run Summary for %s" % (virt, cimom, date)
     sys_env = get_env_data(ip, virt)
 
@@ -146,7 +158,7 @@
 
     res, res_total, test_block = build_report_body(rvals, tstr, divider)
 
-    report = divider + heading + "\n" + divider + sys_env + divider + res \
+    report = divider + heading + "\n" + divider + sys_env + 
cimtest_info + divider + res \
              + res_total + divider + test_block + "Full report:\n" \
              + run_output
 

-- 
Toshifumi Fujimura.





More information about the Libvirt-cim mailing list