Kaitlin,

Here is a test report generation.

Please fix whitespace in XFAIL and Total count.

Thanks!


=================================================
LXC on sfcb Test Run Summary for Aug 13 2008
=================================================
Distro: Fedora release 8.92 (Rawhide)
Kernel: 2.6.26-rc2-mm1-netns
libvirt: 0.4.4
Hypervisor: QEMU 0.9.1
CIMOM: sfcb sfcbd 1.3.0
Libvirt-cim revision: 656
Libvirt-cim changeset: dbdf9a5fce21
=================================================
FAIL:                 0
XFAIL:                 0
SKIP:                 8
PASS:                 7
-----------------
Total:                 15
=================================================
SKIP Test Summary:
ComputerSystem - 06_paused_active_suspend.py: SKIP
ComputerSystem - 22_define_suspend.py: SKIP
ComputerSystem - 23_suspend_suspend.py: SKIP
ComputerSystem - 32_start_reboot.py: SKIP
ComputerSystem - 33_suspend_reboot.py: SKIP
ComputerSystem - 35_start_reset.py: SKIP
ComputerSystem - 40_RSC_start.py: SKIP
ComputerSystem - 41_cs_to_settingdefinestate.py: SKIP

=================================================
Full report:
--------------------------------------------------------------------
ComputerSystem - 01_enum.py: PASS
--------------------------------------------------------------------
ComputerSystem - 02_nosystems.py: PASS
--------------------------------------------------------------------
ComputerSystem - 03_defineVS.py: PASS
--------------------------------------------------------------------
ComputerSystem - 04_defineStartVS.py: PASS
--------------------------------------------------------------------
ComputerSystem - 05_activate_defined_start.py: PASS
--------------------------------------------------------------------
ComputerSystem - 06_paused_active_suspend.py: SKIP
--------------------------------------------------------------------
ComputerSystem - 22_define_suspend.py: SKIP
ERROR                  - Exception: (1, u'Domain not running')
ERROR                  - Need to give different bridge name since it already exists
InvokeMethod(RequestStateChange): Domain not running
--------------------------------------------------------------------
ComputerSystem - 23_suspend_suspend.py: SKIP
--------------------------------------------------------------------
ComputerSystem - 27_define_suspend_errs.py: PASS
InvokeMethod(RequestStateChange): Domain not running
--------------------------------------------------------------------
ComputerSystem - 32_start_reboot.py: SKIP
--------------------------------------------------------------------
ComputerSystem - 33_suspend_reboot.py: SKIP
--------------------------------------------------------------------
ComputerSystem - 35_start_reset.py: SKIP
--------------------------------------------------------------------
ComputerSystem - 40_RSC_start.py: SKIP
--------------------------------------------------------------------
ComputerSystem - 41_cs_to_settingdefinestate.py: SKIP
--------------------------------------------------------------------
ComputerSystem - 42_cs_gi_errs.py: PASS
--------------------------------------------------------------------



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-13 08:48:00:

> # HG changeset patch
> # User Kaitlin Rupert <karupert@us.ibm.com>
> # Date 1218470745 25200
> # Node ID 5d79740edaf2e2f1d2062a0fad933a01a661dd50
> # Parent  30dd178dfe0f86b01fe36d36166e7e6c024be6ba
> [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 30dd178dfe0f -r 5d79740edaf2 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,12 @@
>  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 +54,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 +85,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 +126,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 +142,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 +175,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 +192,16 @@
>  
>          testsuite.print_results(test['group'], test['test'],
> os_status, output)
>  
> +    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