os-cmpi-xen

changeset 111:e0f77c47f58a

This is the beginning of the test suite. The provider intrinsics
will be exercised with sblimtest suite.

Signed-off-by: Luke Szymanski <Lukasz.Szymanski@Unisys.com>
author Jim Fehlig <jfehlig@novell.com>
date Thu May 17 15:21:52 2007 -0600 (2007-05-17)
parents f99d9b081535
children b2ece8dd1391
files ChangeLog test/README test/provider_list test/provider_template test/run-test.sh test/setup-test.sh
line diff
     1.1 --- a/ChangeLog	Mon May 14 11:01:37 2007 -0600
     1.2 +++ b/ChangeLog	Thu May 17 15:21:52 2007 -0600
     1.3 @@ -1,3 +1,10 @@
     1.4 +-------------------------------------------------------------------
     1.5 +Thu May 17 15:18:02 MDT 2007 - jfehlig@novell.com
     1.6 +
     1.7 +        - Added test directory and scripts.  The beginnings of
     1.8 +          automated testing for the project!  Patches provided by
     1.9 +          Luke Szymanski.
    1.10 +
    1.11  -------------------------------------------------------------------
    1.12  Mon May 14 10:56:45 MDT 2007 - jfehlig@novell.com
    1.13  
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/test/README	Thu May 17 15:21:52 2007 -0600
     2.3 @@ -0,0 +1,40 @@
     2.4 +1.  INTRODUCTION
     2.5 +
     2.6 +The test directory provides scripts, input files, etc. for automated testing of
     2.7 +Xen CIM providers.  sblim-testsuite (http://sblim.wiki.sourceforge.net/TestSuite)
     2.8 +provides a test infrastructure for CIM instrumentation and is used by this
     2.9 +project.  sblim-testsuite is capable of running interface and consistence tests.
    2.10 +Interface tests are tests performed on the various provider interfaces, e.g.
    2.11 +instance, method, and association.  Consistence tests include verifying the
    2.12 +corrent number of instances is returned, verifying the property value of a
    2.13 +given instance is correct, and so on.
    2.14 +
    2.15 +Currently only a subset of the instance interface tests are implemented:
    2.16 +enumInstanceNames
    2.17 +enumInstances
    2.18 +getInstance
    2.19 +
    2.20 +2.  CONFIGURING
    2.21 +
    2.22 +You must have sblim-wbemcli and sblim-testsuite working properly in order
    2.23 +to run the automated tests.
    2.24 +
    2.25 +Location of installed sblim-testsuite can be specified using TESTSUITEDIR
    2.26 +environment variable.  If not specified, /usr/share/sblim-testsuite and
    2.27 +/usr/local/share/sblim-testsuite will be tried.
    2.28 +
    2.29 +3.  BUILDING
    2.30 +
    2.31 +
    2.32 +4.  INSTALLING
    2.33 +
    2.34 +Run the setup-test script at the beginning of your testing. You must have
    2.35 +write access to the directory containing sblim-testsuite.
    2.36 +
    2.37 +If at any point you wish to add or remove a provider for testing, simply 
    2.38 +update the provider_list and it will automatically be included in the testing.
    2.39 +
    2.40 +5.  RUNNING
    2.41 +
    2.42 +Run the run-test.sh script.  The results are in the file called 'results'
    2.43 +
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/test/provider_list	Thu May 17 15:21:52 2007 -0600
     3.3 @@ -0,0 +1,22 @@
     3.4 +Xen_RegisteredSVProfile
     3.5 +Xen_RegisteredVSProfile
     3.6 +Xen_VirtualSystemManagementService
     3.7 +Xen_VirtualSystemManagementCapabilities
     3.8 +Xen_ComputerSystem
     3.9 +Xen_ComputerSystemSettingData
    3.10 +Xen_ComputerSystemCapabilities
    3.11 +Xen_VirtualizationCapabilities
    3.12 +Xen_Disk
    3.13 +Xen_DiskSettingData
    3.14 +Xen_Memory
    3.15 +Xen_MemorySettingData
    3.16 +Xen_MemoryCapabilitiesSettingData
    3.17 +Xen_Processor
    3.18 +Xen_ProcessorSettingData
    3.19 +Xen_ProcessorCapabilitiesSettingData
    3.20 +Xen_Console
    3.21 +Xen_ConsoleSettingData
    3.22 +Xen_NetworkPortSettingData
    3.23 +Xen_NetworkPort
    3.24 +Xen_MemoryPool
    3.25 +Xen_ProcessorPool
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/test/provider_template	Thu May 17 15:21:52 2007 -0600
     4.3 @@ -0,0 +1,13 @@
     4.4 +********************************************************************************
     4.5 +class : ASDF
     4.6 +objectPath : 
     4.7 +		
     4.8 +--------------------------------------------------------------------------------
     4.9 +Instance                                                       enumInstanceNames
    4.10 +
    4.11 +--------------------------------------------------------------------------------
    4.12 +Instance                                                           enumInstances
    4.13 +
    4.14 +--------------------------------------------------------------------------------
    4.15 +Instance                                                                     get
    4.16 +
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/test/run-test.sh	Thu May 17 15:21:52 2007 -0600
     5.3 @@ -0,0 +1,37 @@
     5.4 +#! /bin/bash
     5.5 +# Author: Luke Szymanski <Lukasz.Szymanski@Unisys.com>
     5.6 +# Contributors:
     5.7 +# Description: Run sblim-test suite with Xen CIM providers
     5.8 +#
     5.9 +# Copyright (C) 2007 Unisys Corporation
    5.10 +#
    5.11 +# This library is free software; you can redistribute it and/or
    5.12 +# modify it under the terms of the GNU Lesser General Public
    5.13 +# License as published by the Free Software Foundation; either
    5.14 +# version 2.1 of the License, or (at your option) any later version.
    5.15 +#
    5.16 +# This library is distributed in the hope that it will be useful,
    5.17 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
    5.18 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    5.19 +# Lesser General Public License for more details.
    5.20 +#
    5.21 +# You should have received a copy of the GNU Lesser General Public
    5.22 +# License along with this library; if not, write to the Free Software
    5.23 +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    5.24 +#
    5.25 +
    5.26 +cp provider_list sblim-test-suite/provider_list
    5.27 +CMPI_TEST_PATH=`pwd`
    5.28 +cd sblim-test-suite
    5.29 +
    5.30 +echo 'Starting provider test ...'
    5.31 +
    5.32 +cat provider_list |   \
    5.33 +while read line
    5.34 +do
    5.35 +	./run.sh $line >> $CMPI_TEST_PATH/results 2>/dev/null
    5.36 +done
    5.37 +
    5.38 +echo 'Done. Results are in file results.'
    5.39 +
    5.40 +rm provider_list
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/test/setup-test.sh	Thu May 17 15:21:52 2007 -0600
     6.3 @@ -0,0 +1,75 @@
     6.4 +#! /bin/bash
     6.5 +# Author: Luke Szymanski <Lukasz.Szymanski@Unisys.com>
     6.6 +# Contributors: Jim Fehlig <jfehlig@novell.com>
     6.7 +# Description: Set up test to run sblim-testsuite for Xen CIM providers
     6.8 +#
     6.9 +# Copyright (C) 2007 Unisys Corporation
    6.10 +#
    6.11 +# This library is free software; you can redistribute it and/or
    6.12 +# modify it under the terms of the GNU Lesser General Public
    6.13 +# License as published by the Free Software Foundation; either
    6.14 +# version 2.1 of the License, or (at your option) any later version.
    6.15 +#
    6.16 +# This library is distributed in the hope that it will be useful,
    6.17 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
    6.18 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    6.19 +# Lesser General Public License for more details.
    6.20 +#
    6.21 +# You should have received a copy of the GNU Lesser General Public
    6.22 +# License along with this library; if not, write to the Free Software
    6.23 +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    6.24 +#
    6.25 +
    6.26 +# see if simlink to sblim-test suite directory exists
    6.27 +#set -x
    6.28 +cd sblim-test-suite 2> /dev/null
    6.29 +
    6.30 +if [ $? == 0 ]; then
    6.31 +	cd - 1> /dev/null
    6.32 +else
    6.33 +	# find path to sblim-test directory if not there already and create simlink
    6.34 +        echo 'Setting up test environment ...'
    6.35 +	DIRS="/usr/share/sblim-testsuite /usr/local/share/sblim-testsuite"
    6.36 +	for name in $DIRS
    6.37 +	do
    6.38 +	    echo -n "checking $name for sblim-testsuite ... "
    6.39 +	    if test -x $name/run.sh ; then
    6.40 +		echo "yes"
    6.41 +		if test x"$TESTSUITEDIR" == x; then
    6.42 +		    TESTSUITEDIR=$name
    6.43 +		fi
    6.44 +	        break;
    6.45 +	    else
    6.46 +		echo "no"
    6.47 +	    fi
    6.48 +        done
    6.49 +	if test x"${TESTSUITEDIR}" == x; then
    6.50 +	    echo "Unable to find sblim-testsuite"
    6.51 +	    echo "Please install or specify location with TESTSUITE environment variable"
    6.52 +	    exit 1
    6.53 +	fi
    6.54 +
    6.55 +	echo "Using test suite: $TESTSUITEDIR"
    6.56 +	ln -s $TESTSUITEDIR sblim-test-suite
    6.57 +fi
    6.58 +
    6.59 +
    6.60 +# Read provider list, make provider_name.cim file from template, 
    6.61 +# and replace 'ASDF' with provider name
    6.62 +
    6.63 +cp provider_list sblim-test-suite/provider_list
    6.64 +cp provider_template sblim-test-suite/cim
    6.65 +cd sblim-test-suite/cim
    6.66 +cat ../provider_list |   \
    6.67 +while read line
    6.68 +do
    6.69 +	text_file=$line.cim
    6.70 +	cp provider_template $text_file
    6.71 +	sed -e 's/ASDF/'$line'/g' $text_file > temp
    6.72 +	mv -f temp $text_file
    6.73 +done
    6.74 +
    6.75 +rm ../provider_list
    6.76 +rm provider_template
    6.77 +
    6.78 +echo 'Done.'