os-cmpi-xen

view test/setup-test.sh @ 121:4868ace2726b

Add initial consistence checks in test suite for Xen_MemoryPool, Xen_ProcessorPool and Xen_VirtualSystemManagementService.

Signed-off-by: Luke Szymanski <Lukasz.Szymanski@Unisys.com>
author Jim Fehlig <jfehlig@novell.com>
date Fri Jun 08 10:22:05 2007 -0600 (2007-06-08)
parents eed587b5cd47
children
line source
1 #! /bin/bash
2 # Author: Luke Szymanski <Lukasz.Szymanski@Unisys.com>
3 # Contributors: Jim Fehlig <jfehlig@novell.com>
4 # Description: Set up test to run sblim-testsuite for Xen CIM providers
5 #
6 # Copyright (C) 2007 Unisys Corporation
7 #
8 # This library is free software; you can redistribute it and/or
9 # modify it under the terms of the GNU Lesser General Public
10 # License as published by the Free Software Foundation; either
11 # version 2.1 of the License, or (at your option) any later version.
12 #
13 # This library is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 # Lesser General Public License for more details.
17 #
18 # You should have received a copy of the GNU Lesser General Public
19 # License along with this library; if not, write to the Free Software
20 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 #
23 # see if simlink to sblim-test suite directory exists
24 #set -x
25 cd sblim-test-suite 2> /dev/null
27 if [ $? == 0 ]; then
28 cd - 1> /dev/null
29 else
30 # find path to sblim-test directory if not there already and create simlink
31 echo 'Setting up test environment ...'
32 DIRS="/usr/share/sblim-testsuite /usr/local/share/sblim-testsuite"
33 for name in $DIRS
34 do
35 echo -n "checking $name for sblim-testsuite ... "
36 if test -x $name/run.sh ; then
37 echo "yes"
38 if test x"$TESTSUITEDIR" == x; then
39 TESTSUITEDIR=$name
40 fi
41 break;
42 else
43 echo "no"
44 fi
45 done
46 if test x"${TESTSUITEDIR}" == x; then
47 echo "Unable to find sblim-testsuite"
48 echo "Please install or specify location with TESTSUITE environment variable"
49 exit 1
50 fi
52 echo "Using test suite: $TESTSUITEDIR"
53 ln -s $TESTSUITEDIR sblim-test-suite
54 fi
57 # Read instance provider list, make provider_name.cim file from template,
58 # and replace 'ASDF' with provider name
60 cp instance_provider_list sblim-test-suite/instance_provider_list
61 cp instance_provider_template sblim-test-suite/cim
62 cd sblim-test-suite/cim
63 cat ../instance_provider_list | \
64 while read line
65 do
66 text_file=$line.cim
67 cp instance_provider_template $text_file
68 sed -e 's/ASDF/'$line'/g' $text_file > temp
69 mv -f temp $text_file
70 done
72 rm ../instance_provider_list
73 rm instance_provider_template
74 cd ../..
76 # Read association provider list, make association_name.cim file from
77 # template, and replace 'ASDF' with association name. Also, harvest
78 # classes and roles on both sides of the association from .mof files
79 # and put them into the association_name.cim file.
81 cp association_provider_list sblim-test-suite/association_provider_list
82 cp association_provider_template sblim-test-suite/cim
83 cd sblim-test-suite/cim
84 cat ../association_provider_list | \
85 while read line
86 do
87 text_file=$line.cim
88 cp association_provider_template $text_file
89 sed -e 's/ASDF/'$line'/g' $text_file > temp
90 mv -f temp $text_file
92 # grep info from schema files
93 cd ../..
94 grep REF ../schema/$line.mof . | sed -e 's/^.*://g' -e 's/ *//g' -e 's/;//g' > qqq
95 LHS_CL=`sed -e '2d' qqq -e 's/REF.*$//'`
96 RHS_CL=`sed -e '1d' qqq -e 's/REF.*$//'`
97 LHS_RL=`sed -e '2d' qqq -e 's/^.*REF//'`
98 RHS_RL=`sed -e '1d' qqq -e 's/^.*REF//'`
99 rm qqq
101 # fill out .cim file
102 cd sblim-test-suite/cim
103 sed -e 's/LHS_CLASS/'$LHS_CL'/g' $text_file > temp
104 mv -f temp $text_file
105 sed -e 's/RHS_CLASS/'$RHS_CL'/g' $text_file > temp
106 mv -f temp $text_file
107 sed -e 's/LHS_ROLE/'$LHS_RL'/g' $text_file > temp
108 mv -f temp $text_file
109 sed -e 's/RHS_ROLE/'$RHS_RL'/g' $text_file > temp
110 mv -f temp $text_file
111 done
113 rm ../association_provider_list
114 rm association_provider_template
116 # Copy provider_name.system files to the system/linux directory
117 # These files are for the consistence test
118 cd ../..
119 cp system/* sblim-test-suite/system/linux
121 echo 'Done.'