(file) Return to Makefile CVS log (file) (dir) Up to [Pegasus] / pegasus_unsupported / wsm

File: [Pegasus] / pegasus_unsupported / wsm / Makefile (download)
Revision: 1.3, Fri Jul 13 20:06:20 2007 UTC (16 years, 11 months ago) by karl
Branch: MAIN
Changes since 1.2: +42 -15 lines
PEP#: 298
TITLE: Wsman basic security with tests

DESCRIPTION: Add tests and clean up the basic scurity code in the
client.

##%{############################################################################
##
## 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)

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


include $(PEGASUS_ROOT)/mak/recurse.mak

##==============================================================================
##
## rebuild:
##
##==============================================================================

rebuild:
	$(MAKE) clean
	$(MAKE)

##==============================================================================
##
## live-tests:
##
##==============================================================================

NAMESPACE=root/cimv2
CROSSNAMESPACE=root/PG_InterOp

AUTH=

# basic authentication
#AUTH= -A basic -u fred -w none

live-tests: register wsm cli
	@ echo ""
	@ echo "+++++ PASSED ALL TESTS"
	@ echo ""

wsm: create create2 get2 delete2 get enum put delete assoc
create:
	wsmcreate -n $(NAMESPACE) $(WSMADDR) \
            President num=100 first=Betty last=Boop $(AUTH)

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)

enum:
	wsmenum -n $(NAMESPACE) $(WSMADDR) President $(AUTH)

assoc:
	wsmassoc -n $(NAMESPACE) $(WSMADDR) President num=1 $(AUTH)
	wsmassoc -n $(NAMESPACE) $(WSMADDR) -R President num=1 $(AUTH)

register:
	$(MAKE) -C mof install NAMESPACE=$(NAMESPACE)

create2:
	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)

get2:
	wsmget -n $(NAMESPACE) $(WSMADDR) WSMClass key1=1 key2=Hello $(AUTH)

delete2:
	wsmdelete -n $(NAMESPACE) $(WSMADDR) WSMClass key1=1 key2=Hello $(AUTH)

# if using Pegasus 2.5 it was CLI.  Pegasus 2.6 release and 2.7 dev changed this to
# cimcli
CLICMD=cimcli

cli: cli1 cli2 cli3

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
	$(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) ei CIM_ManagedElement
	$(CLICMD) -n $(NAMESPACE) $(PEGWSMADDR) ni CIM_ManagedElement

cli2:
	$(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

cli3:
	$(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

## 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 killwsmserver

testdigestauthwsm:
	wsmserver -A digest &
	make -f Makefile wsm AUTH="-A digest -u fred -w none"
	make -f Makefile killwsmserver
##
## kill the wsmserver - This is a unix only thing right now
## because it uses the unix kill command
##
killwsmserver:
	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)


No CVS admin address has been configured
Powered by
ViewCVS 0.9.2