Kaitlin,

I applied the patch on my own repository. Here is the test result:

=================================================
KVM on Pegasus Test Run Summary for Aug 12 2008
=================================================
Distro: Fedora release 8.93 (Rawhide)
Kernel: 2.6.26-rc2-mm1-netns
libvirt: 0.4.4
Hypervisor: QEMU 0.9.1
CIMOM: Pegasus 2.7.0
Libvirt-cim revision: 661
Libvirt-cim changeset: 98bc98880149
=================================================
FAIL:                 0
XFAIL:                 1
SKIP:                 1
PASS:                 1
-----------------
Total:                 3
=================================================
XFAIL Test Summary:
ComputerSystem - 01_enum.py: PASSComputerSystem - 02_nosystems.py: SKIPComputerSystem - 03_defineVS.py: PASSComputerSystem - 04_defineStartVS.py: PASSComputerSystem - 05_activate_defined_start.py: PASSComputerSystem - 06_paused_active_suspend.py: PASSComputerSystem - 22_define_suspend.py: PASSComputerSystem - 23_suspend_suspend.py: PASSComputerSystem - 27_define_suspend_errs.py: PASSComputerSystem - 32_start_reboot.py: XFAILComputerSystem - 33_suspend_reboot.py: XFAILComputerSystem - 35_start_reset.py: PASSComputerSystem - 40_RSC_start.py: PASSComputerSystem - 41_cs_to_settingdefinestate.py: SKIPComputerSystem - 42_cs_gi_errs.py: PASS

=================================================
SKIP Test Summary:
ComputerSystem - 01_enum.py: PASSComputerSystem - 02_nosystems.py: SKIPComputerSystem - 03_defineVS.py: PASSComputerSystem - 04_defineStartVS.py: PASSComputerSystem - 05_activate_defined_start.py: PASSComputerSystem - 06_paused_active_suspend.py: PASSComputerSystem - 22_define_suspend.py: PASSComputerSystem - 23_suspend_suspend.py: PASSComputerSystem - 27_define_suspend_errs.py: PASSComputerSystem - 32_start_reboot.py: XFAILComputerSystem - 33_suspend_reboot.py: XFAILComputerSystem - 35_start_reset.py: PASSComputerSystem - 40_RSC_start.py: PASSComputerSystem - 41_cs_to_settingdefinestate.py: SKIPComputerSystem - 42_cs_gi_errs.py: PASS

=================================================
Full report:
ComputerSystem - 01_enum.py: PASSComputerSystem - 02_nosystems.py: SKIPComputerSystem - 03_defineVS.py: PASSComputerSystem - 04_defineStartVS.py: PASSComputerSystem - 05_activate_defined_start.py: PASSComputerSystem - 06_paused_active_suspend.py: PASSComputerSystem - 22_define_suspend.py: PASSComputerSystem - 23_suspend_suspend.py: PASSComputerSystem - 27_define_suspend_errs.py: PASSComputerSystem - 32_start_reboot.py: XFAILComputerSystem - 33_suspend_reboot.py: XFAILComputerSystem - 35_start_reset.py: PASSComputerSystem - 40_RSC_start.py: PASSComputerSystem - 41_cs_to_settingdefinestate.py: SKIPComputerSystem - 42_cs_gi_errs.py: PASS


1) Would you please to fix the whitespace for XFAIL and Total summary?
2) The count numbers are not correct, actually there are total 15 tests, 2 skip, 2 XFAIL and 11 pass for me.
3) I think it's better to change to a newline for each test case in the Test Summary and Full report.
4) The test summary isn't correct in XFAIL/SKIP status.

Thanks!


Best,
Regards

Daisy (Ô˹úÁ«)
VSM Team, China Systems & Technology Labs (CSTL)
E-mail: yunguol@cn.ibm.com
TEL: (86)-21-60922403
Building 10, 399 Ke Yuan Rd, Pudong Shanghai, 201203


libvirt-cim-bounces@redhat.com wrote on 2008-08-12 00:21:16:

