1 karl 1.1 ##%{############################################################################
2 ##
3 ## Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
4 ## Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
5 ## Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
6 ## IBM Corp.; EMC Corporation, The Open Group.
7 ## Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
8 ## IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
9 ## Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
10 ## EMC Corporation; VERITAS Software Corporation; The Open Group.
11 ## Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
12 ## EMC Corporation; Symantec Corporation; The Open Group.
13 ##
14 ## Permission is hereby granted, free of charge, to any person obtaining a copy
15 ## of this software and associated documentation files (the "Software"), to
16 ## deal in the Software without restriction, including without limitation the
17 ## rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
18 ## sell copies of the Software, and to permit persons to whom the Software is
19 ## furnished to do so, subject to the following conditions:
20 ##
21 ## THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
22 karl 1.1 ## ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
23 ## "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
24 ## LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
25 ## PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
26 ## HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
27 ## ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 ## WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 ##
30 ##%}############################################################################
31
32 # Force use of WSMAN for live tests
33 export WSM_USE_WSMAN=1
34
35 # Option to use local directory in place of a CIMServer.
36 # If PEGASUS_CLIENT_HOME set to a directory we attempt to use that directory
37 # plus /repository as the local directory for Class operation.
38 # To use the server instead, comment out the following line.
39 export PEGASUS_CLIENT_HOME=$(PEGASUS_HOME)
40
|
41 karl 1.4 # Note that wsm uses the Pegasus core mak facilities driven from the following
42 # include.
|
43 karl 1.1 include $(PEGASUS_ROOT)/mak/config.mak
44
45 ifndef PEGASUS_ROOT
46 $(error Please define PEGASUS_ROOT)
47 endif
48
49 ifndef PEGASUS_HOME
50 $(error Please define PEGASUS_HOME)
51 endif
52
53 ifndef PEGASUS_PLATFORM
54 $(error Please define PEGASUS_PLATFORM)
55 endif
56
57 DIRS = src
58
59 # set up the port for wsm. Note that we
60 # set it here because there are multiple "default" ports for wsman.
61 # Within Inova testing we use 22222 and set that in the common/defines.h
62 # However, the tests with Microsoft use 80 and that is set in the defines.h
63 # when we export or compile in the test center to make life easier.
64 karl 1.1 # This also should be set to whatever the local "default"
65 WSMPORT = 22222
66
67 # The default WSMADDR simply sets the port. A user can set both the port
68 # and host address with the comand options WSMADDR="-s host -p port"
69 WSMADDR = -p $(WSMPORT)
70
71 # This controls port and host for the wsm address for the Pegasus $(CLI) commands
72 # in this test. It is NOT set for local tests. If a remote test is
73 # desired set it to PEGWSMADDR="-l host:port" on the make command line.
74 #PEGWSMADDR
75
|
76 karl 1.4 #WSM_USE_SSL
77
|
78 karl 1.1
79 include $(PEGASUS_ROOT)/mak/recurse.mak
80
81 ##==============================================================================
82 ##
83 ## rebuild:
84 ##
85 ##==============================================================================
86
87 rebuild:
88 $(MAKE) clean
89 $(MAKE)
90
91 ##==============================================================================
92 ##
93 ## live-tests:
94 ##
95 ##==============================================================================
96
97 NAMESPACE=root/cimv2
98 CROSSNAMESPACE=root/PG_InterOp
99 karl 1.1
|
100 karl 1.3 AUTH=
101
102 live-tests: register wsm cli
|
103 karl 1.1 @ echo ""
104 @ echo "+++++ PASSED ALL TESTS"
105 @ echo ""
106
|
107 karl 1.5 wsm: wsm1 wsm2 wsm3 get put delete
108
109 ## the following set of tests do passive tests against instances
110 ## defined through the register function
111 wsm1: identify get1 enum1 assoc1
|
112 karl 1.4
113 # Note that this is a temporary test.
114 identify:
115 wsmidentify
|
116 karl 1.5
117 # tests against static entities in the environment (created by register)
118 get1:
119 wsmget -n $(NAMESPACE) $(WSMADDR) President num=1 $(AUTH)
120 ## Test to be sure we are getting from non-default namespace.
121 wsmget -n $(CROSSNAMESPACE) $(WSMADDR) President num=1000 $(AUTH)
122
123 enum1:
124 wsmenum -n $(NAMESPACE) $(WSMADDR) President $(AUTH)
125
126 assoc1:
127 wsmassoc -n $(NAMESPACE) $(WSMADDR) President num=1 $(AUTH)
128 wsmassoc -n $(NAMESPACE) $(WSMADDR) -R President num=1 $(AUTH)
129
130 ## The following commands test the ability to create and delete objects
131
132 wsm2: create get put delete
|
133 karl 1.1 create:
134 wsmcreate -n $(NAMESPACE) $(WSMADDR) \
|
135 karl 1.3 President num=100 first=Betty last=Boop $(AUTH)
|
136 karl 1.1
|
137 karl 1.5 # note that this test depends on successful create target above
|
138 karl 1.1 get:
|
139 karl 1.3 wsmget -n $(NAMESPACE) $(WSMADDR) President num=100 $(AUTH)
|
140 karl 1.1 wsmget -n $(NAMESPACE) $(WSMADDR) \
141 PresidentLink \
142 pred:President pred.num=1 \
143 succ:President succ.num=2 \
|
144 karl 1.3 $(AUTH)
|
145 karl 1.1
146 put:
147 wsmput -n $(NAMESPACE) $(WSMADDR) President num=100 \
|
148 karl 1.3 _ num=100 first=Jane last=Doe $(AUTH)
149 wsmput -n $(NAMESPACE) $(WSMADDR) President num=100 _ last=Doe $(AUTH)
150 wsmput -n $(NAMESPACE) $(WSMADDR) President num=100 _ first=Jane $(AUTH)
151 wsmput -n $(NAMESPACE) $(WSMADDR) President num=100 _ num=100 $(AUTH)
|
152 karl 1.1
153 delete:
|
154 karl 1.3 wsmdelete -n $(NAMESPACE) $(WSMADDR) President num=100 $(AUTH)
|
155 karl 1.1
|
156 karl 1.5 ## register our special classes with the cimserver
|
157 karl 1.1 register:
158 $(MAKE) -C mof install NAMESPACE=$(NAMESPACE)
159
|
160 karl 1.5 wsm3: create3 get3 delete3
161 ## Test against a second class with multiple keys.
162 create3:
|
163 karl 1.1 wsmcreate -n $(NAMESPACE) $(WSMADDR) WSMClass \
164 key1=1 \
165 key2=Hello \
166 a1=one a1=two a1=two \
167 a2=1 a2=2 a2=3 a2=4 \
|
168 karl 1.3 a3=true a3=false $(AUTH)
|
169 karl 1.1
|
170 karl 1.5 get3:
|
171 karl 1.3 wsmget -n $(NAMESPACE) $(WSMADDR) WSMClass key1=1 key2=Hello $(AUTH)
|
172 karl 1.1
|
173 karl 1.5 delete3:
|
174 karl 1.3 wsmdelete -n $(NAMESPACE) $(WSMADDR) WSMClass key1=1 key2=Hello $(AUTH)
|
175 karl 1.1
|
176 karl 1.5 # These tests should generate error exit since they are gets against instances that
177 # should not exist in the defined namespaces.
178 wsmgeterr:
179 -wsmget -n -n $(NAMESPACE) $(WSMADDR) President num = 1000 $(AUTH)
180 -wsmget -n -n $(CROSSNAMESPACE) $(WSMADDR) President num = 1 $(AUTH)
181
182 ################################################################################
183 ##
184 ## Tests using cimcli
185 ##
186 ################################################################################
187
|
188 karl 1.1 # if using Pegasus 2.5 it was CLI. Pegasus 2.6 release and 2.7 dev changed this to
|
189 karl 1.5 # cimcli. If you use Pegasus 2.5, change back to CLI.
|
190 karl 1.1 CLICMD=cimcli
191
|
192 karl 1.5 cli: cli1 cli2 cli3 cli4 cli5 cli6 cli7
|
193 karl 1.2
|
194 karl 1.4 # enumerate and enumeratename tests
|
195 karl 1.2 cli1:
196
|
197 karl 1.1 $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) ei President -count 6
198 $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) ni President -count 6
199 $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) ei PresidentLink -count 6
200 $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) ni PresidentLink -count 6
|
201 karl 1.5 # the following tests do not know how many objects they return
|
202 karl 1.1 $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) ei CIM_ManagedElement
203 $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) ni CIM_ManagedElement
|
204 karl 1.2
|
205 karl 1.5 # get instance tests. These tests will error if the object is not found
206 cli2:
207 $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) gi President.num=1
208 ## test that we pass specific namespace since this object is only in crossnamespace
209 $(CLICMD) -n $(CROSSNAMESPACE) $(PEGWSMADDR) gi President.num=1000
210
211
212 # Test reference name requests
213 cli3:
214 $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) rn President.num=1 -count 3
215 $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) rn President.num=1 -rc Presidentlink -count 2
216 $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) rn President.num=1 -rc Presidentlink -r pred -count 2
217 $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) rn President.num=1 -rc Presidentlink -r succ -count 2
218 $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) rn President.num=1 -rc successionlink -count 1
219 $(CLICMD) -n $(CROSSNAMESPACE) $(PEGWSMADDR) rn VicePresident.num=1 -count 1
220
221 # reference requests
222 cli4:
223 $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) r President.num=1 -count 3
224 $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) r President.num=1 -rc Presidentlink -count 2
225 $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) r President.num=1 -rc Presidentlink -r pred -count 2
226 karl 1.5 $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) r President.num=1 -rc Presidentlink -r succ -count 2
227 $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) r President.num=1 -rc successionlink -count 1
228
|
229 karl 1.4 # association name requests
|
230 karl 1.5
231 cli5:
|
232 karl 1.1 $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) an President.num=1 -count 3
233 $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) an President.num=1 -rc President -count 2
234 $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) an President.num=1 -ac successionlink -count 1
235 $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) an President.num=1 -ac Presidentlink -count 2
236 $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) an President.num=1 -ac Presidentlink -rc President -count 2
237 $(CLICMD) -n $(CROSSNAMESPACE) $(PEGWSMADDR) an VicePresident.num=2000 -count 1
238 $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) an President.num=1 -ac successionlink -count 1
|
239 karl 1.5 $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) an President.num=1 -ac successionlink -count 0 -r succ
|
240 karl 1.4 # association requests
|
241 karl 1.5 cli6:
|
242 karl 1.1 $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) a President.num=1 -count 3
243 $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) a President.num=1 -rc President -count 2
244 $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) a President.num=1 -ac successionlink -count 1
245 $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) a President.num=1 -ac Presidentlink -count 2
246 $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) a President.num=1 -ac Presidentlink -rc President -count 2
247 $(CLICMD) -n $(CROSSNAMESPACE) $(PEGWSMADDR) a VicePresident.num=2000 -count 1
248 $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) a President.num=1 -ac successionlink -count 1
249
|
250 karl 1.5 # test to be sure the cli reference and association class operations are processed by the
251 # cimserver, not by wsm.
252 cli7:
253 $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) r President.num=1 -count 3
254 $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) rn President.num=1 -count 3
255 $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) a President.num=1 -count 3
256 $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) an President.num=1 -count 3
257
|
258 karl 1.1 ## The following tests represent errors in Pegasus
259 clierrorPegasus:
260 # These are caused becasue VicePresident is NOT in the $(NAMESPACE) namespace
261 $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) an President.num=1 -ac Presidentlink -rc VicePresident -count 2
262 $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) an President.num=1 -rc VicePresident -count 1
263 ##
264 ## Before running this, build and register the WSMMethodProvider under
265 ## src/providers/WSMMethodProvider.
266 ##
267
268 invoke:
269 wsminvoke WSMMethod meth p1=99 p2=true p3=Hello
270
271 ##
272 ## Repeat the test suite with the namespace name in upper case
273 ##
274 namespaceCase:
275 make -f Makefile live-tests NAMESPACE=ROOT/CIMV2
276
|
277 karl 1.3 ##
278 ## Run the wsm tests with basic authentication.
279 ##
280 ## Note that this is a unix only thing now because we start the wsmserver
281 ## There is an issue now with the initial server startup hanging sometimes.
282 ##
283 testbasicauthwsm:
284 wsmserver -A basic &
285 make -f Makefile wsm AUTH="-A basic -u fred -w none"
|
286 karl 1.4 make -f Makefile killwsm
|
287 karl 1.3
|
288 karl 1.4 ##
289 ## Run the wsm tests with digest authentication.
290 ##
|
291 karl 1.3 testdigestauthwsm:
292 wsmserver -A digest &
293 make -f Makefile wsm AUTH="-A digest -u fred -w none"
|
294 karl 1.4 make -f Makefile killwsm
|
295 karl 1.3 ##
296 ## kill the wsmserver - This is a unix only thing right now
297 ## because it uses the unix kill command
298 ##
|
299 karl 1.4 killwsm:
|
300 karl 1.3 kill -9 wsmserver
|
301 karl 1.1
302 ##
303 ## Stop server, regenerate repository, restart the server:
304 ##
305 regen:
306 -cimserver -s
307 make -C $(PEGASUS_ROOT) repository
308 -cimserver
309
310 ##==============================================================================
311 ##
312 ## CVS tag and definition of current version:
313 ##
314 ##==============================================================================
315
316 MAJOR=0
317 MINOR=4
318 REVSION=02
319 VERSION=$(MAJOR).$(MINOR).$(REVSION)
320 TAG=wsm_$(MAJOR)_$(MINOR)_$(REVSION)
321
322 karl 1.1 tag:
323 @ cvs tag -F $(TAG) > /dev/null
324 @ echo "Added $(TAG) tag"
325 ##==============================================================================
326 ##
327 ## dist: Create a distributable set of source files compacted.
328 ##
329 ##==============================================================================
330
331 DISTROOT=wsm-$(VERSION)
332 TARDIST=$(DISTROOT).tar.gz
333 ZIPDIST=$(DISTROOT).zip
334
335 dist:
336 rm -f /tmp/$(TARDIST)
337 rm -f /tmp/$(ZIPDIST)
338 rm -rf /tmp/$(DISTROOT)
339 cp -r . /tmp/$(DISTROOT)
340 rm -rf `find /tmp/$(DISTROOT) -name CVS`
341 echo "Creating /tmp/$(TARDIST)..."
342 ( cd /tmp ; tar zcf $(TARDIST) $(DISTROOT) )
343 karl 1.1 echo "Creating /tmp/$(ZIPDIST)..."
344 ( cd /tmp/$(DISTROOT) ; zip -q -R ../$(ZIPDIST) '*' )
345 rm -rf /tmp/$(DISTROOT)
346
|