1 #//%LICENSE////////////////////////////////////////////////////////////////
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
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:
17 #// The above copyright notice and this permission notice shall be included
18 #// in all copies or substantial portions of the Software.
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.
28 #//////////////////////////////////////////////////////////////////////////
30 # Test cimcli using the cimcli test Provider and other information in the
34 DIR = Providers/TestProviders/CLITestProvider/tests
36 SRC_DIR = $(ROOT)/src/$(DIR)
39 TMP_DIR = $(subst \,/,$(PEGASUS_TMP))
51 include $(ROOT)/mak/config.mak
52 include $(ROOT)/mak/configschema.mak
54 RESULTFILE = $(TMP_DIR)/result
55 MASTERRESULTFILE = $(SRC_DIR)/result.master
57 TABLEFORMATFILE = $(TMP_DIR)/tableformat
58 MASTERTABLEFORMATFILE = $(SRC_DIR)/tableformat.master
60 HELPRESULTFILE = $(TMP_DIR)/helpresult
62 MASTERHELPRESULTFILE = $(SRC_DIR)/helpresult.master.ssl
64 MASTERHELPRESULTFILE = $(SRC_DIR)/helpresult.master
67 NSRESULTFILE = $(TMP_DIR)/namespacetestresult
68 MASTERNSRESULTFILE = $(SRC_DIR)/namespacetestresult.master
70 # sampleprovider\Load puts the sample MOF into a separate namespace.
71 # The following variable defines this namespace.
73 PROVIDERNS=test/TestProvider
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.
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
101 @$(ECHO) 0. +++++ Test For getClass
102 @$(ECHO) 0. +++++ Test For getClass >> $(RESULTFILE)
104 @cimcli gc -n "$(PROVIDERNS)" Test_CLITestProviderClass \
106 @cimcli gc -n "$(PROVIDERNS)" Test_CLITestProviderLinkClass \
108 @cimcli gc -n "$(PROVIDERNS)" Test_CLITestProviderLinkClass -niq \
110 ## output as xml and repeat with the -ic option set
111 @cimcli gc -n "$(PROVIDERNS)" Test_CLITestProviderLinkClass -o xml \
113 @cimcli gc -n "$(PROVIDERNS)" Test_CLITestProviderLinkClass -o xml \
115 @$(ECHO) 0. +++++ Test getClass
117 ### Test reference parameters
119 @$(ECHO) 1. +++++ Test For Reference params
120 @$(ECHO) 1. +++++ Test For Reference params >> $(RESULTFILE)
124 ### test get and set property operations
125 testPropertyOperations:
126 @$(ECHO) 2. +++++ Test Getproperty and setProperty
127 @$(ECHO) 2. +++++ Test Getproperty and setProperty >> $(RESULTFILE)
129 ##@cimcli sp -n "$(PROVIDERNS)" Test_CLITestProviderClass.Id=\"Mike\" Name John
130 @cimcli gp -n "$(PROVIDERNS)" \
131 Test_CLITestProviderClass.Id=\"Mike\" Name >> $(RESULTFILE)
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
138 ### test create instance operations
139 testCreateInstanceOperation:
140 @$(ECHO) 3. +++++ Test Instances create Instance
141 @$(ECHO) 3. +++++ Tests Instances create Instance >> $(RESULTFILE)
143 ## Test Instance Creation with scalars
144 @cimcli ci -n "$(PROVIDERNS)" Test_CLITestProviderClass \
146 scalBool=true scalUint8=12 scalSint8=12 scalUint16=500 \
147 scalSint16=500 scalUint32=9999 scalSint32=9999 \
148 scalUint64=99999 scalUint64=99999 scalString="testString" \
151 ## Test the creation. Will do error exit if this fails
152 @cimcli ti -n "$(PROVIDERNS)" Test_CLITestProviderClass \
154 scalBool=true scalUint8=12 scalSint8=12 scalUint16=500 \
155 scalSint16=500 scalUint32=9999 scalSint32=9999 \
156 scalUint64=99999 scalUint64=99999 scalString="testString" \
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)
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)
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)
185 ### Test multiple forms of modifyInstance. Requires instance created in
187 testModifyInstanceOperation:
188 @$(ECHO) 4. +++++ Test Instances modify Instance
189 @$(ECHO) 4. +++++ Test Instances modify Instance >> $(RESULTFILE)
191 @cimcli mi -n "$(PROVIDERNS)" Test_CLITestProviderClass \
193 scalBool=false scalUint8=14 scalSint8=-12 scalUint16=501 \
194 scalSint16=501 scalUint32=9998 scalSint32=9999 \
195 scalUint64=888 scalUint64=1 >> $(RESULTFILE)
197 @cimcli ti -n "$(PROVIDERNS)" Test_CLITestProviderClass \
199 scalBool=false scalUint8=14 scalSint8=-12 scalUint16=501 \
200 scalSint16=501 scalUint32=9998 scalSint32=9999 \
201 scalUint64=888 scalUint64=1 scalString=testString >> $(RESULTFILE)
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\" \
208 scalBool=true scalUint8=15 scalSint8=-13 scalUint16=502 \
209 scalSint16=502 scalUint32=9997 scalSint32=9998 \
210 scalUint64=888 scalUint64=1 >> $(RESULTFILE)
212 @cimcli ti -n "$(PROVIDERNS)" Test_CLITestProviderClass \
214 scalBool=true scalUint8=15 scalSint8=-13 scalUint16=502 \
215 scalSint16=502 scalUint32=9997 scalSint32=9998 \
216 scalUint64=888 scalUint64=1 >> $(RESULTFILE)
218 @$(ECHO) +++++ Test modify instance Passed.
221 ### Test Delete instance. Assumes instances created with testCreateInstance
222 testDeleteInstanceOperation:
223 @$(ECHO) 5. +++++ Test delete instance
224 @$(ECHO) 5. +++++ Test delete instance >> $(RESULTFILE)
226 ## test with CIMObjectPath input parameter
227 @cimcli di -n "$(PROVIDERNS)" \
228 Test_CLITestProviderClass.Id=\"ScalarTest\" >> $(RESULTFILE)
230 ## test delete with class name=value input parameter
231 @cimcli di -n "$(PROVIDERNS)" \
232 Test_CLITestProviderClass Id=arrayTest >> $(RESULTFILE)
234 @cimcli ci -n "$(PROVIDERNS)" Test_CLITestProviderClass \
237 scalUint8=12 scalSint8=12 \
238 scalUint16=500 scalSint16=500 \
239 scalUint32=9999 scalSint32=9999 \
240 scalUint64=99999 scalUint64=99999 \
241 scalString="testString" \
244 ## Test the creation. Will do error exit if this fails
245 @cimcli ti -n "$(PROVIDERNS)" Test_CLITestProviderClass \
248 scalUint8=12 scalSint8=12 \
249 scalUint16=500 scalSint16=500 \
250 scalUint32=9999 scalSint32=9999 \
251 scalUint64=99999 scalUint64=99999 \
252 scalString="testString" \
255 @cimcli di -n "$(PROVIDERNS)" \
256 Test_CLITestProviderClass Id=ScalarTest >> $(RESULTFILE)
258 @$(ECHO) +++++ Test delete instance Passed.
260 ### Test invoke method with a variety of parameter data types
262 @$(ECHO) 6. +++++ Test invokeMethod
263 @$(ECHO) 6. +++++ Test invokeMethod >> $(RESULTFILE)
265 ## Test using inOutParameter method that returns all
266 ## input parameters as corresponding output parameters
267 @cimcli im Test_CLITestProviderClass -n "$(PROVIDERNS)" \
270 arrayBool=true,false,true \
272 arrayUint32=99,0,31000,63000 \
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 \
280 @$(ECHO) +++++ Test invoke method Passed.
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)
287 @cimcli ci -n "$(PROVIDERNS)" Test_CLITestProviderClass \
289 @cimcli ci -n "$(PROVIDERNS)" Test_CLITestProviderClass \
291 @cimcli ei -n "$(PROVIDERNS)" Test_CLITestProviderClass \
293 >> $(TABLEFORMATFILE)
294 @cimcli ei -n "$(PROVIDERNS)" Test_CLITestProviderClass \
296 -pl Id,Name,scaleBool,scalUint8,arrayBool \
297 >> $(TABLEFORMATFILE)
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.
303 ### Test qualifer declaration get and enumerate.
305 @$(ECHO) 8. +++++ Test QualifierDecl Operations
306 @$(ECHO) 8. +++++ Test QualifierDecl Operations >> $(RESULTFILE)
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.
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
317 @$(ECHO) 9. +++++ getClass Operation
318 @$(ECHO) 9. +++++ getClass Operation >> $(RESULTFILE)
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.
326 ### Test different options on propertylist parameter
327 testPropertyListOption:
328 @$(ECHO) 10. +++++ testPropertyListOptions
329 @$(ECHO) 10. +++++ testPropertyListOptions >> $(RESULTFILE)
331 @cimcli gc CIM_ManagedElement -n $(STATICNS) -pl Caption \
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)
339 @cimcli ei -n "$(PROVIDERNS)" Test_CLITestProviderClass \
340 -pl scalBool,arrayUint64 >>$(RESULTFILE)
341 @cimcli ei -n "$(PROVIDERNS)" Test_CLITestProviderClass \
342 -pl "" >>$(RESULTFILE)
344 @cimcli gi -n "$(PROVIDERNS)" Test_CLITestProviderClass.Id=\"Mike\" \
345 -pl scalBool,arrayUint64,scalString >>$(RESULTFILE)
346 @$(ECHO) +++++ Test testPropertyListOption Passed.
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)
353 @cimcli gi Test_CLITestProviderClass -n "$(PROVIDERNS)" Id=Mike \
356 @cimcli gi Test_CLITestProviderClass -n "$(PROVIDERNS)" Id=Mike \
357 -pl Name,scalBool >>$(RESULTFILE)
359 @cimcli gi Test_CLITestProviderClass.Id=\"Mike\" -n "$(PROVIDERNS)" \
360 -pl Name,scalBool >>$(RESULTFILE)
362 @$(ECHO) +++++ Test getInstance Passed.
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)
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 \
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 \
386 arrayUint32=4,128,240 \
387 arrayString="First","Second","Third" >>$(RESULTFILE)
389 @$(ECHO) +++++ Test testInstance Passed.
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)
397 @cimcli ci -n "$(PROVIDERNS)" Test_CLITestProviderClass \
398 Id=integerVariationTest \
404 arrayUint32=99,0,31000,63000,4294967295 >> $(RESULTFILE)
406 ## Display the created instance
407 @cimcli gi -n "$(PROVIDERNS)" Test_CLITestProviderClass \
408 Id=integerVariationTest >> $(RESULTFILE)
411 @cimcli ti -n "$(PROVIDERNS)" Test_CLITestProviderClass \
412 Id=integerVariationTest \
417 arrayUint32=99,0,31000,63000,4294967295 >> $(RESULTFILE)
420 @cimcli ti -n "$(PROVIDERNS)" Test_CLITestProviderClass \
421 Id=integerVariationTest \
427 arrayUint32=0X63,0,0X7918,0XF618,0XFFFFFFFF >> $(RESULTFILE)
430 @cimcli ti -n "$(PROVIDERNS)" Test_CLITestProviderClass \
431 Id=integerVariationTest \
437 arrayUint32=0143,0,074430,0173030,037777777777 >> $(RESULTFILE)
440 @cimcli ti -n "$(PROVIDERNS)" Test_CLITestProviderClass \
441 Id=integerVariationTest \
444 scalUint16=1100100b \
445 scalUint32=10011100001111b >> $(RESULTFILE)
447 @cimcli di -n "$(PROVIDERNS)" Test_CLITestProviderClass \
448 Id=integerVariationTest >> $(RESULTFILE)
450 @$(ECHO) +++++ Test integerVariations Passed.
452 ### Test reference and reference name operations
454 @$(ECHO) 15. +++++ referencetests
455 @$(ECHO) 15. +++++ referencetests >> $(RESULTFILE)
457 @cimcli r Test_CLITestProviderClass -n "$(PROVIDERNS)" \
460 @cimcli rn Test_CLITestProviderClass -n "$(PROVIDERNS)" -count 1 \
461 --setRtnHostNames ChangedHostName \
464 ## set the flag to use a fixed hostname
465 @cimcli im Test_CLITestProviderClass -n "$(PROVIDERNS)" \
466 setProviderParameters \
467 substituteHostName=localhost >> $(RESULTFILE)
469 @cimcli r -n "$(PROVIDERNS)" Test_CLITestProviderClass.Id=\"Mike\" \
471 @cimcli r -n "$(PROVIDERNS)" Test_CLITestProviderClass.Id=\"Mike\" \
472 -r parent >> $(RESULTFILE)
473 @cimcli rn -n "$(PROVIDERNS)" Test_CLITestProviderClass.Id=\"Mike\" \
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)
482 ## Reset the flag to return a real hostname
483 @cimcli im Test_CLITestProviderClass -n "$(PROVIDERNS)" \
484 resetProviderParameters >> $(RESULTFILE)
485 @$(ECHO) +++++ Test referencetests Passed.
487 ### Test operation of the association and association name operations
489 @$(ECHO) 16. +++++ associationtests
490 @$(ECHO) 16. +++++ associationtests >> $(RESULTFILE)
492 @cimcli a Test_CLITestProviderClass -n "$(PROVIDERNS)" \
495 @cimcli an Test_CLITestProviderClass -n "$(PROVIDERNS)" -count 1 \
496 --setRtnHostNames ChangedHostName \
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\" \
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 \
514 ## Reset the flag to use the real Host Name
515 @cimcli im Test_CLITestProviderClass -n "$(PROVIDERNS)" \
516 resetProviderParameters >> $(RESULTFILE)
518 @$(ECHO) +++++ Test associationtests Passed.
520 ### Test cimcli response to help option requests
522 @$(ECHO) 17. +++++ test Help Output
523 @$(ECHO) 17. +++++ test Help Output >> $(HELPRESULTFILE)
525 @cimcli --help >> $(HELPRESULTFILE)
526 @cimcli -hc >> $(HELPRESULTFILE)
527 @cimcli -ho >> $(HELPRESULTFILE)
528 @cimcli -h mi >> $(HELPRESULTFILE)
530 @$(ECHO) +++++ Test Help Output Passed.
532 ### Test the parameter options for property definitions that
533 ### produce null or default property values
535 @$(ECHO) 18. +++++ nullvaluetests
536 @$(ECHO) 18. +++++ nullvaluetests >> $(RESULTFILE)
538 @cimcli ci -n "$(PROVIDERNS)" Test_CLITestProviderClass \
540 scalBool= defaultBool= \
541 scalUint32= defaultUint32= \
542 scalString= defaultString= >> $(RESULTFILE)
544 @cimcli gi -n "$(PROVIDERNS)" Test_CLITestProviderClass \
545 Id="NullValueTest" >> $(RESULTFILE)
547 @cimcli ti -n "$(PROVIDERNS)" Test_CLITestProviderClass \
549 scalBool= defaultBool= \
550 scalUint32= defaultUint32= \
551 scalString= defaultString= >> $(RESULTFILE)
553 @cimcli di -n "$(PROVIDERNS)" Test_CLITestProviderClass \
554 Id="NullValueTest" >> $(RESULTFILE)
556 @cimcli ci -n "$(PROVIDERNS)" Test_CLITestProviderClass \
560 arrayUint32=99,0,31000,63000,4294967295 \
562 defaultString! >> $(RESULTFILE)
564 @cimcli gi -n "$(PROVIDERNS)" Test_CLITestProviderClass \
565 Id="EmptyStringTest" >> $(RESULTFILE)
567 @cimcli ti -n "$(PROVIDERNS)" Test_CLITestProviderClass \
571 arrayUint32=99,0,31000,63000,4294967295 \
573 defaultString! >> $(RESULTFILE)
575 @cimcli di -n "$(PROVIDERNS)" Test_CLITestProviderClass \
576 Id="EmptyStringTest" >> $(RESULTFILE)
578 @$(ECHO) +++++ Test nullvaluetests Passed.
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.
585 @$(ECHO) 19. +++++ namespacetests
586 @$(ECHO) 19. +++++ namespacetests >> $(NSRESULTFILE)
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
595 @$(ECHO) +++++ Test namespacetests Passed.
597 ### Test the use of the -count option which compares number of objects
598 ### returned against command line parameter.
600 @$(ECHO) 20. +++++ objectCounterTests
601 @$(ECHO) 20. +++++ objectCounterTests >> $(RESULTFILE)
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)
616 ## The following tests all return errors (count wrong) and the
617 ## Failed message. Ignore the errors and only confirm the message in the
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)
634 @$(ECHO) +++++ Test objectcountertests Passed.
637 ## Confirm the sort of instances and instance Paths responses
640 @$(ECHO) 21. +++++ SortInstancesTest
641 @$(ECHO) 21. +++++ SortInstancesTest >> $(RESULTFILE)
642 @cimcli ci -n "$(PROVIDERNS)" Test_CLITestProviderClass \
644 @cimcli ci -n "$(PROVIDERNS)" Test_CLITestProviderClass \
646 @cimcli ci -n "$(PROVIDERNS)" Test_CLITestProviderClass \
648 @cimcli ci -n "$(PROVIDERNS)" Test_CLITestProviderClass \
650 @cimcli ci -n "$(PROVIDERNS)" Test_CLITestProviderClass \
652 @cimcli ci -n "$(PROVIDERNS)" Test_CLITestProviderClass \
654 @cimcli ni -n "$(PROVIDERNS)" Test_CLITestProviderClass --sort \
656 @cimcli ei -n "$(PROVIDERNS)" Test_CLITestProviderClass --sort \
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\"
667 @$(ECHO) +++++ Test SortInstancesTest Passed.
669 ## Test Enumerate Classes and Enumerate ClassNames
671 @$(ECHO) 22. +++++ Test For enumerateClasses
672 @$(ECHO) 22. +++++ Test For enumerateClasses >> $(RESULTFILE)
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\
679 @cimcli ec -n "$(PROVIDERNS)" Test_CLITestProviderLinkClass --sort\
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)
689 @cimcli nc -n "$(STATICNS)" --sort >> $(RESULTFILE)
691 @$(ECHO) 22. +++++ Test enumerateClasses
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
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
704 @$(ECHO) 23. +++++ Test enumerateClasses
706 ### Execute the set of test targets defined below
708 ## Remove existing master files
710 @$(RM) $(TABLEFORMATFILE)
711 @$(RM) $(HELPRESULTFILE)
712 @$(RM) $(NSRESULTFILE)
714 ## Execute the list of tests
716 $(MAKE) testQualifierDecls
717 $(MAKE) testClassOperations
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
734 #### $(MAKE) namespacetests
735 $(MAKE) objectcountertests
736 $(MAKE) SortInstancesTest
737 $(MAKE) enumerateClasses
738 $(MAKE) testExecQuery
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)
748 ## Following comment out because we cannot depend on the
749 ## total number of namespaces. See bug 8690
750 #### -@$(DIFF) $(MASTERNSRESULTFILE) $(NSRESULTFILE)
752 @$(ECHO) +++++ Remove Result files since test successful
753 -@$(RM) $(RESULTFILE)
754 -@$(RM) $(TABLEFORMATFILE)
755 -@$(RM) $(HELPRESULTFILE)
756 -@$(RM) $(NSRESULTFILE)
758 @$(ECHO) +++++ All cimcli tests Passed.
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)
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\"
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 \
783 -@cimcli di -n "$(PROVIDERNS)" Test_CLITestProviderClass \
785 -@cimcli im Test_CLITestProviderClass -n "$(PROVIDERNS)" \
786 resetProviderParameters
788 ## Remove the result files
789 -@$(RM) $(RESULTFILE)
790 -@$(RM) $(TABLEFORMATFILE)
791 -@$(RM) $(HELPRESULTFILE)
792 -@$(RM) $(NSRESULTFILE)
794 ##################### Local targets useful for manual testing ############
796 ## enumerate instances of the test class
798 cimcli ni -n "$(PROVIDERNS)" Test_CLITestProviderClass
800 ## Interactive get of instances of the test class
802 cimcli gi -n "$(PROVIDERNS)" Test_CLITestProviderClass
804 ## Interactive delete of the test class
806 cimcli di -n "$(PROVIDERNS)" Test_CLITestProviderClass
809 cimcli gi -n "$(PROVIDERNS)" Test_CLITestProviderClass -v
811 ## Displays classes used in this test
813 cimcli gc -n "$(PROVIDERNS)" Test_CLITestProviderClass
814 cimcli gc -n "$(PROVIDERNS)" Test_CLITestProviderLinkClass
817 cimcli im Test_CLITestProviderClass -n "$(PROVIDERNS)" \
818 setProviderParameters \
819 substituteHostName=tempHostName
822 cimcli im Test_CLITestProviderClass -n "$(PROVIDERNS)" \
823 resetProviderParameters
826 cimcli r Test_CLITestProviderClass.Id=\"Mike\" -n "$(PROVIDERNS)" \
827 --setRtnHostNames "blah" -v