> # HG changeset patch
> # User Kaitlin Rupert <karupert@us.ibm.com>
> # Date 1218470745 25200
> # Node ID d1e8325893b3e68e12b1725e350314aeaf6d2be1
> # Parent  a5111986921da879e2dcc57a1529c7f4d902aebf
> [TEST] #2 Add test report generation.
>
> Using the --report option, you can generate a report and have it
> mailed to the address supplied.
>
> How to call using the report option:
>
> ./runtests libvirt-cim -i localhost -c -d -v LXC -g
> VirtualSystemManagementService -t 01_definesystem_name.py --report
> <my_to_addr@test.com>
>
> The user will need to create a .cimtestrc file in their home
> directory in the following format:
>
> [email]
> relay = my.mail.relay.com
> from = Joe User <joe@test.com>
>
> Will need to add revision number support to cimtest and then add the
> cimtest revision number to the report.
>
> Updates:
>   -Refactored reporting related pieces into their own library file
>
> Signed-off-by: Kaitlin Rupert <karupert@us.ibm.com>
>
> diff -r a5111986921d -r d1e8325893b3 suites/libvirt-cim/main.py
> --- a/suites/libvirt-cim/main.py   Mon Aug 11 09:05:37 2008 -0700
> +++ b/suites/libvirt-cim/main.py   Mon Aug 11 09:05:45 2008 -0700
> @@ -29,12 +29,13 @@
>  sys.path.append('../../lib')
>  import TestSuite
>  import commands
> -from VirtLib import utils
>  from VirtLib import groups
>  from CimTest.ReturnCodes import PASS, SKIP, XFAIL
>  from CimTest.Globals import platform_sup
>  sys.path.append('./lib')
>  from XenKvmLib.classes import get_typed_class
> +import ConfigParser
> +from XenKvmLib.reporting import gen_report, send_report
>  
>  parser = OptionParser()
>  parser.add_option("-i", "--ip", dest="ip", default="localhost",
> @@ -54,8 +55,11 @@
>                    help="Virt type, select from 'Xen' & 'KVM' &
> 'XenFV' & 'LXC'(default: Xen). ")
>  parser.add_option("-d", "--debug-output", action="store_true", dest="debug",
>                    help="Duplicate the output to stderr")
> +parser.add_option("--report", dest="report",
> +                  help="Send report using mail info: --
> report=<recipient addr>")
>  
>  TEST_SUITE = 'cimtest'
> +CIMTEST_RCFILE = '%s/.cimtestrc' % os.environ['HOME']
>  
>  def set_python_path():
>      previous_pypath = os.environ.get('PYTHONPATH')
> @@ -82,6 +86,28 @@
>  
>      print "Cleaned log files."
>  
> +def get_rcfile_vals():
> +    if not os.access(CIMTEST_RCFILE, os.R_OK):
> +        print "\nCould not access the %s file for this user." %
> CIMTEST_RCFILE
> +        print "Create this file and add the appropriate relay:"
> +        print "\tfrom = me@isp.com\n\trelay = my.relay\n"
> +        return None, None
> +
> +    try:
> +        conf = ConfigParser.ConfigParser()
> +        if not conf.read(CIMTEST_RCFILE):
> +            return None, None
> +
> +        addr = conf.get("email", "from")
> +        relay = conf.get("email", "relay")
> +
> +    except Exception, details:
> +        print "\n%s" % details
> +        print "\nPlease verify the format of the %s file\n" % CIMTEST_RCFILE
> +        return None, None
> +
> +    return addr, relay
> +
>  def get_version(virt, ip):
>      conn = WBEMConnection('http://%s' % ip,
>                            (os.getenv('CIM_USER'), os.getenv('CIM_PASS')),
> @@ -101,7 +127,10 @@
>  
>  def main():
>      (options, args) = parser.parse_args()
> -
> +    to_addr = None
> +    from_addr = None
> +    relay = None
> +    div =
> "--------------------------------------------------------------------"
>  
>      if options.test and not options.group:
>          parser.print_help()
> @@ -114,7 +143,15 @@
>          os.environ['CIMOM_PORT'] = str(options.port)
>      #
>  
> -    testsuite = TestSuite.TestSuite()
> +    if options.report:
> +        from_addr, relay = get_rcfile_vals()
> +
> +        if from_addr == None or relay == None:
> +            return 1
> +        
> +        to_addr = options.report
> +
> +    testsuite = TestSuite.TestSuite(log=True)
>    
>      set_python_path()
>  
> @@ -139,9 +176,10 @@
>  
>      revision, changeset = get_version(options.virt, options.ip)
>  
> -    print "Testing " + options.virt + " hypervisor"
> +    print "\nTesting " + options.virt + " hypervisor"
>  
> -    for test in test_list:
> +    for test in test_list:
> +        testsuite.debug(div)
>          t_path = os.path.join(TEST_SUITE, test['group'])
>          os.environ['CIM_TC'] = test['test']
>          cdto = 'cd %s' % t_path
> @@ -155,7 +193,16 @@
>  
>          testsuite.print_results(test['group'], test['test'], os_status)
>  
> +    testsuite.debug("%s\n" % div)
>      testsuite.finish()
> +
> +    msg_body, heading = gen_report(revision, changeset, options.virt,
> +                                   options.ip, testsuite.log_file)
> +
> +    if options.report:
> +        print "Sending mail from %s to %s using %s relay.\n" % \
> +              (from_addr, to_addr, relay)
> +        send_report(to_addr, from_addr, relay, msg_body, heading)
>  
>  if __name__ == '__main__':
>      sys.exit(main())
>
> _______________________________________________
> Libvirt-cim mailing list
> Libvirt-cim@redhat.com
> https://www.redhat.com/mailman/listinfo/libvirt-cim