##%{############################################################################ ## ## Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development ## Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems. ## Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.; ## IBM Corp.; EMC Corporation, The Open Group. ## Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.; ## IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group. ## Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.; ## EMC Corporation; VERITAS Software Corporation; The Open Group. ## Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.; ## EMC Corporation; Symantec Corporation; The Open Group. ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "Software"), to ## deal in the Software without restriction, including without limitation the ## rights to use, copy, modify, merge, publish, distribute, sublicense, and/or ## sell copies of the Software, and to permit persons to whom the Software is ## furnished to do so, subject to the following conditions: ## ## THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN ## ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED ## "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT ## LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR ## PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ## HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ## ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION ## WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ## ##%}############################################################################ # Force use of WSMAN for live tests export WSM_USE_WSMAN=1 # Option to use local directory in place of a CIMServer. # If PEGASUS_CLIENT_HOME set to a directory we attempt to use that directory # plus /repository as the local directory for Class operation. # To use the server instead, comment out the following line. export PEGASUS_CLIENT_HOME=$(PEGASUS_HOME) # Note that wsm uses the Pegasus core mak facilities driven from the following # include. include $(PEGASUS_ROOT)/mak/config.mak ifndef PEGASUS_ROOT $(error Please define PEGASUS_ROOT) endif ifndef PEGASUS_HOME $(error Please define PEGASUS_HOME) endif ifndef PEGASUS_PLATFORM $(error Please define PEGASUS_PLATFORM) endif DIRS = src # set up the port for wsm. Note that we # set it here because there are multiple "default" ports for wsman. # Within Inova testing we use 22222 and set that in the common/defines.h # However, the tests with Microsoft use 80 and that is set in the defines.h # when we export or compile in the test center to make life easier. # This also should be set to whatever the local "default" WSMPORT = 22222 # The default WSMADDR simply sets the port. A user can set both the port # and host address with the comand options WSMADDR="-s host -p port" WSMADDR = -p $(WSMPORT) # This controls port and host for the wsm address for the Pegasus $(CLI) commands # in this test. It is NOT set for local tests. If a remote test is # desired set it to PEGWSMADDR="-l host:port" on the make command line. #PEGWSMADDR #WSM_USE_SSL include $(PEGASUS_ROOT)/mak/recurse.mak ##============================================================================== ## ## rebuild: ## ##============================================================================== rebuild: $(MAKE) clean $(MAKE) ##============================================================================== ## ## live-tests: ## ##============================================================================== NAMESPACE=root/cimv2 CROSSNAMESPACE=root/PG_InterOp AUTH= live-tests: register wsm cli @ echo "" @ echo "+++++ PASSED ALL TESTS" @ echo "" wsm: wsm1 wsm2 wsm3 get put delete ## the following set of tests do passive tests against instances ## defined through the register function wsm1: identify get1 enum1 assoc1 # Note that this is a temporary test. identify: wsmidentify # tests against static entities in the environment (created by register) get1: wsmget -n $(NAMESPACE) $(WSMADDR) President num=1 $(AUTH) ## Test to be sure we are getting from non-default namespace. wsmget -n $(CROSSNAMESPACE) $(WSMADDR) President num=1000 $(AUTH) enum1: wsmenum -n $(NAMESPACE) $(WSMADDR) President $(AUTH) assoc1: wsmassoc -n $(NAMESPACE) $(WSMADDR) President num=1 $(AUTH) wsmassoc -n $(NAMESPACE) $(WSMADDR) -R President num=1 $(AUTH) ## The following commands test the ability to create and delete objects wsm2: create get put delete create: wsmcreate -n $(NAMESPACE) $(WSMADDR) \ President num=100 first=Betty last=Boop $(AUTH) # note that this test depends on successful create target above get: wsmget -n $(NAMESPACE) $(WSMADDR) President num=100 $(AUTH) wsmget -n $(NAMESPACE) $(WSMADDR) \ PresidentLink \ pred:President pred.num=1 \ succ:President succ.num=2 \ $(AUTH) put: wsmput -n $(NAMESPACE) $(WSMADDR) President num=100 \ _ num=100 first=Jane last=Doe $(AUTH) wsmput -n $(NAMESPACE) $(WSMADDR) President num=100 _ last=Doe $(AUTH) wsmput -n $(NAMESPACE) $(WSMADDR) President num=100 _ first=Jane $(AUTH) wsmput -n $(NAMESPACE) $(WSMADDR) President num=100 _ num=100 $(AUTH) delete: wsmdelete -n $(NAMESPACE) $(WSMADDR) President num=100 $(AUTH) ## register our special classes with the cimserver register: $(MAKE) -C mof install NAMESPACE=$(NAMESPACE) wsm3: create3 get3 delete3 ## Test against a second class with multiple keys. create3: wsmcreate -n $(NAMESPACE) $(WSMADDR) WSMClass \ key1=1 \ key2=Hello \ a1=one a1=two a1=two \ a2=1 a2=2 a2=3 a2=4 \ a3=true a3=false $(AUTH) get3: wsmget -n $(NAMESPACE) $(WSMADDR) WSMClass key1=1 key2=Hello $(AUTH) delete3: wsmdelete -n $(NAMESPACE) $(WSMADDR) WSMClass key1=1 key2=Hello $(AUTH) # These tests should generate error exit since they are gets against instances that # should not exist in the defined namespaces. wsmgeterr: -wsmget -n -n $(NAMESPACE) $(WSMADDR) President num = 1000 $(AUTH) -wsmget -n -n $(CROSSNAMESPACE) $(WSMADDR) President num = 1 $(AUTH) ################################################################################ ## ## Tests using cimcli ## ################################################################################ # if using Pegasus 2.5 it was CLI. Pegasus 2.6 release and 2.7 dev changed this to # cimcli. If you use Pegasus 2.5, change back to CLI. CLICMD=cimcli cli: cli1 cli2 cli3 cli4 cli5 cli6 cli7 # enumerate and enumeratename tests cli1: $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) ei President -count 6 $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) ni President -count 6 $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) ei PresidentLink -count 6 $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) ni PresidentLink -count 6 # the following tests do not know how many objects they return $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) ei CIM_ManagedElement $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) ni CIM_ManagedElement # get instance tests. These tests will error if the object is not found cli2: $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) gi President.num=1 ## test that we pass specific namespace since this object is only in crossnamespace $(CLICMD) -n $(CROSSNAMESPACE) $(PEGWSMADDR) gi President.num=1000 # Test reference name requests cli3: $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) rn President.num=1 -count 3 $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) rn President.num=1 -rc Presidentlink -count 2 $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) rn President.num=1 -rc Presidentlink -r pred -count 2 $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) rn President.num=1 -rc Presidentlink -r succ -count 2 $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) rn President.num=1 -rc successionlink -count 1 $(CLICMD) -n $(CROSSNAMESPACE) $(PEGWSMADDR) rn VicePresident.num=1 -count 1 # reference requests cli4: $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) r President.num=1 -count 3 $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) r President.num=1 -rc Presidentlink -count 2 $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) r President.num=1 -rc Presidentlink -r pred -count 2 $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) r President.num=1 -rc Presidentlink -r succ -count 2 $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) r President.num=1 -rc successionlink -count 1 # association name requests cli5: $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) an President.num=1 -count 3 $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) an President.num=1 -rc President -count 2 $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) an President.num=1 -ac successionlink -count 1 $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) an President.num=1 -ac Presidentlink -count 2 $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) an President.num=1 -ac Presidentlink -rc President -count 2 $(CLICMD) -n $(CROSSNAMESPACE) $(PEGWSMADDR) an VicePresident.num=2000 -count 1 $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) an President.num=1 -ac successionlink -count 1 $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) an President.num=1 -ac successionlink -count 0 -r succ # association requests cli6: $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) a President.num=1 -count 3 $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) a President.num=1 -rc President -count 2 $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) a President.num=1 -ac successionlink -count 1 $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) a President.num=1 -ac Presidentlink -count 2 $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) a President.num=1 -ac Presidentlink -rc President -count 2 $(CLICMD) -n $(CROSSNAMESPACE) $(PEGWSMADDR) a VicePresident.num=2000 -count 1 $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) a President.num=1 -ac successionlink -count 1 # test to be sure the cli reference and association class operations are processed by the # cimserver, not by wsm. cli7: $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) r President.num=1 -count 3 $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) rn President.num=1 -count 3 $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) a President.num=1 -count 3 $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) an President.num=1 -count 3 ## The following tests represent errors in Pegasus clierrorPegasus: # These are caused becasue VicePresident is NOT in the $(NAMESPACE) namespace $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) an President.num=1 -ac Presidentlink -rc VicePresident -count 2 $(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) an President.num=1 -rc VicePresident -count 1 ## ## Before running this, build and register the WSMMethodProvider under ## src/providers/WSMMethodProvider. ## invoke: wsminvoke WSMMethod meth p1=99 p2=true p3=Hello ## ## Repeat the test suite with the namespace name in upper case ## namespaceCase: make -f Makefile live-tests NAMESPACE=ROOT/CIMV2 ## ## Run the wsm tests with basic authentication. ## ## Note that this is a unix only thing now because we start the wsmserver ## There is an issue now with the initial server startup hanging sometimes. ## testbasicauthwsm: wsmserver -A basic & make -f Makefile wsm AUTH="-A basic -u fred -w none" make -f Makefile killwsm ## ## Run the wsm tests with digest authentication. ## testdigestauthwsm: wsmserver -A digest & make -f Makefile wsm AUTH="-A digest -u fred -w none" make -f Makefile killwsm ## ## kill the wsmserver - This is a unix only thing right now ## because it uses the unix kill command ## killwsm: kill -9 wsmserver ## ## Stop server, regenerate repository, restart the server: ## regen: -cimserver -s make -C $(PEGASUS_ROOT) repository -cimserver ##============================================================================== ## ## CVS tag and definition of current version: ## ##============================================================================== MAJOR=0 MINOR=4 REVSION=02 VERSION=$(MAJOR).$(MINOR).$(REVSION) TAG=wsm_$(MAJOR)_$(MINOR)_$(REVSION) tag: @ cvs tag -F $(TAG) > /dev/null @ echo "Added $(TAG) tag" ##============================================================================== ## ## dist: Create a distributable set of source files compacted. ## ##============================================================================== DISTROOT=wsm-$(VERSION) TARDIST=$(DISTROOT).tar.gz ZIPDIST=$(DISTROOT).zip dist: rm -f /tmp/$(TARDIST) rm -f /tmp/$(ZIPDIST) rm -rf /tmp/$(DISTROOT) cp -r . /tmp/$(DISTROOT) rm -rf `find /tmp/$(DISTROOT) -name CVS` echo "Creating /tmp/$(TARDIST)..." ( cd /tmp ; tar zcf $(TARDIST) $(DISTROOT) ) echo "Creating /tmp/$(ZIPDIST)..." ( cd /tmp/$(DISTROOT) ; zip -q -R ../$(ZIPDIST) '*' ) rm -rf /tmp/$(DISTROOT)