BUG#: 8730
[tpot/pegasus/.git] / src / Providers / TestProviders / CLITestProvider / tests / Makefile
1 #//%LICENSE////////////////////////////////////////////////////////////////
2 #//
3 #// Licensed to The Open Group (TOG) under one or more contributor license
4 #// agreements.  Refer to the OpenPegasusNOTICE.txt file distributed with
5 #// this work for additional information regarding copyright ownership.
6 #// Each contributor licenses this file to you under the OpenPegasus Open
7 #// Source License; you may not use this file except in compliance with the
8 #// License.
9 #//
10 #// Permission is hereby granted, free of charge, to any person obtaining a
11 #// copy of this software and associated documentation files (the "Software"),
12 #// to deal in the Software without restriction, including without limitation
13 #// the rights to use, copy, modify, merge, publish, distribute, sublicense,
14 #// and/or sell copies of the Software, and to permit persons to whom the
15 #// Software is furnished to do so, subject to the following conditions:
16 #//
17 #// The above copyright notice and this permission notice shall be included
18 #// in all copies or substantial portions of the Software.
19 #//
20 #// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21 #// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22 #// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23 #// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
24 #// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
25 #// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
26 #// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27 #//
28 #//////////////////////////////////////////////////////////////////////////
29
30 # Test cimcli using the cimcli test Provider and other information in the
31 # server.
32
33 ROOT = ../../../../..
34 DIR = Providers/TestProviders/CLITestProvider/tests
35
36 SRC_DIR = $(ROOT)/src/$(DIR)
37
38 ifdef PEGASUS_TMP
39     TMP_DIR = $(subst \,/,$(PEGASUS_TMP))
40 else
41     TMP_DIR = $(SRC_DIR)
42 endif
43
44
45 QUOTE=\"
46
47 ifeq ($(OS_TYPE),vms)
48 QUOTE=""
49 endif
50
51 include $(ROOT)/mak/config.mak
52 include $(ROOT)/mak/configschema.mak
53
54 RESULTFILE = $(TMP_DIR)/result
55 MASTERRESULTFILE = $(SRC_DIR)/result.master
56
57 TABLEFORMATFILE = $(TMP_DIR)/tableformat
58 MASTERTABLEFORMATFILE = $(SRC_DIR)/tableformat.master
59
60 HELPRESULTFILE = $(TMP_DIR)/helpresult
61 ifdef PEGASUS_HAS_SSL
62 MASTERHELPRESULTFILE = $(SRC_DIR)/helpresult.master.ssl
63 else
64 MASTERHELPRESULTFILE = $(SRC_DIR)/helpresult.master
65 endif
66
67 NSRESULTFILE = $(TMP_DIR)/namespacetestresult
68 MASTERNSRESULTFILE = $(SRC_DIR)/namespacetestresult.master
69
70 # sampleprovider\Load puts the sample MOF into a separate namespace.
71 # The following variable defines this namespace.
72
73 PROVIDERNS=test/TestProvider
74 STATICNS=test/static
75
76 ## Define this namespace because it is based on CIM 2.5 which is
77 ## completely static and which we can use to test some of the
78 ## class and qualifier operations and feel assured that the
79 ## returned information is constant. The static namespace is defined to
80 ## be the current default and so changes with each new pegasus
81 ## default namespace change.
82 TESTCIMV2=test/cimv2
83
84 depend:
85
86 sub:
87
88 misc:
89
90 tests:
91
92 messages:
93
94 general:
95
96
97 ### Test the getclass operation.  This serves both as a test of getclass
98 ### and a confirmation that we have not modified the class since the output
99 ### diff will fail if the class is modified
100 getclass:
101         @$(ECHO) 0. +++++ Test For getClass
102         @$(ECHO) 0. +++++ Test For getClass  >> $(RESULTFILE)
103
104         @cimcli gc -n "$(PROVIDERNS)"  Test_CLITestProviderClass \
105             >> $(RESULTFILE)
106         @cimcli gc -n "$(PROVIDERNS)"  Test_CLITestProviderLinkClass \
107             >> $(RESULTFILE)
108         @cimcli gc -n "$(PROVIDERNS)"  Test_CLITestProviderLinkClass -niq \
109             >> $(RESULTFILE)
110 ##      output as xml and repeat with the -ic option set
111         @cimcli gc -n "$(PROVIDERNS)"  Test_CLITestProviderLinkClass -o xml \
112             >> $(RESULTFILE)
113         @cimcli gc -n "$(PROVIDERNS)"  Test_CLITestProviderLinkClass -o xml \
114             -ic >> $(RESULTFILE)
115         @$(ECHO) 0. +++++ Test getClass
116
117 ### Test reference parameters
118 testRefs:
119         @$(ECHO) 1. +++++ Test For Reference params
120         @$(ECHO) 1. +++++ Test For Reference params  >> $(RESULTFILE)
121 ##      Test removed.
122
123
124 ### test get and set property operations
125 testPropertyOperations:
126         @$(ECHO) 2. +++++ Test Getproperty and setProperty
127         @$(ECHO) 2. +++++ Test Getproperty and setProperty >> $(RESULTFILE)
128
129 ##@cimcli sp  -n "$(PROVIDERNS)" Test_CLITestProviderClass.Id=\"Mike\" Name John
130         @cimcli gp  -n "$(PROVIDERNS)"  \
131             Test_CLITestProviderClass.Id=\"Mike\" Name >> $(RESULTFILE)
132
133 ##      Test property values for the predefined instance
134         @cimcli ni -n "$(PROVIDERNS)" Test_CLITestProviderClass >> $(RESULTFILE)
135         @cimcli ei -n "$(PROVIDERNS)" Test_CLITestProviderClass >> $(RESULTFILE)
136         @$(ECHO) 2. +++++ Test_CLITestProviderClass Instances
137
138 ### test create instance operations
139 testCreateInstanceOperation:
140         @$(ECHO) 3. +++++ Test Instances create Instance
141         @$(ECHO) 3. +++++ Tests Instances create Instance >> $(RESULTFILE)
142
143 ## Test Instance Creation with scalars
144         @cimcli ci -n "$(PROVIDERNS)" Test_CLITestProviderClass \
145             Id="ScalarTest" \
146             scalBool=true scalUint8=12 scalSint8=12 scalUint16=500 \
147             scalSint16=500 scalUint32=9999 scalSint32=9999 \
148             scalUint64=99999 scalUint64=99999 scalString="testString" \
149             >> $(RESULTFILE)
150
151 ##      Test the creation. Will do error exit if this fails
152         @cimcli ti -n "$(PROVIDERNS)" Test_CLITestProviderClass \
153             Id="ScalarTest" \
154             scalBool=true scalUint8=12 scalSint8=12 scalUint16=500 \
155             scalSint16=500 scalUint32=9999 scalSint32=9999 \
156             scalUint64=99999 scalUint64=99999 scalString="testString" \
157             >> $(RESULTFILE)
158
159 ##      Test Instance Creation with arrays
160         @cimcli ci -n "$(PROVIDERNS)" Test_CLITestProviderClass Id="arrayTest" \
161             arrayBool=true,true,true,false,true \
162             arrayUint8=12  arraySint8=-127,0,12,127 \
163             arrayUint32=99,0,31000,63000,4294967295 \
164             arraySint32=-32000,0,32000,-2147483648,2147483647 \
165             arrayUint64=99,0,31000,63000,18446744073709551615 \
166             arraySint64=-32000,0,32000,-9223372036854775808 \
167             scalString="testString" \
168             scalDateTime=19991224120000.000000+360 >> $(RESULTFILE)
169
170 ##      run testintance against the instance just created
171         @cimcli ti -n "$(PROVIDERNS)" Test_CLITestProviderClass Id="arrayTest" \
172             arrayBool=true,true,true,false,true \
173             arrayUint8=12  arraySint8=-127,0,12,127 \
174             arrayUint32=99,0,31000,63000,4294967295 \
175             arraySint32=-32000,0,32000,-2147483648,2147483647 \
176             arrayUint64=99,0,31000,63000,18446744073709551615 \
177             arraySint64=-32000,0,32000,-9223372036854775808 \
178             scalString="testString" \
179             scalDateTime=19991224120000.000000+360 >> $(RESULTFILE)
180
181 ##      Test enumerate of All the instances we created
182         @cimcli ni -n "$(PROVIDERNS)" Test_CLITestProviderClass >> $(RESULTFILE)
183         @cimcli ei -n "$(PROVIDERNS)" Test_CLITestProviderClass >> $(RESULTFILE)
184
185 ### Test multiple forms of modifyInstance. Requires instance created in
186 ### test 3
187 testModifyInstanceOperation:
188         @$(ECHO) 4. +++++ Test Instances modify Instance
189         @$(ECHO) 4. +++++ Test Instances modify Instance >> $(RESULTFILE)
190
191         @cimcli mi -n "$(PROVIDERNS)" Test_CLITestProviderClass \
192             Id="ScalarTest" \
193             scalBool=false scalUint8=14 scalSint8=-12 scalUint16=501 \
194             scalSint16=501 scalUint32=9998 scalSint32=9999 \
195             scalUint64=888 scalUint64=1 >> $(RESULTFILE)   
196              
197         @cimcli ti -n "$(PROVIDERNS)" Test_CLITestProviderClass \
198             Id="ScalarTest" \
199             scalBool=false scalUint8=14 scalSint8=-12 scalUint16=501 \
200             scalSint16=501 scalUint32=9998 scalSint32=9999 \
201             scalUint64=888 scalUint64=1 scalString=testString >> $(RESULTFILE)
202
203 #####   NOTE: This test reflects a possible error in Pegasus today.  The
204 #####       key property should not be required in the input.
205         @cimcli mi -n "$(PROVIDERNS)" \
206             Test_CLITestProviderClass.Id=\"ScalarTest\" \
207             Id=ScalarTest \
208             scalBool=true scalUint8=15 scalSint8=-13 scalUint16=502 \
209             scalSint16=502 scalUint32=9997 scalSint32=9998 \
210             scalUint64=888 scalUint64=1 >> $(RESULTFILE)
211
212         @cimcli ti -n "$(PROVIDERNS)" Test_CLITestProviderClass \
213             Id=ScalarTest \
214             scalBool=true scalUint8=15 scalSint8=-13 scalUint16=502 \
215             scalSint16=502 scalUint32=9997 scalSint32=9998 \
216             scalUint64=888 scalUint64=1 >> $(RESULTFILE)
217
218         @$(ECHO) +++++ Test modify instance Passed.
219
220
221 ### Test Delete instance. Assumes instances created with testCreateInstance
222 testDeleteInstanceOperation:    
223         @$(ECHO) 5. +++++ Test delete instance
224         @$(ECHO) 5. +++++ Test delete instance >> $(RESULTFILE)
225
226 ##      test with CIMObjectPath input parameter
227         @cimcli di -n "$(PROVIDERNS)" \
228             Test_CLITestProviderClass.Id=\"ScalarTest\" >> $(RESULTFILE)
229
230 ##      test delete with class name=value input parameter
231         @cimcli di -n "$(PROVIDERNS)" \
232             Test_CLITestProviderClass Id=arrayTest >> $(RESULTFILE)
233
234         @cimcli ci -n "$(PROVIDERNS)" Test_CLITestProviderClass \
235             Id="ScalarTest" \
236             scalBool=true  \
237             scalUint8=12 scalSint8=12 \
238             scalUint16=500 scalSint16=500 \
239             scalUint32=9999 scalSint32=9999 \
240             scalUint64=99999 scalUint64=99999 \
241             scalString="testString" \
242             >> $(RESULTFILE)
243
244 ##      Test the creation. Will do error exit if this fails
245         @cimcli ti -n "$(PROVIDERNS)" Test_CLITestProviderClass \
246             Id="ScalarTest" \
247             scalBool=true \
248             scalUint8=12 scalSint8=12 \
249             scalUint16=500 scalSint16=500 \
250             scalUint32=9999 scalSint32=9999 \
251             scalUint64=99999 scalUint64=99999 \
252             scalString="testString" \
253             >> $(RESULTFILE)
254
255         @cimcli di -n "$(PROVIDERNS)" \
256             Test_CLITestProviderClass Id=ScalarTest >> $(RESULTFILE)
257
258         @$(ECHO) +++++ Test delete instance Passed.
259
260 ### Test invoke method with a variety of parameter data types
261 testInvokeMethod:
262         @$(ECHO) 6. +++++ Test invokeMethod
263         @$(ECHO) 6. +++++ Test invokeMethod >> $(RESULTFILE)
264
265 ##      Test using inOutParameter method that returns all
266 ##      input parameters as corresponding output parameters
267         @cimcli im Test_CLITestProviderClass -n "$(PROVIDERNS)" \
268             InOutParamTest \
269             scalBool=true \
270             arrayBool=true,false,true \
271             scalUint32=99 \
272             arrayUint32=99,0,31000,63000 \
273             scalSint32=-99 \
274             arraySint32=-32000,0,32000 \
275             scalString=ThisIsMyTest \
276             arrayString="one",two,"three","multiword string" \
277             scalDateTime=19991224120000.000000+360 \
278             arrayDateTime=19991224120000.000000+360,19991224120000.000000+360 \
279             >>$(RESULTFILE)
280         @$(ECHO) +++++ Test invoke method Passed.
281
282 ### Test cimcli output with the table output format
283 testTableOutputFormat:
284         @$(ECHO) 7. +++++ Test table output format
285         @$(ECHO) 7. +++++ Test table output format >> $(TABLEFORMATFILE)
286
287         @cimcli ci -n "$(PROVIDERNS)" Test_CLITestProviderClass \
288             Id=Norman Name=Susan
289         @cimcli ci -n "$(PROVIDERNS)" Test_CLITestProviderClass \
290             Id=Thomas Name=Peter
291         @cimcli ei -n "$(PROVIDERNS)" Test_CLITestProviderClass \
292             -o table \
293             >> $(TABLEFORMATFILE)
294         @cimcli ei -n "$(PROVIDERNS)" Test_CLITestProviderClass \
295             -o table \
296             -pl Id,Name,scaleBool,scalUint8,arrayBool \
297             >> $(TABLEFORMATFILE)
298
299         @cimcli di -n "$(PROVIDERNS)" Test_CLITestProviderClass.Id=\"Norman\"
300         @cimcli di -n "$(PROVIDERNS)" Test_CLITestProviderClass.Id=\"Thomas\"
301         @$(ECHO) +++++ Test table output format Passed.
302
303 ### Test qualifer declaration get and enumerate.
304 testQualifierDecls:
305         @$(ECHO) 8. +++++ Test QualifierDecl Operations
306         @$(ECHO) 8. +++++ Test QualifierDecl Operations >> $(RESULTFILE)
307
308         @cimcli gq -n "$(TESTCIMV2)" Association >>$(RESULTFILE)
309 ##      Use sort to assure ordering of response objects
310         @cimcli eq -n "$(TESTCIMV2)" --sort >>$(RESULTFILE)
311         @$(ECHO) +++++ Test QualifierDecls Passed.
312
313 ### Test the class operations.  Note that we may have issues with the
314 ### enumerates and ordering. Also we use the static namespace to 
315 ### assure that the classes do not change
316 testClassOperations:
317         @$(ECHO) 9. +++++ getClass Operation
318         @$(ECHO) 9. +++++ getClass Operation >> $(RESULTFILE)
319
320         @cimcli nc -n $(STATICNS) --sum -count 67 >>$(RESULTFILE)
321         @cimcli nc -n $(STATICNS) --sort >>$(RESULTFILE)
322         @cimcli gc CIM_ManagedElement -n $(STATICNS) >>$(RESULTFILE)
323         @cimcli gc CIM_ManagedElement -n $(STATICNS) -o xml >>$(RESULTFILE)
324         @$(ECHO) +++++ Test ClassOperations Passed.
325
326 ### Test different options on propertylist parameter
327 testPropertyListOption:
328         @$(ECHO) 10. +++++ testPropertyListOptions
329         @$(ECHO) 10. +++++ testPropertyListOptions >> $(RESULTFILE)
330
331         @cimcli gc CIM_ManagedElement -n $(STATICNS) -pl Caption \
332             >>$(RESULTFILE)
333         @cimcli gc CIM_ManagedElement -n $(STATICNS) \
334             -pl Caption,Description >>$(RESULTFILE)
335         @cimcli gc CIM_ManagedElement -n $(STATICNS) \
336          -pl Caption,Description,ElementName >>$(RESULTFILE)
337         @cimcli gc CIM_ManagedElement -n $(STATICNS) -pl "" >>$(RESULTFILE)
338
339         @cimcli ei -n "$(PROVIDERNS)" Test_CLITestProviderClass \
340             -pl scalBool,arrayUint64 >>$(RESULTFILE)
341         @cimcli ei -n "$(PROVIDERNS)" Test_CLITestProviderClass \
342             -pl "" >>$(RESULTFILE)
343
344         @cimcli gi -n "$(PROVIDERNS)" Test_CLITestProviderClass.Id=\"Mike\" \
345             -pl scalBool,arrayUint64,scalString  >>$(RESULTFILE)
346         @$(ECHO) +++++ Test testPropertyListOption Passed.
347
348 ### Test the different formats for input of getinstance operation
349 testGetInstanceOperation:
350         @$(ECHO) 12. +++++ test getInstance Operation
351         @$(ECHO) 12. +++++ test getInstance Operation >> $(RESULTFILE)
352
353         @cimcli gi Test_CLITestProviderClass -n "$(PROVIDERNS)" Id=Mike \
354             >>$(RESULTFILE)
355
356         @cimcli gi Test_CLITestProviderClass -n "$(PROVIDERNS)" Id=Mike \
357             -pl Name,scalBool >>$(RESULTFILE)
358
359         @cimcli gi Test_CLITestProviderClass.Id=\"Mike\" -n "$(PROVIDERNS)" \
360             -pl Name,scalBool >>$(RESULTFILE)
361            
362         @$(ECHO) +++++ Test getInstance Passed.
363
364 ### Test the testInstance Operation
365 ### Tests for positive (No error responses).
366 testTestInstanceOperation:
367         @$(ECHO) 13. +++++ test TestInstance Operations
368         @$(ECHO) 13. +++++ test TestInstance Operations >> $(RESULTFILE)
369
370         @cimcli ti -n "$(PROVIDERNS)" Test_CLITestProviderClass Id=Mike \
371             Name=Bob  >>$(RESULTFILE)
372         @cimcli ti -n "$(PROVIDERNS)" Test_CLITestProviderClass.Id=\"Mike\" \
373             Name=Bob  >>$(RESULTFILE)
374         @cimcli ti -n "$(PROVIDERNS)" Test_CLITestProviderClass Id=Mike \
375             scalSint32=100  >>$(RESULTFILE)
376         @cimcli ti -n "$(PROVIDERNS)" Test_CLITestProviderClass Id=Mike \
377             scalBool=true \
378             scalSint32=100  >>$(RESULTFILE)
379         @cimcli ti -n "$(PROVIDERNS)" Test_CLITestProviderClass Id=Mike \
380             arrayUint32=4,128,240  >>$(RESULTFILE)
381         @cimcli ti -n "$(PROVIDERNS)" Test_CLITestProviderClass Id=Mike \
382             arrayString="First","Second","Third"  >>$(RESULTFILE)
383         @cimcli ti -n "$(PROVIDERNS)" Test_CLITestProviderClass Id=Mike \
384             scalBool=true \
385             scalSint32=100 \
386             arrayUint32=4,128,240 \
387             arrayString="First","Second","Third"  >>$(RESULTFILE)
388
389         @$(ECHO) +++++ Test testInstance Passed.
390
391 ### Test integer input and test with decimal, hex, octal and binary integers
392 testIntegerVariations:
393 ##      Test variations on integer values
394         @$(ECHO) 14. +++++ test Integer Variations
395         @$(ECHO) 14. +++++ test Integer Variations >> $(RESULTFILE)
396
397         @cimcli ci -n "$(PROVIDERNS)" Test_CLITestProviderClass \
398             Id=integerVariationTest \
399             scalBool=true \
400             scalUint8=12 \
401             scalUint16=100 \
402             scalUint32=9999 \
403             scalUint64=99999 \
404             arrayUint32=99,0,31000,63000,4294967295 >> $(RESULTFILE)
405
406 ##      Display the created instance
407         @cimcli gi -n "$(PROVIDERNS)" Test_CLITestProviderClass \
408            Id=integerVariationTest >> $(RESULTFILE)
409
410 ##      test values input
411         @cimcli ti -n "$(PROVIDERNS)" Test_CLITestProviderClass \
412             Id=integerVariationTest \
413             scalUint8=12 \
414             scalUint16=100 \
415             scalUint32=9999 \
416             scalUint64=99999 \
417             arrayUint32=99,0,31000,63000,4294967295 >> $(RESULTFILE)
418
419 ##      test Hex
420         @cimcli ti -n "$(PROVIDERNS)" Test_CLITestProviderClass \
421             Id=integerVariationTest \
422             scalBool=true \
423             scalUint8=0xC \
424             scalUint16=0X64 \
425             scalUint32=0X270F \
426             scalUint64=0X1869F \
427             arrayUint32=0X63,0,0X7918,0XF618,0XFFFFFFFF >> $(RESULTFILE)
428
429 ##      test Octal
430         @cimcli ti -n "$(PROVIDERNS)" Test_CLITestProviderClass \
431             Id=integerVariationTest \
432             scalBool=true \
433             scalUint8=014 \
434             scalUint16=0144 \
435             scalUint32=023417 \
436             scalUint64=0303237 \
437             arrayUint32=0143,0,074430,0173030,037777777777 >> $(RESULTFILE)
438
439 ##      test Binary
440         @cimcli ti -n "$(PROVIDERNS)" Test_CLITestProviderClass \
441             Id=integerVariationTest \
442             scalBool=true \
443             scalUint8=1100b \
444             scalUint16=1100100b \
445             scalUint32=10011100001111b >> $(RESULTFILE)
446
447         @cimcli di -n "$(PROVIDERNS)" Test_CLITestProviderClass \
448             Id=integerVariationTest >> $(RESULTFILE)
449
450         @$(ECHO) +++++ Test integerVariations Passed.
451
452 ### Test reference and reference name operations
453 referencetests:
454         @$(ECHO) 15. +++++ referencetests
455         @$(ECHO) 15. +++++ referencetests >> $(RESULTFILE)
456
457         @cimcli r Test_CLITestProviderClass -n "$(PROVIDERNS)" \
458             -count 1 \
459             >> $(RESULTFILE)
460         @cimcli rn Test_CLITestProviderClass -n "$(PROVIDERNS)" -count 1 \
461             --setRtnHostNames ChangedHostName \
462             >> $(RESULTFILE)
463
464 ##      set the flag to use a fixed hostname
465         @cimcli im Test_CLITestProviderClass -n "$(PROVIDERNS)" \
466             setProviderParameters \
467             substituteHostName=localhost >> $(RESULTFILE)
468
469         @cimcli r -n "$(PROVIDERNS)" Test_CLITestProviderClass.Id=\"Mike\" \
470             >> $(RESULTFILE)
471         @cimcli r -n "$(PROVIDERNS)" Test_CLITestProviderClass.Id=\"Mike\" \
472             -r parent  >> $(RESULTFILE)
473         @cimcli rn -n "$(PROVIDERNS)" Test_CLITestProviderClass.Id=\"Mike\" \
474             >> $(RESULTFILE)
475 ###     This test confirms that specific input parameters are correctly passed
476 ###     to the provider since the test provider returns this information
477 ###     in a specific property.
478         @cimcli r -n "$(PROVIDERNS)" Test_CLITestProviderClass.Id=\"Mike\" \
479             -r child -rc Test_CLITestProviderLinkClass \
480             -pl requestInputParameters >> $(RESULTFILE)
481
482 ##      Reset the flag to return a real hostname
483         @cimcli im Test_CLITestProviderClass -n "$(PROVIDERNS)" \
484             resetProviderParameters >> $(RESULTFILE)
485         @$(ECHO) +++++ Test referencetests Passed.
486
487 ### Test operation of the association and association name operations
488 associationtests:
489         @$(ECHO) 16. +++++ associationtests
490         @$(ECHO) 16. +++++ associationtests >> $(RESULTFILE)
491
492         @cimcli a Test_CLITestProviderClass -n "$(PROVIDERNS)" \
493             -count 1 \
494             >> $(RESULTFILE)
495         @cimcli an Test_CLITestProviderClass -n "$(PROVIDERNS)" -count 1 \
496             --setRtnHostNames ChangedHostName \
497             >> $(RESULTFILE)
498
499 ##      Set the flag to use a fixed hostname
500         @cimcli im Test_CLITestProviderClass -n "$(PROVIDERNS)" \
501             setProviderParameters \
502             substituteHostName=localhost >> $(RESULTFILE)
503         @cimcli a -n "$(PROVIDERNS)" Test_CLITestProviderClass.Id=\"Mike\" \
504             -count 1 >> $(RESULTFILE)
505         @cimcli an -n "$(PROVIDERNS)" Test_CLITestProviderClass.Id=\"Mike\" \
506             >> $(RESULTFILE)
507         @cimcli a -n "$(PROVIDERNS)" Test_CLITestProviderClass.Id=\"Mike\" \
508             -pl "" >> $(RESULTFILE) 
509 ###     This test returns property with the input parameters
510         @cimcli a -n "$(PROVIDERNS)" Test_CLITestProviderClass.Id=\"Mike\" \
511             -ac Test_CLITestProviderLinkClass -rc Test_CLITestProviderClass \
512             -r child -rr parent -pl requestInputParameters -count 1 \
513             >> $(RESULTFILE)
514 ##      Reset the flag to use the real Host Name
515         @cimcli im Test_CLITestProviderClass -n "$(PROVIDERNS)" \
516                 resetProviderParameters >> $(RESULTFILE)
517
518         @$(ECHO) +++++ Test associationtests Passed.
519
520 ### Test cimcli response to help option requests
521 helpoutputtests:
522         @$(ECHO) 17. +++++ test Help Output
523         @$(ECHO) 17. +++++ test Help Output >> $(HELPRESULTFILE)
524
525         @cimcli --help >> $(HELPRESULTFILE)
526         @cimcli -hc  >> $(HELPRESULTFILE)
527         @cimcli -ho >> $(HELPRESULTFILE)
528         @cimcli -h mi  >> $(HELPRESULTFILE)
529
530         @$(ECHO) +++++ Test Help Output Passed.
531
532 ### Test the parameter options for property definitions that
533 ### produce null or default property values
534 nullvaluetests:
535         @$(ECHO) 18. +++++ nullvaluetests
536         @$(ECHO) 18. +++++ nullvaluetests >> $(RESULTFILE)
537
538         @cimcli ci -n "$(PROVIDERNS)" Test_CLITestProviderClass \
539             Id="NullValueTest" \
540             scalBool= defaultBool= \
541             scalUint32= defaultUint32= \
542             scalString= defaultString=  >> $(RESULTFILE)
543
544         @cimcli gi -n "$(PROVIDERNS)" Test_CLITestProviderClass \
545             Id="NullValueTest"  >> $(RESULTFILE)
546
547         @cimcli ti -n "$(PROVIDERNS)" Test_CLITestProviderClass \
548             Id="NullValueTest" \
549             scalBool= defaultBool= \
550             scalUint32= defaultUint32= \
551             scalString= defaultString=  >> $(RESULTFILE)
552
553         @cimcli di -n "$(PROVIDERNS)" Test_CLITestProviderClass \
554             Id="NullValueTest"  >> $(RESULTFILE)
555
556         @cimcli ci -n "$(PROVIDERNS)" Test_CLITestProviderClass \
557             Id=EmptyStringTest \
558             scalUint32= \
559             scalUint64=99999 \
560             arrayUint32=99,0,31000,63000,4294967295 \
561             scalString= \
562             defaultString!  >> $(RESULTFILE)
563
564         @cimcli gi -n "$(PROVIDERNS)" Test_CLITestProviderClass \
565             Id="EmptyStringTest"  >> $(RESULTFILE)
566
567         @cimcli ti -n "$(PROVIDERNS)" Test_CLITestProviderClass \
568             Id=EmptyStringTest \
569             scalUint32= \
570             scalUint64=99999 \
571             arrayUint32=99,0,31000,63000,4294967295 \
572             scalString= \
573             defaultString!  >> $(RESULTFILE)
574
575         @cimcli di -n "$(PROVIDERNS)" Test_CLITestProviderClass \
576             Id="EmptyStringTest"  >> $(RESULTFILE)
577
578         @$(ECHO) +++++ Test nullvaluetests Passed.
579
580 ### Test the ns operation.  Note that this test is subject to knowledge
581 ### of the number of namespaces and their names in the target system
582 ### We assume that this is generally a constant for the pegasus nightly
583 ### test environment.
584 namespacetests:
585         @$(ECHO) 19. +++++ namespacetests
586         @$(ECHO) 19. +++++ namespacetests >> $(NSRESULTFILE)
587
588         @cimcli ns >> $(NSRESULTFILE)
589         @cimcli ns --sum >> $(NSRESULTFILE)
590 ##      Output results but do not honor error return code.
591 ##      Should always return an error.
592         -@cimcli ns --sum -count 25 >> $(NSRESULTFILE) 2>&1
593         -@cimcli ns --sum -count 15 >> $(NSRESULTFILE) 2>&1
594
595         @$(ECHO) +++++ Test namespacetests Passed.
596
597 ### Test the use of the -count option which compares number of objects 
598 ### returned against command line parameter. 
599 objectcountertests:
600         @$(ECHO) 20. +++++ objectCounterTests
601         @$(ECHO) 20. +++++ objectCounterTests >> $(RESULTFILE)
602
603 ##      Set the flag to use a fixed hostname
604         @cimcli im Test_CLITestProviderClass -n "$(PROVIDERNS)" \
605             setProviderParameters \
606             substituteHostName=localhost >> $(RESULTFILE)
607         @cimcli ei -n "$(PROVIDERNS)" Test_CLITestProviderClass \
608             --sum -count 1 >>$(RESULTFILE)
609         @cimcli ni -n "$(PROVIDERNS)" Test_CLITestProviderClass \
610             --sum -count 1 >>$(RESULTFILE)
611         @cimcli ei -n "$(PROVIDERNS)" Test_CLITestProviderClass \
612             -count 1 >>$(RESULTFILE)
613         @cimcli ni -n "$(PROVIDERNS)" Test_CLITestProviderClass \
614             -count 1 >>$(RESULTFILE)
615
616 ##      The following tests all return errors (count wrong) and the 
617 ##      Failed message. Ignore the errors and only confirm the message in the
618 ##      result file.
619         -@cimcli ei -n "$(PROVIDERNS)" Test_CLITestProviderClass \
620             --sum -count 10 >>$(RESULTFILE) 2>&1
621         -@cimcli ni -n "$(PROVIDERNS)" Test_CLITestProviderClass \
622             --sum -count 10 >>$(RESULTFILE) 2>&1
623         -@cimcli a -n "$(PROVIDERNS)" Test_CLITestProviderClass.Id=\"Mike\" \
624             --sum -count 10 >>$(RESULTFILE) 2>&1
625         -@cimcli r -n "$(PROVIDERNS)" Test_CLITestProviderClass.Id=\"Mike\" \
626             --sum -count 10 >>$(RESULTFILE) 2>&1
627         -@cimcli an -n "$(PROVIDERNS)" Test_CLITestProviderClass.Id=\"Mike\" \
628             --sum -count 10 >>$(RESULTFILE) 2>&1
629         -@cimcli rn -n "$(PROVIDERNS)" Test_CLITestProviderClass.Id=\"Mike\" \
630             --sum -count 10 >>$(RESULTFILE) 2>&1
631         @cimcli im Test_CLITestProviderClass -n "$(PROVIDERNS)" \
632                 resetProviderParameters >> $(RESULTFILE)
633
634         @$(ECHO) +++++ Test objectcountertests Passed.
635
636 ##
637 ##      Confirm the sort of instances and instance Paths responses
638 ##
639 SortInstancesTest:
640         @$(ECHO) 21. +++++ SortInstancesTest
641         @$(ECHO) 21. +++++ SortInstancesTest >> $(RESULTFILE)
642         @cimcli ci -n "$(PROVIDERNS)" Test_CLITestProviderClass \
643             Id=Zed Name=Futz
644         @cimcli ci -n "$(PROVIDERNS)" Test_CLITestProviderClass \
645             Id=Norman Name=Susan
646         @cimcli ci -n "$(PROVIDERNS)" Test_CLITestProviderClass \
647             Id=Thomas Name=Peter
648         @cimcli ci -n "$(PROVIDERNS)" Test_CLITestProviderClass \
649             Id=Fred Name=Jones
650         @cimcli ci -n "$(PROVIDERNS)" Test_CLITestProviderClass \
651             Id=Judy Name=blah
652         @cimcli ci -n "$(PROVIDERNS)" Test_CLITestProviderClass \
653             Id=Andy Name=Blue
654         @cimcli ni -n "$(PROVIDERNS)" Test_CLITestProviderClass --sort \
655                 >>$(RESULTFILE)
656         @cimcli ei -n "$(PROVIDERNS)" Test_CLITestProviderClass --sort \
657                 -pl Id,Name \
658                 >>$(RESULTFILE)
659
660         @cimcli di -n "$(PROVIDERNS)" Test_CLITestProviderClass.Id=\"Zed\"
661         @cimcli di -n "$(PROVIDERNS)" Test_CLITestProviderClass.Id=\"Norman\"
662         @cimcli di -n "$(PROVIDERNS)" Test_CLITestProviderClass.Id=\"Thomas\"
663         @cimcli di -n "$(PROVIDERNS)" Test_CLITestProviderClass.Id=\"Fred\"
664         @cimcli di -n "$(PROVIDERNS)" Test_CLITestProviderClass.Id=\"Judy\"
665         @cimcli di -n "$(PROVIDERNS)" Test_CLITestProviderClass.Id=\"Andy\"
666
667         @$(ECHO) +++++ Test SortInstancesTest Passed.
668
669 ## Test Enumerate Classes and Enumerate ClassNames
670 enumerateClasses:
671         @$(ECHO) 22. +++++ Test For enumerateClasses
672         @$(ECHO) 22. +++++ Test For enumerateClasses  >> $(RESULTFILE)
673
674 ##      test enumerate classes with our known class to assure
675 ##      defined output. These calls all use --sort because client cannot depend
676 ##      on ordering of enuemerate instance returns from server
677         @cimcli ec -n "$(PROVIDERNS)"  Test_CLITestProviderClass --sort\
678             >> $(RESULTFILE)
679         @cimcli ec -n "$(PROVIDERNS)"  Test_CLITestProviderLinkClass  --sort\
680             >> $(RESULTFILE)
681         @cimcli ec -n "$(PROVIDERNS)"  Test_CLITestProviderLinkClass -niq \
682             --sort >> $(RESULTFILE)
683 ##      output as xml and repeat with the -ic option set
684         @cimcli ec -n "$(PROVIDERNS)"  Test_CLITestProviderLinkClass -o xml \
685             --sort >> $(RESULTFILE)
686         @cimcli ec -n "$(PROVIDERNS)"  Test_CLITestProviderLinkClass -o xml \
687             --sort -ic >> $(RESULTFILE)
688
689         @cimcli nc -n "$(STATICNS)"  --sort >> $(RESULTFILE)
690
691         @$(ECHO) 22. +++++ Test enumerateClasses
692
693 ## Test executeQuery Operation. This test should 
694 ## return a single instance.  We just test the response count to avoid
695 ## the issue of variable information in the result file
696 testExecQuery:
697         @$(ECHO) 23. +++++ Test For execQuery
698         @$(ECHO) 23. +++++ Test For execQuery  >> $(RESULTFILE)
699 ifdef PEGASUS_ENABLE_EXECQUERY
700         @cimcli xq "Select scaleBool from Test_CLITestProviderClass" \
701           -n "$(PROVIDERNS)" -count 1
702 endif
703
704         @$(ECHO) 23. +++++ Test enumerateClasses
705
706 ### Execute the set of test targets defined below
707 poststarttests:
708 ##      Remove existing master files
709         @$(RM) $(RESULTFILE)
710         @$(RM) $(TABLEFORMATFILE)
711         @$(RM) $(HELPRESULTFILE)
712         @$(RM) $(NSRESULTFILE)
713
714 ##      Execute the list of tests
715         $(MAKE) getclass
716         $(MAKE) testQualifierDecls
717         $(MAKE) testClassOperations
718         $(MAKE) testRefs
719         $(MAKE) testPropertyOperations
720         $(MAKE) testCreateInstanceOperation
721         $(MAKE) testModifyInstanceOperation
722         $(MAKE) testDeleteInstanceOperation
723         $(MAKE) testInvokeMethod
724         $(MAKE) testTableOutputFormat
725         $(MAKE) testPropertyListOption
726         $(MAKE) testGetInstanceOperation
727         $(MAKE) testTestInstanceOperation
728         $(MAKE) testIntegerVariations
729         $(MAKE) referencetests
730         $(MAKE) associationtests
731         $(MAKE) helpoutputtests
732         $(MAKE) nullvaluetests
733 ####    See Bug 8690
734 ####    $(MAKE) namespacetests
735         $(MAKE) objectcountertests
736         $(MAKE) SortInstancesTest
737         $(MAKE) enumerateClasses
738         $(MAKE) testExecQuery
739
740         @$(ECHO) +++++ Compare Result files
741 ##      diffsort used because there is at least one instance where
742 ##      the redirection of std and err outputs changes order.
743 ####    @$(DIFF) $(MASTERRESULTFILE) $(RESULTFILE)
744         @ $(call DIFFSORT,$(RESULTFILE),$(MASTERRESULTFILE))
745         @$(DIFF) $(MASTERTABLEFORMATFILE) $(TABLEFORMATFILE)
746         @$(DIFF) $(MASTERHELPRESULTFILE) $(HELPRESULTFILE)
747
748 ##      Following comment out because we cannot depend on the
749 ##      total number of namespaces. See bug 8690
750 ####    -@$(DIFF) $(MASTERNSRESULTFILE) $(NSRESULTFILE)
751
752         @$(ECHO) +++++ Remove Result files since test successful
753         -@$(RM) $(RESULTFILE)
754         -@$(RM) $(TABLEFORMATFILE)
755         -@$(RM) $(HELPRESULTFILE)
756         -@$(RM) $(NSRESULTFILE)
757
758         @$(ECHO) +++++ All cimcli tests Passed.
759
760 ### Clean up an created/modified/or deleted instances that may exist
761 ### in the server (i.e. the provider) and remove the result files.
762 ### Note that the normal path also removes result files so that the
763 ### only reason for this is to redo a failed test before the provider is
764 ### reinitialized (server restarted or provider reloaded)
765 clean:
766
767 ##      Remove any existing instances
768         -@cimcli di -n "$(PROVIDERNS)" Test_CLITestProviderClass.Id=\"Zed\"
769         -@cimcli di -n "$(PROVIDERNS)" Test_CLITestProviderClass.Id=\"Norman\"
770         -@cimcli di -n "$(PROVIDERNS)" Test_CLITestProviderClass.Id=\"Thomas\"
771         -@cimcli di -n "$(PROVIDERNS)" Test_CLITestProviderClass.Id=\"Fred\"
772         -@cimcli di -n "$(PROVIDERNS)" Test_CLITestProviderClass.Id=\"Judy\"
773         -@cimcli di -n "$(PROVIDERNS)" Test_CLITestProviderClass.Id=\"Andy\"
774
775         -@cimcli di -n "$(PROVIDERNS)" \
776                 Test_CLITestProviderClass.Id=\"ScalarTest\"
777         -@cimcli di -n "$(PROVIDERNS)" Test_CLITestProviderClass Id=arrayTest
778         -@cimcli di -n "$(PROVIDERNS)" Test_CLITestProviderClass Id=stringTest
779         -@cimcli di -n "$(PROVIDERNS)" Test_CLITestProviderClass \
780             Id=integerVariationTest
781         -@cimcli di -n "$(PROVIDERNS)" Test_CLITestProviderClass \
782             Id="NullValueTest"
783         -@cimcli di -n "$(PROVIDERNS)" Test_CLITestProviderClass \
784             Id="EmptyStringTest"
785         -@cimcli im Test_CLITestProviderClass -n "$(PROVIDERNS)" \
786                 resetProviderParameters
787
788 ##      Remove the result files
789         -@$(RM) $(RESULTFILE)
790         -@$(RM) $(TABLEFORMATFILE)
791         -@$(RM) $(HELPRESULTFILE)
792         -@$(RM) $(NSRESULTFILE)
793
794 ##################### Local targets useful for manual testing ############
795
796 ## enumerate instances of the test class
797 ni:
798         cimcli ni -n "$(PROVIDERNS)" Test_CLITestProviderClass
799
800 ## Interactive get of instances of the test class
801 giall:
802         cimcli gi -n "$(PROVIDERNS)" Test_CLITestProviderClass
803
804 ## Interactive delete of the test class
805 di:
806         cimcli di -n "$(PROVIDERNS)" Test_CLITestProviderClass
807
808 gi:
809         cimcli gi -n "$(PROVIDERNS)" Test_CLITestProviderClass -v
810
811 ## Displays classes used in this test
812 gc:
813         cimcli gc -n "$(PROVIDERNS)"  Test_CLITestProviderClass
814         cimcli gc -n "$(PROVIDERNS)"  Test_CLITestProviderLinkClass
815
816 im:
817         cimcli im Test_CLITestProviderClass -n "$(PROVIDERNS)" \
818                 setProviderParameters \
819                 substituteHostName=tempHostName
820
821 rm:
822         cimcli im Test_CLITestProviderClass -n "$(PROVIDERNS)" \
823                 resetProviderParameters
824
825 a:
826         cimcli r Test_CLITestProviderClass.Id=\"Mike\" -n "$(PROVIDERNS)" \
827          --setRtnHostNames "blah" -v
828
829 # END_OF_FILE
830