Cimtest setup

From Libvirt Wiki
Revision as of 11:33, 25 November 2010 by ChrisBoyle (talk | contribs) (De-spam)
Jump to: navigation, search


cimtest setup instructions

System requirements
  • Python-2.5
  • PyXML (on Redhat systems) or pyxml (on SUSE systems)
  • PyWBEM - recent CVS sources or sourceforge, untar and install as python install
  • Mercurial (for checking out the latest cimtest tree):
  • A working libvirt-cim environment. See here for instructions
$ hg clone
  • you can avoid mercurial by fetching the snapshot archives and extracting them
$ wget
$ tar xvzf cimtest-snapshot.tar.gz
Setup environment
  • Prepare the hypervisor kernel, initrd ramdisk and disk image files

# cd path_to_cimtest/suites/libvirt-cim/images/

1) On Test Machine with internet
  # make 

2) On Test Machine without internet
  In the absence of the internet you can see the following string in the error message when the make is run:
          " failed: Connection refused "
  Workarounds in absence of internet connectivity:
  Option 1:
  In case you are not connected to internet then run the following commands from the internet connected machine:
  scp initrd-1.1-i386.img <testmachine>:<path_to_cimtest>/suites/libvirt-cim/images
  On the test machine for KVM images:
  cd <path_to_cimtest>/suites/libvirt-cim/images
  mkdir -p xm-test [ If this already does not exist ]
  mv initrd-1.1-i386.img xm-test
  chmod +x
  (cd xm-test && sh ../ `basename xm-test/initrd-1.1-i386.img`)
  chmod +x
  ./ xm-test/xm-test.gz xm-test/xmt_disk.img
  cp xm-test/xmt_disk.img /tmp/default-kvm-dimage
  cp xm-test/xmt_disk.img /tmp/default-kvm-dimage.2ND
  also copy theses to  /var/lib/libvirt/images/
  Option 2:
  Else For KVM guest testing you can copy your installed KVM guest image to /var/lib/libvirt/images/default-kvm-dimage and /var/lib/libvirt/images/default-kvm-dimage.2ND

  • Generate RSA ssh keys for the root account if you do not have keys already.
 Note that you may need to disable SELinux on some systems as under
# setenforce 0 
# ssh-keygen -t rsa
  • Add the public key ( to the authorized_keys file.
# cat /root/.ssh/ >> /root/.ssh/authorized_keys
  • If you are using Pegasus, you may need to modify the access.conf file:
# vi /etc/Pegasus/access.conf
# Pegasus PAM Access Rules:
# 1. The pegasus user access rule:
#    By default, ONLY the pegasus user can use remote network HTTP/S service:
+: pegasus : ALL
# 2. The root user access rule:
#    By default, the root user can use pegasus local HTTP/S service:
+: root : wbemLocal
# 3. Disallow anything else:
#-: ALL : ALL
  • If using Pegasus, you will need the following settings:
 # /usr/sbin/cimconfig -s enableHttpConnection=true -p
 # /usr/sbin/cimconfig -s enableIndicationService=true -p
 # /usr/sbin/cimconfig -s repositoryIsDefaultInstanceProvider=true -p
  • If using sfcb, you need the following settings:
 # vi /etc/sfcb/sfcb.conf
# $Id:,v 1.13 2008/09/12 23:51:32 mchasal Exp $
# Sample Configuration for Small Footprint CIM Broker
httpPort:       5988
enableHttp:     true
enableUds:      false
httpProcs:      8
httpsPort:      5989
enableHttps:    false
httpsProcs:     8
provProcs:      64
doBasicAuth:    false
doUdsAuth:      true
basicAuthLib:   sfcBasicAuthentication
useChunking:    true
keepaliveTimeout: 1
keepaliveMaxRequest: 10
sslKeyFilePath: /usr/local/etc/sfcb/file.pem
sslCertificateFilePath: /usr/local/etc/sfcb/server.pem
sslClientTrustStore: /usr/local/etc/sfcb/client.pem
sslClientCertificate: ignore
certificateAuthLib:   sfcCertificateAuthentication
registrationDir: /usr/local/var/lib/sfcb/registration
providerDirs: /usr/local/lib /usr/local/lib/cmpi
enableInterOp:  true
  • Run the cimtest automation. You'll need to specify root/virt as the namespace, since the cimtest infrastructure uses root/cimv2 by default:
# cd path_to_cimtest
# CIM_NS=root/virt  ./runtests libvirt-cim -i localhost
  • You'll will probably need to supply the authentication info for your system (unless your CIMOM is configured to bypass authentication):
# CIM_NS=root/virt CIM_USER=root CIM_PASS=password ./runtests libvirt-cim -i  localhost
  • There are a few options available:
-c removes the log files prior to a run
-d prints the error messages to stdout in additional to printing to the log files (default behavior)
-g <suite_dir> runs a particular directory within the suite directory
-t <tc_name> runs a specific test for a given directory in the test suite
-v <virtualization type> runs the tests specifically for the type specified. Xen, XenFV, KVM, and LXC are currently supported. Xen is the current default. 
# CIM_NS=root/virt CIM_USER=pegasus CIM_PASS=password ./runtests libvirt-cim -i localhost -c -d -v KVM -g ComputerSystem -t
Note : If you terminate test before they complete, you will have to do clean up manually before you can rerun the test. 
       Test creates some pools like Network pool, you may clean them as under
       # virsh net-destroy cimtest-networkpool