(file) Return to TestMakefile CVS log (file) (dir) Up to [Pegasus] / pegasus

File: [Pegasus] / pegasus / TestMakefile (download)
Revision: 1.61, Fri Feb 17 22:28:09 2006 UTC (18 years, 2 months ago) by jim.wunderlich
Branch: MAIN
Changes since 1.60: +48 -11 lines
BUG#: 4788
TITLE: pegtest user should be converted to use PEGASUS_TEST_USER_ID

DESCRIPTION:
This changes the hardcoded refereence to the user pegtest to use the new
env var PEGASUS_TEST_USER_ID which defaults to guest. It also adds the
logic to configure the users, if not doing PAM authentication, prior to
running the tests. It also includes the logic to make it a standalone tests.
IE it can be run directly outside of the testsuite and it will set up its
dependencies. It, as all other single tests do, presumes that the
repositories are pre-built.

#//%2006////////////////////////////////////////////////////////////////////////
#//
#// 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.
#//
#//==============================================================================
###############################################################################
##
## Test Makefile for Pegasus CIMOM
##
## see the usage rule for documentation of rules etc.
##
##
###############################################################################

error:
	@ $(ECHO) "Specify desired makefile option (i.e., unittests, usage )"

include $(PEGASUS_ROOT)/mak/config.mak
include $(PEGASUS_ROOT)/mak/test.mak
include $(PEGASUS_ROOT)/mak/commands.mak

system = localhost

.PHONY: FORCE

FORCE:

usage: FORCE
	$(USAGE)
	$(USAGE)"TestMakefile Primary Targets:"
	$(USAGE)
	$(USAGE)"The following are all standalone tests. They stop and start the server,"
	$(USAGE)"and build repositories as needed."
	$(USAGE)
	$(USAGE)"alltests           - Execute unittests and servertests"
	$(USAGE)"unittests          - Execute the unit functional tests - no repository"
	$(USAGE)"                     or active server is required"
	$(USAGE)"servertests        - Execute a basic server test suites (No security, No SSL)"
	$(USAGE)"standardtests      - Execute an extended server test suites "
	$(USAGE)"                     using multiple options."
	$(USAGE)"serverquicktests   - Executes a brief server test"
	$(USAGE)"perftests          - Executes a brief server performance test"
	$(USAGE)
	$(USAGE)"usage2             - usage on secondary test targets"
	$(USAGE)"usagetrace         - usage on trace targets"
	$(USAGE)

usage2: FORCE
	$(USAGE)
	$(USAGE)"TestMakefile Secondary Targets:"
	$(USAGE)
	$(USAGE)"The following are run as part of the Primary target test suites and may"
	$(USAGE)"also be invoked as standalone tests."
	$(USAGE)
	$(USAGE)"TestXMLRepository       - Executes poststarttests on XML repository"
	$(USAGE)"                          built with cimmofl."
	$(USAGE)"TestXMLRepositoryServer - Executes poststarttests on XML repository" 
	$(USAGE)"                          built with cimmof."
	$(USAGE)"TestXMLCmpRepository    - Executes poststarttests on XML compressed"
	$(USAGE)"                          repository built with cimmofl."
	$(USAGE)"TestBinRepository       - Executes poststarttests on binary repository "
	$(USAGE)"                          built with cimmofl."
	$(USAGE)"TestBinRepositoryServer - Executes poststarttests on binary repository"
	$(USAGE)"                          built with cimmof."
	$(USAGE)"TestBinCmpRepository    - Executes poststarttests on binary compressed"
	$(USAGE)"                          repository built with cimmofl."
	$(USAGE)
	$(USAGE)"The following require the repository to be pre-built."
	$(USAGE)
	$(USAGE)"run_SSL_TS1             - Executes the SSL tests"
	$(USAGE)"run_OOP_TS1             - Executes the Out Of Process Provider tests"
	$(USAGE)"run_G11N_TS1            - Executes the Globalization tests"
	$(USAGE)
	$(USAGE)"The following require the repository to be pre-built and the server to be started."
	$(USAGE)
	$(USAGE)"serversuite             - the collection of test run by the servertests rule"
	$(USAGE)"serverquicksuite        - The collection of test run by the serverquicktests rule"
	$(USAGE)


##########################################################
#
# rules that are defined in Makefile
#
##########################################################

build: FORCE
	$(MAKE) --directory=$(PEGASUS_ROOT) -f Makefile build

world: FORCE
	$(MAKE) --directory=$(PEGASUS_ROOT) -f Makefile world

new: FORCE
	$(MAKE) --directory=$(PEGASUS_ROOT) -f Makefile new

clean: FORCE
	$(MAKE) --directory=$(PEGASUS_ROOT) -f Makefile clean

depend: FORCE
	$(MAKE) --directory=$(PEGASUS_ROOT) -f Makefile depend


############################################################
#
# rules defined here
#
############################################################

##
## Although the macros CIMSERVER_STOP_SERVICE and CIMSERVER_START_SERVICE
## are available and could be invoked directly, their direct usage is
## discouraged in favor of invoking the cimstop and the cimstart rules
## as this allows one place where additional checks, delays etc may be 
## added in the future to control or further test the servers performance
## in executing these commands.
##

#######################
#
# doc
#
doc:
	$(MAKE) --directory=$(PEGASUS_ROOT)/doc/ProviderSpec -f Makefile
	$(MAKE) --directory=$(PEGASUS_ROOT)/doc/DevManual -f Makefile


#######################
#
# repositoryServer
#
repositoryServer: FORCE
	$(MAKE) --directory=$(PEGASUS_ROOT) -f TestMakefile -i cimstop
	$(SLEEP) 5
	$(RMDIRHIER) $(REPOSITORY_ROOT)
	$(MAKE) --directory=$(PEGASUS_ROOT) -f TestMakefile -i cimstart
	$(SLEEP) 5
	$(MAKE) --directory=$(PEGASUS_ROOT) -f Makefile repositoryServer
	$(MAKE) --directory=$(PEGASUS_ROOT) -f Makefile testrepositoryServer

######################
#
# prestarttests is being deprecated since poststarttest is being deprecated
# in favor of name more related to its intended functionality. 
#
prestarttests: prestarttests_msg shortsleep unittests

prestarttests_msg: FORCE
	@$(ECHO) "=============================================================================="
	@$(ECHO) "TestMakefile: The \"prestarttests\" rule is being deprecated."
	@$(ECHO) "              Use \"make testusage\" for a description of the usage model."	
	@$(ECHO) "              The equivalent new rule is \"unittests\"."  
	@$(ECHO) "              Invoking the \"unittests\" rule now."
	@$(ECHO) "=============================================================================="

####################
#
# poststarttests is being deprecated since it multiply defines a 
# recursive make rule leading to ambuguity and confusion.
#
poststarttests: poststarttests_msg shortsleep servertests 

poststarttests_msg: FORCE
	@$(ECHO) "==============================================================================="
	@$(ECHO) "TestMakefile: The \"posstarttests\" rule is being deprecated.."  
	@$(ECHO) "              Use \"make testusage\" for a description of the usage model."	
	@$(ECHO) "              The equivalent new rule is \"servertests\"."  
	@$(ECHO) "              Invoking the \"servertests\" rule now."
	@$(ECHO) "==============================================================================="

#####################
#
# tests is being deprecated since it multiply defines a 
# recursive make rule leading to ambuguity and confusion.
#
tests: tests_msg shortsleep alltests

tests_msg: FORCE
	@$(ECHO) "==================================================================="
	@$(ECHO) "TestMakefile: The \"tests\" rule is being deprecated."
	@$(ECHO) "              Use \"make testusage\" for a description of the usage model."	
	@$(ECHO) "              The equivalent new rule is \"alltests\"."  
	@$(ECHO) "              Invoking the \"alltests\" rule now."
	@$(ECHO) "==================================================================="


shortsleep: FORCE
	@$(SLEEP) 5

####################
#
# unittests
#
unittests: FORCE
	$(MAKE) --directory=$(PEGASUS_ROOT) -f Makefile tests
	@ $(ECHO) "+++++ TestMakefile unittests complete"

#####################
#
# servertests
#

servertestsclean: FORCE
	$(MAKE) --directory=$(PEGASUS_ROOT) -f TestMakefile -i cimstop
	$(MAKE) --directory=$(PEGASUS_ROOT)/src/Pegasus/CQL/tests/Queries -f Makefile clean
	$(MAKE) --directory=$(PEGASUS_ROOT)/src/Pegasus/Query/QueryExpression/tests/Queries -f Makefile clean
	$(MAKE) --directory=$(PEGASUS_ROOT)/test/wetest -f Makefile clean

servertestssetup: FORCE
ifdef PEGASUS_HAS_SSL
#
# The association between user names and certificates is stored in the 
# repository.  If the repository is recreated, we also need to re-initialize
# the trust store directories. Otherwise, the truststore content will be 
# out-of-sync with the mapping stored in the repository.
#
	$(MAKE) --directory=$(PEGASUS_ROOT)/src/Server -f Makefile removeSSLTrustDirectories
	$(MAKE) --directory=$(PEGASUS_ROOT)/src/Server -f Makefile createSSLTrustDirectories
endif
	$(MAKE) --directory=$(PEGASUS_ROOT) -f Makefile repository
	$(MAKE) --directory=$(PEGASUS_ROOT) -f Makefile testrepository
	$(MAKE) --directory=$(PEGASUS_ROOT) -f TestMakefile cimstart
	$(SLEEP) 5
	$(MAKE) --directory=$(PEGASUS_ROOT) -f TestMakefile ConfigureUsers
	$(MAKE) --directory=$(PEGASUS_ROOT) -f TestMakefile Create_SSL_Certificate


servertests: servertestsclean servertestssetup serversuite
	@ $(ECHO) "+++++ TestMakefile servertests suites complete"

serversuite: FORCE
	$(MAKE) --directory=$(PEGASUS_ROOT) -f Makefile poststarttests
	$(MAKE) --directory=$(PEGASUS_ROOT) -f TestMakefile TestBinRepository
	$(MAKE) --directory=$(PEGASUS_ROOT) -f TestMakefile run_OOP_TS1
	$(MAKE) --directory=$(PEGASUS_ROOT) -f TestMakefile run_IndInit_TS1
	$(MAKE) --directory=$(PEGASUS_ROOT) -f TestMakefile run_INDSSL_TS1
	$(MAKE) --directory=$(PEGASUS_ROOT) -f TestMakefile run_SSL_TS1
	$(MAKE) --directory=$(PEGASUS_ROOT) -f TestMakefile run_G11N_TS1

####################
#
# serverquicktests
#
serverquicktests: servertestsclean servertestssetup serverquicksuite
	@ $(ECHO) "+++++ TestMakefile serverquicktests complete"

serverquicksuite: FORCE
	$(PEGASUS_HOME)/bin/Client
	$(MAKE) --directory=$(PEGASUS_ROOT)/test/wetest -f Makefile poststarttests
	$(PEGASUS_HOME)/bin/TestClient

####################
#
# perftests - simple performance test until we have better
#
# - Turns statistics on (uses TestInterop until we have better)
# - runs and times serverquicktests suite 
# - runs cimperf to displat the statistics
# - turns statistics off 
#
perftests: servertestsclean servertestssetup perfsuite

perfsuite: FORCE
	$(PEGASUS_HOME)/bin/TestInterop on
	$(TIME_CMD) $(MAKE) --directory=$(PEGASUS_ROOT)/test/wetest -f Makefile poststarttests
	@ $(ECHO) " "
	$(TIME_CMD) $(PEGASUS_HOME)/bin/TestClient
	@ $(ECHO) " "
	$(TIME_CMD) $(PEGASUS_HOME)/bin/benchmarkTest
	@ $(ECHO) " "
	@ $(ECHO) " "
	$(TIME_CMD) $(PEGASUS_HOME)/bin/cimperf
	@ $(ECHO) " "
	$(PEGASUS_HOME)/bin/TestInterop off


####################
#
# alltests
#
alltests: unittests servertests
ifeq ($(PEGASUS_PLATFORM),WIN32_IX86_MSVC)
	$(MAKE) --directory=$(PEGASUS_ROOT) -f TestMakefile -i cimstop
	$(MAKE) --directory=$(PEGASUS_ROOT)/src/Server -f Makefile uninstall
endif
	@ $(ECHO) "+++++ TestMakefile alltests Complete"

###############################################################################
##  Test Suite Definitions
###############################################################################

###############################################################################
##  OOP Test Suite 1: "Out-of-Process"(OOP) Provider Tests 
##
##  Configuration Options: forceProviderProcesses=true
##
##  If PEGASUS_DEFAULT_ENABLE_OOP is set, then tests are run with OOP disabled
##  since tests have already been run with OOP enabled.
##
##
###############################################################################
ifeq ($(PEGASUS_DEFAULT_ENABLE_OOP),true)
OOP_TS1_CONFIG_OPTIONS = forceProviderProcesses=false
else
OOP_TS1_CONFIG_OPTIONS = forceProviderProcesses=true
endif

OOP_TS1_TEST_CMDS = \
        $(MAKE)@@--directory=$(PEGASUS_ROOT)@@Makefile@@-s@@poststarttests

run_OOP_TS1:
	$(MAKE) -f $(PEGASUS_ROOT)/TestMakefile runTestSuite \
            CIMSERVER_CONFIG_OPTIONS="$(OOP_TS1_CONFIG_OPTIONS)" \
            TESTSUITE_CMDS="$(OOP_TS1_TEST_CMDS)"

###############################################################################

###############################################################################
##  IndInit Test Suite 1: IndicationService Initialization Tests 
##
##  Configuration Options: (none)
##
###############################################################################
IndInit_TS1_CONFIG_OPTIONS = 
IndInit_TS1a_TEST_CMDS = \
	$(MAKE)@@--directory=$(PEGASUS_ROOT)/src/Pegasus/IndicationService/tests/ProcessIndication@@IndInit_TS1a
IndInit_TS1b_TEST_CMDS = \
	$(MAKE)@@--directory=$(PEGASUS_ROOT)/src/Pegasus/IndicationService/tests/ProcessIndication@@IndInit_TS1b

run_IndInit_TS1:
	$(MAKE) -f $(PEGASUS_ROOT)/TestMakefile runTestSuite \
            CIMSERVER_CONFIG_OPTIONS="$(IndInit_TS1_CONFIG_OPTIONS)" \
            TESTSUITE_CMDS="$(IndInit_TS1a_TEST_CMDS)"
	$(MAKE) -f $(PEGASUS_ROOT)/TestMakefile runTestSuite \
            CIMSERVER_CONFIG_OPTIONS="$(IndInit_TS1_CONFIG_OPTIONS)" \
            TESTSUITE_CMDS="$(IndInit_TS1b_TEST_CMDS)"

###############################################################################
##  Indication SSL Test Suite 1: Indication Testing over HTTPS
##
##  Configuration Options: (none)
##
###############################################################################
INDSSL_TS1a_CONFIG_OPTIONS = enableHttpsConnection=true enableAuthentication=false
INDSSL_TS1a_TEST_CMDS = \
	$(MAKE)@@--directory=$(PEGASUS_ROOT)/src/Providers/TestProviders/IndicationStressTestProvider/testclient@@-f@@Makefile@@run_TS1_AuthenticationDisabled

INDSSL_TS1b_CONFIG_OPTIONS = enableHttpsConnection=true enableAuthentication=true sslClientVerificationMode=required
INDSSL_TS1b_TEST_CMDS = \
	$(MAKE)@@--directory=$(PEGASUS_ROOT)/src/Providers/TestProviders/IndicationStressTestProvider/testclient@@-f@@Makefile@@run_TS1_AuthenticationEnabled


ifdef PEGASUS_HAS_SSL
ifndef PEGASUS_DISABLE_PRIVILEGED_TESTS
run_INDSSL_TS1: EnableUsers Create_SSL_Certificate_ignore
	$(MAKE) -f $(PEGASUS_ROOT)/TestMakefile runTestSuite \
            CIMSERVER_CONFIG_OPTIONS="$(INDSSL_TS1a_CONFIG_OPTIONS)" \
            TESTSUITE_CMDS="$(INDSSL_TS1a_TEST_CMDS)"
	$(MAKE) -f $(PEGASUS_ROOT)/TestMakefile runTestSuite \
            CIMSERVER_CONFIG_OPTIONS="$(INDSSL_TS1b_CONFIG_OPTIONS)" \
            TESTSUITE_CMDS="$(INDSSL_TS1b_TEST_CMDS)"
else
run_INDSSL_TS1: FORCE
	@ $(ECHO) "+++++ PEGASUS_DISABLE_PRIVILEGED_TESTS defined: Skipping run_INDSSL_TS1"	
endif
else
run_INDSSL_TS1: FORCE
	@ $(ECHO) "+++++ PEGASUS_HAS_SSL not defined: Skipping run_INDSSL_TS1"
endif


###############################################################################
 
###############################################################################
##  SSL Test Suite 1: SSL Tests
##
##  Configuration Options: enableAuthentication=true
##                         enableHttpsConnection=true
##                         sslClientVerificationMode=optional
##                         sslTrustStoreUserName=$(CURRENT_USER)
##
###############################################################################
SSL_TS1_CONFIG_OPTIONS = enableHttpsConnection=true enableAuthentication=true \
       sslClientVerificationMode=optional sslTrustStoreUserName=$(CURRENT_USER)
SSL_TS1_TEST_CMDS = \
       $(MAKE)@@--directory=$(PEGASUS_ROOT)/src/Clients/ssltrustmgr/tests@@SSLCertificateTest1

ifdef PEGASUS_HAS_SSL
ifndef PEGASUS_DISABLE_PRIVILEGED_TESTS
run_SSL_TS1: FORCE
	$(MAKE) -f $(PEGASUS_ROOT)/TestMakefile runTestSuite \
            CIMSERVER_CONFIG_OPTIONS="$(SSL_TS1_CONFIG_OPTIONS)" \
            TESTSUITE_CMDS="$(SSL_TS1_TEST_CMDS)"
else
run_SSL_TS1: FORCE
	@ $(ECHO) "+++++ PEGASUS_DISABLE_PRIVILEGED_TESTS defined: Skipping run_SSL_TS1"	
endif
else
run_SSL_TS1: FORCE
	@ $(ECHO) "+++++ PEGASUS_HAS_SSL not defined: Skipping run_SSL_TS1 poststarttest"

endif

############################################################################
# 
# Create_SSL_Certificate
#
# create a certificate that can be used for certification testing.
# It is currently used by the following tests:
#            -run_INDSSL_TS1
#
Create_SSL_Certificate_ignore: FORCE
	-$(MAKE) --directory=$(PEGASUS_ROOT) -f TestMakefile Create_SSL_Certificate

Create_SSL_Certificate: FORCE
ifdef PEGASUS_HAS_SSL
ifdef PEGASUS_TEST_USER_DEFINED
	$(ECHO) "Creating SSL certificate for test"
	ssltrustmgr -a -c $(PEGASUS_TEST_USER_ID) -f $(PEGASUS_HOME)/server.pem
endif
else
	$(ECHO) "PEGASUS_HAS_SSL not defined - Not Creating SSL certificate for test"
endif

###############################################################################
##  G11N Test Suite 1: Globalization Tests 
##
##  Configuration Options: forceProviderProcesses=false
##
###############################################################################
G11N_TS1_CONFIG_OPTIONS = forceProviderProcesses=false
G11N_TS1_TEST_CMDS = \
        $(MAKE) --directory $(PEGASUS_ROOT)/src/Clients/g11ntest \
            -f Makefile g11ntest

run_G11N_TS1:
	$(MAKE) -f $(PEGASUS_ROOT)/TestMakefile runTestSuite \
            CIMSERVER_CONFIG_OPTIONS="$(G11N_TS1_CONFIG_OPTIONS)" \
            TESTSUITE_CMDS="$(G11N_TS1_TEST_CMDS)"
###############################################################################


###############################################################################



##############################################################################
##
## TestXMLRepository rule is used to run the poststarttests suite on
## the XML Repository built using cimmofl
##
## TestXMLRepositoryServer rule is used to run the poststarttests suite on
## the XML Repository built using cimmof
##
## TestXMLCmpRepository rule is used to run the poststarttest suite on 
## the XML Compressed Repository built using cimmofl
##

############################
##
## TestXMLRepository
##

TestXMLRepository: TestXMLClean TestXMLBuildRepo  TestXMLRepo
	@ $(ECHO) TestXMLRepository +++++ passed all test

############################
##
## TestXMLRepositoryServer
##
TestXMLRepositoryServer: TestXMLClean  TestXMLBuildRepoServ TestXMLRepo
	@ $(ECHO) TestXMLRepositoryServer +++++ passed all test

############################
##
## TestXMLCmpRepository -  run poststarttest on Compressed BIN Repository
##
ifdef PEGASUS_ENABLE_COMPRESSED_REPOSITORY
TestXMLCmpRepository: FORCE
	@ $(ECHO) TestXMLCmpRepository +++++ Repository compressed by default - nothing more to test.
	@ $(ECHO) TestXMLCmpRepository +++++ passed all test
else

ifdef PEGASUS_ENABLE_COMPRESSED_REPOSITORY_TEST

TestXMLCmpRepository: TestXMLClean  TestCmpBuild TestXMLBuildRepo TestXMLRepo TestRegBuild
	@ $(ECHO) TestXMLCmpRepository +++++ passed all test
else
TestXMLCmpRepository: FORCE
	@ $(ECHO) TestXMLCmpRepository +++++ Not tested 
	@ $(ECHO) TestXMLCmpRepository +++++ refer to readme.compressed_repository
	@ $(ECHO) TestXMLCmpRepository +++++ to enable: set PEGASUS_ENABLE_COMPRESSED_REPOSITORY_TEST=true 
endif
endif

###########################
##
## TestXMLClean
##
TestXMLClean: FORCE
	$(MAKE) --directory=$(PEGASUS_ROOT) -f TestMakefile -i cimstop 
	$(MAKE) --directory=$(PEGASUS_ROOT) -f Makefile repositoryclean REPOSITORY_NAME=repository_xml


###########################
##
## TestXMLStartServer
##
TestXMLStartServer: FORCE
	$(MAKE) --directory=$(PEGASUS_ROOT)/src/Server -f Makefile install_run
	- $(MKDIRHIER) $(PEGASUS_HOME)/repository_xml
	$(MAKE) --directory=$(PEGASUS_ROOT) -f TestMakefile -i cimstart CIMSERVER_CONFIG_OPTIONS="repositoryDir=$(PEGASUS_HOME)/repository_xml"
	$(SLEEP) 5

####
#### The following caused the cimserver to fail on startup
####
####	$(MAKE) --directory=$(PEGASUS_ROOT) -f TestMakefile -i cimstart CIMSERVER_CONFIG_OPTIONS="enableBinRepository=false repositoryDir=$(PEGASUS_HOME)/repository_xml"

###########################
##
## TestXMLBuildRepo
##
TestXMLBuildRepo: FORCE
	$(MAKE) --directory=$(PEGASUS_ROOT) -f Makefile repository REPOSITORY_NAME=repository_xml REPOSITORY_MODE=XML
	$(MAKE) --directory=$(PEGASUS_ROOT) -f Makefile testrepository REPOSITORY_NAME=repository_xml REPOSITORY_MODE=XML


###########################
##
## TestXMLBuildRepoServ
##
TestXMLBuildRepoServ: TestXMLStartServer
	$(MAKE) --directory=$(PEGASUS_ROOT) -f Makefile repositoryServer REPOSITORY_NAME=repository_xml REPOSITORY_MODE=XML
	$(MAKE) --directory=$(PEGASUS_ROOT) -f Makefile testrepositoryServer REPOSITORY_NAME=repository_xml REPOSITORY_MODE=XML
	$(MAKE) --directory=$(PEGASUS_ROOT) -f TestMakefile -i cimstop 


###########################
##
## TestXMLRepo
##
TestXMLRepo: servertestsclean
	$(MAKE) --directory=$(PEGASUS_ROOT) -f TestMakefile TestXMLStartServer
	$(MAKE) --directory=$(PEGASUS_ROOT) -f Makefile poststarttests REPOSITORY_NAME=repository_xml REPOSITORY_MODE=XML
	$(MAKE) --directory=$(PEGASUS_ROOT) -f TestMakefile -i cimstop 






##############################################################################
##
## TestBinRepository rule is used to run the poststarttests suite on
## the Binary Repository built using cimmofl
##
## TestBinRepositoryServer rule is used to run the poststarttests suite on
## the Binary Repository built using cimmof
##
## TestBinCmpRepository rule is used to run the poststarttest suite on 
## the Binry Compressed Repository built using cimmofl
##

############################
##
## TestBinRepository
##
### bug 3011 disabled Binary Repository testing on LINUX_IA64 to allow
### the nightly tests to run

TestBinRepository: TestBinClean TestBinBuildRepo  TestBinRepo
	@ $(ECHO) TestBinRepository +++++ passed all test


############################
##
## TestBinRepositoryServer
##
TestBinRepositoryServer: TestBinClean  TestBinBuildRepoServ TestBinRepo
	@ $(ECHO) TestBinRepositoryServer +++++ passed all test

############################
##
## TestBinCmpRepository -  run poststarttest on Compressed BIN Repository
##
ifdef PEGASUS_ENABLE_COMPRESSED_REPOSITORY
TestBinCmpRepository: FORCE
	@ $(ECHO) TestBinCmpRepository +++++ Repository compressed by default - nothing more to test.
	@ $(ECHO) TestBinCmpRepository +++++ passed all test
else

ifdef PEGASUS_ENABLE_COMPRESSED_REPOSITORY_TEST

TestBinCmpRepository: TestBinClean  TestCmpBuild TestBinBuildRepo TestBinRepo TestRegBuild
	@ $(ECHO) TestBinCmpRepository +++++ passed all test
else
TestBinCmpRepository: FORCE
	@ $(ECHO) TestBinCmpRepository +++++ Not tested 
	@ $(ECHO) TestBinCmpRepository +++++ refer to readme.compressed_repository
	@ $(ECHO) TestBinCmpRepository +++++ to enable: set PEGASUS_ENABLE_COMPRESSED_REPOSITORY_TEST=true 
endif
endif


###########################
##
## TestBinClean
##
TestBinClean: FORCE
	$(MAKE) --directory=$(PEGASUS_ROOT) -f TestMakefile -i cimstop 
	$(MAKE) --directory=$(PEGASUS_ROOT) -f Makefile repositoryclean REPOSITORY_NAME=repository_bin


###########################
##
## TestBinStartServer
##
TestBinStartServer: FORCE
	$(MAKE) --directory=$(PEGASUS_ROOT)/src/Server -f Makefile install_run
	- $(MKDIRHIER) $(PEGASUS_HOME)/repository_bin
	$(MAKE) --directory=$(PEGASUS_ROOT) -f TestMakefile -i cimstart CIMSERVER_CONFIG_OPTIONS="enableBinaryRepository=true repositoryDir=$(PEGASUS_HOME)/repository_bin"
	$(SLEEP) 5

###########################
##
## TestBinBuildRepo
##
TestBinBuildRepo: FORCE
	$(MAKE) --directory=$(PEGASUS_ROOT) -f Makefile repository REPOSITORY_NAME=repository_bin REPOSITORY_MODE=BIN
	$(MAKE) --directory=$(PEGASUS_ROOT) -f Makefile testrepository REPOSITORY_NAME=repository_bin REPOSITORY_MODE=BIN


###########################
##
## TestBinBuildRepoServ
##
TestBinBuildRepoServ: TestBinStartServer
	$(MAKE) --directory=$(PEGASUS_ROOT) -f Makefile repositoryServer REPOSITORY_NAME=repository_bin REPOSITORY_MODE=BIN
	$(MAKE) --directory=$(PEGASUS_ROOT) -f Makefile testrepositoryServer REPOSITORY_NAME=repository_bin REPOSITORY_MODE=BIN
	$(MAKE) --directory=$(PEGASUS_ROOT) -f TestMakefile -i cimstop 


###########################
##
## TestBinRepo
##
TestBinRepo: servertestsclean 
	$(MAKE) --directory=$(PEGASUS_ROOT) -f TestMakefile TestBinStartServer
	$(MAKE) --directory=$(PEGASUS_ROOT) -f Makefile poststarttests REPOSITORY_NAME=repository_bin REPOSITORY_MODE=BIN
	$(MAKE) --directory=$(PEGASUS_ROOT) -f TestMakefile -i cimstop 




############################
##
## TestCmpBuild - used to compile the repository for compression
##
TestCmpBuild: FORCE
	@ $(MAKE) "-SC" $(ROOT)/src/Pegasus/Repository clean
	@ $(MAKE) "-SC" $(ROOT)/src/Pegasus/Repository depend PEGASUS_ENABLE_COMPRESSED_REPOSITORY=1
	@ $(MAKE) "-SC" $(ROOT)/src/Pegasus/Repository PEGASUS_ENABLE_COMPRESSED_REPOSITORY=1


############################
##
## TestRegBuild - used to compile the repository for no compression
##
TestRegBuild: FORCE
	@ $(MAKE) "-SC" $(ROOT)/src/Pegasus/Repository clean
	@ $(MAKE) "-SC" $(ROOT)/src/Pegasus/Repository depend 
	@ $(MAKE) "-SC" $(ROOT)/src/Pegasus/Repository 


###############################################################################
##
## Trace Configuration
##
## Options: see usagetrace rule
##
###############################################################################

usagetrace: FORCE
	$(USAGE)
	$(USAGE)"TestMakefile Trace Commands: "
	$(USAGE)"  The cimserver must be running when using W=c which is the default for W"
	$(USAGE)
	$(USAGE)" traceon  W=[current/planned(c,p):   Enables all tracing."
	$(USAGE)" traceoff W=[current/planned(c,p):   Disables all tracing."
	$(USAGE)" tracesettings:                      Displays all trace settings."
	$(USAGE)" tracecomp:                          Displays a trace componenets list."
	$(USAGE)" traceon-CL C=[comp] L=[level(1,2,3,4)] W=[current/planned(c,p): "
	$(USAGE)"                           Enables tracing on component C at trace level L."
	$(USAGE)
	$(USAGE)" W defaults to c in the above commands where W can be specified" 
	$(USAGE)
	$(USAGE)"  Usage examples:"
	$(USAGE)"   traceon       turns on trace in current server config"
	$(USAGE)"   traceon W=c   turns on trace in current server config"
	$(USAGE)"   traceon W=p   turns on trace in planned server config"
	$(USAGE)"   traceoff      turns on trace in current server config"
	$(USAGE)"   traceoff W=c  turns on trace in current server config"
	$(USAGE)"   traceoff W=p  turns on trace in planned server config"
	$(USAGE)
	$(USAGE)"   traceon-CL C=DiscardedData L=3 W=c"
	$(USAGE)"     Turns on trace for DiscardedData at level 3 in current server config"
	$(USAGE)"   traceon-CL C=DiscardedData L=3 W=p"
	$(USAGE)"     Turns on trace for DiscardedData at level 3 in planned server config"
	$(USAGE)
	$(USAGE)

traceon: FORCE
	@ cimconfig -s traceComponents=ALL -$W 
	@ cimconfig -s traceLevel=3 -$W
	$(MAKE) -f $(ROOT)/TestMakefile tracesettings


traceoff: FORCE
	@ cimconfig -s traceComponents=  -$W
	$(MAKE) -f $(ROOT)/TestMakefile tracesettings


tracesettings: FORCE
	@ $(ECHO) " "
	cimconfig -g traceComponents -c -p
	@ $(ECHO) " "
	cimconfig -g traceLevel -c -p
	@ $(ECHO) " "
	cimconfig -g traceFilePath -c -p
	@ $(ECHO) " "

traceon-CL: FORCE
	@ cimconfig -s traceComponents=$C -$W
	@ cimconfig -s traceLevel=$L -$W
	$(MAKE) -f $(ROOT)/TestMakefile tracesettings

tracecomp: FORCE
	$(USAGE)
	$(USAGE)"Trace component list:"
	$(USAGE)
	$(USAGE)"Channel"
	$(USAGE)"XmlParser"
	$(USAGE)"XmlWriter"
	$(USAGE)"XmlReader"
	$(USAGE)"XmlIO"
	$(USAGE)"Http"
	$(USAGE)"CimData"
	$(USAGE)"ProvManager"
	$(USAGE)"Repository"
	$(USAGE)"Dispatcher"
	$(USAGE)"OsAbstraction"
	$(USAGE)"Config"
	$(USAGE)"IndDelivery"
	$(USAGE)"IndHandler"
	$(USAGE)"Authentication"
	$(USAGE)"Authorization"
	$(USAGE)"UserManager"
	$(USAGE)"SubscriptionService"
	$(USAGE)"Registration"
	$(USAGE)"Shutdown"
	$(USAGE)"Server"
	$(USAGE)"IndicationService"
	$(USAGE)"IndicationServiceInternal"
	$(USAGE)"ConfigurationManager"
	$(USAGE)"MessageQueueService"
	$(USAGE)"ProviderManager"
	$(USAGE)"ObjectResolution"
	$(USAGE)"WQL"
	$(USAGE)"CQL"
	$(USAGE)"Thread"
	$(USAGE)"MetaDispatcher"
	$(USAGE)"IPC"
	$(USAGE)"IndicationHandlerService"
	$(USAGE)"CIMExportRequestDispatcher"
	$(USAGE)"Memory"
	$(USAGE)"SSL"
	$(USAGE)"ControlProvider"
	$(USAGE)"AsyncOpNode"
	$(USAGE)"CIMOMHandle"
	$(USAGE)"BinaryMessageHandler"
	$(USAGE)"L10N"
	$(USAGE)"ExportClient"
	$(USAGE)"Listener"
	$(USAGE)"DiscardedData"
	$(USAGE)"ProviderAgent"
	$(USAGE)

###############################################################################
##
## Trace Configuration - Old rules being deprecated
##
## Options:
##      XMLTraceOn: Enables XML request and response tracing.
##      ProviderLoadTraceOn: Enables Provider load tracing.
##      XML+ProviderLoadTraceOn: Enables both XML request/response and Provider
##                                 load tracing.
##      AllTraceOn: Enables all tracing.
##      AllTraceOff: Disables all tracing.
##      list: Lists trace settings.
##
###############################################################################

XMLTraceOn:
	cimconfig -s traceComponents=XmlIO -c
	cimconfig -s traceLevel=3 -c
	cimconfig -g traceComponents
	cimconfig -g traceLevel

ProviderLoadTraceOn:
	cimconfig -s traceComponents=ProvManager,OsAbstraction
	cimconfig -s traceLevel=3 -c
	cimconfig -g traceComponents
	cimconfig -g traceLevel

XML+ProviderLoadTraceOn:
	cimconfig -s traceComponents=XmlIO,ProvManager,OsAbstraction
	cimconfig -s traceLevel=3 -c
	cimconfig -g traceComponents
	cimconfig -g traceLevel

AllTraceOn: traceon

AllTraceOff: traceoff

list: tracesettings

#########################################################################
# standardtests
#
# More testing options...
#
# The standard test seem to contain additional test that may not be able 
# to run on all platforms so they have been grouped here for now rather than
# being included in the serversuite rule.
#
# The test are:
#      TestCimmof
#      TestNoSecurity
#      TestLocalSecurity
#      TestRemoteSecurity
#      TestAuthorization
#
# NOTE: The TestsNoSecurity test is comprised of DisableSecurity and
#       TestNoSecurity.
#
# NOTE: The TestNoSecurity step runs the servertests which builds the
#       the repository that is then left in place for the remaining tests.
#       The cimof test must be before the TestNosecurity step as it removes
#       the repository builds a new one with cimmofl and another one with
#       cimmof and then compares them. 
#
# NOTE: The Authentication test is comprised of EnableAuthentication, 
#       TestLocalSecurity and TestRemoteSecurity. 
#
# NOTE: The Authorization test is comprised of EnableAuthorization and
#       TestAuthorization. 
#
# NOTE: The EnableAuthentication and EnableAuthorization steps require 
#       root access. Pegasus doesn't currently have the infrastructure
#       in place to run the server as root and run the test as non-root.
#       Rather than run everything, server, tests, providers, clients etc.
#       as root many testers prefer to run the tests as non-root. Setting
#       PEGASUS_DISABLE_PRIVILEGED_TESTS in the environment helps to 
#       facilitate that.
#

standardtests: FORCE
	$(MAKE) --directory=$(PEGASUS_ROOT) -f TestMakefile -i DisableSecurity
	$(MAKE) --directory=$(PEGASUS_ROOT) -f TestMakefile TestCimmof
	$(MAKE) --directory=$(PEGASUS_ROOT) -f TestMakefile TestNoSecurity
ifndef PEGASUS_DISABLE_PRIVILEGED_TESTS
	$(MAKE) --directory=$(PEGASUS_ROOT) -f TestMakefile EnableAuthentication
	$(MAKE) --directory=$(PEGASUS_ROOT) -f TestMakefile TestLocalSecurity
	$(MAKE) --directory=$(PEGASUS_ROOT) -f TestMakefile TestRemoteSecurity
	$(MAKE) --directory=$(PEGASUS_ROOT) -f TestMakefile EnableAuthorization
	$(MAKE) --directory=$(PEGASUS_ROOT) -f TestMakefile TestAuthorization
else
	@ $(ECHO) "+++++ PEGASUS_DISABLE_PRIVILEGED_TESTS defined: Skipping EnableAuthentication, TestLocalSecurity, and TestRemoteSecurity "
	@ $(ECHO) "+++++ PEGASUS_DISABLE_PRIVILEGED_TESTS defined: Skipping EnableAuthorization and TestAuthorization "	
endif
	@ $(ECHO) "+++++ TestMakefile standardtests complete"

TestNoSecurity:
	$(MAKE) --directory=$(PEGASUS_ROOT) -f TestMakefile servertests
	$(MAKE) --directory=$(PEGASUS_ROOT) -f TestMakefile startcimWithoutSSL
	$(MAKE) --directory=$(PEGASUS_ROOT) -f TestMakefile RunTestClientLocal

TestLocalSecurity:
	$(MAKE) --directory=$(PEGASUS_ROOT) -f TestMakefile RunTestClientLocal
	$(MAKE) --directory=$(PEGASUS_ROOT)/test/wetest -f Makefile poststarttests HOSTNAME= PORT= USER= PASSWORD= SECURITY_ENABLED=true

TestRemoteSecurity:
	TestClient -user $(PEGASUS_TEST_USER_ID) -password $(PEGASUS_TEST_USER_PASS) $(system):5988
	$(MAKE) --directory=$(PEGASUS_ROOT)/test/wetest/static -f Makefile poststarttests HOSTNAME=-h$(system) USER=-u$(PEGASUS_TEST_USER_ID) PASSWORD=-w$(PEGASUS_TEST_USER_PASS) SECURITY_ENABLED=true

TestAuthorization:
	TestPegClientDeleteNamespace -a -user $(PEGASUS_TEST_USER_ID) -password $(PEGASUS_TEST_USER_PASS)
	$(MAKE) --directory=$(PEGASUS_ROOT) -f TestMakefile RunTestClientLocal
	TestClient -user $(PEGASUS_TEST_USER_ID) -password $(PEGASUS_TEST_USER_PASS) $(system):5988
	$(MAKE) --directory=$(PEGASUS_ROOT)/test/wetest/static -f Makefile poststarttests HOSTNAME=-h$(system) USER=-u$(PEGASUS_TEST_USER_ID) PASSWORD=-w$(PEGASUS_TEST_USER_PASS) SECURITY_ENABLED=true

TestSubscriptions:
	$(MAKE) --directory=$(PEGASUS_ROOT) -f TestMakefile DisableSecurity
	$(MAKE) --directory=$(PEGASUS_ROOT) -f Makefile repository
	$(MAKE) --directory=$(PEGASUS_ROOT) -f Makefile testrepository
	$(MAKE) --directory=$(PEGASUS_ROOT) -f TestMakefile startcimWithoutSSL
	$(MAKE) --directory=$(PEGASUS_ROOT)/test/wetest/cimv2/Subscription -f Makefile poststarttests
	$(MAKE) --directory=$(PEGASUS_ROOT) -f TestMakefile cimstop

TestCimmof:
	$(MAKE) --directory=$(PEGASUS_ROOT) -f Testcimmof poststarttests

RunTestClientLocal:
	TestClient -local

DisableSecurity:
	$(MAKE) --directory=$(PEGASUS_ROOT) -f TestMakefile -i cimstop
	cimconfig -s enableAuthentication=false -p
	cimconfig -s enableNamespaceAuthorization=false -p

EnableUsers:
	$(MAKE) --directory=$(PEGASUS_ROOT) -f TestMakefile -i cimstop
	$(MAKE) --directory=$(PEGASUS_ROOT) -f TestMakefile startcimWithoutSSL
	$(MAKE) --directory=$(PEGASUS_ROOT) -f TestMakefile ConfigureUsers

EnableAuthentication:
	$(MAKE) --directory=$(PEGASUS_ROOT) -f TestMakefile -i cimstop
	cimconfig -s enableAuthentication=true -p
	$(MAKE) --directory=$(PEGASUS_ROOT) -f TestMakefile startcimWithoutSSL
	$(MAKE) --directory=$(PEGASUS_ROOT) -f TestMakefile ConfigureUsers

EnableAuthorization:
	$(MAKE) --directory=$(PEGASUS_ROOT) -f TestMakefile -i cimstop
	cimconfig -s enableNamespaceAuthorization=true -p
	$(MAKE) --directory=$(PEGASUS_ROOT) -f TestMakefile startcimWithoutSSL
	$(MAKE) --directory=$(PEGASUS_ROOT) -f TestMakefile -i ConfigureAuthorizations

EnableSSL:
	$(MAKE) --directory=$(PEGASUS_ROOT) -f TestMakefile -i cimstop
	$(MAKE) --directory=$(PEGASUS_ROOT) -f TestMakefile startcimWithSSL

#
# ConfigureUsers
#
# The server must be running prior to invoking this rule
#
ConfigureUsers:
ifndef PEGASUS_PAM_AUTHENTICATION
	cimuser -l
	-cimuser -a -u $(PEGASUS_TEST_USER_ID) -w $(PEGASUS_TEST_USER_PASS)
endif

#
# ConfigureAuthorizations rule
#
# The server must be running prior to invoking this rule
#
ConfigureAuthorizations:
	cimauth -a -u $(PEGASUS_TEST_USER_ID) -n test/cimv2 -R -W
	cimauth -a -u $(PEGASUS_TEST_USER_ID) -n root/cimv2 -R -W
	cimauth -a -u $(PEGASUS_TEST_USER_ID) -n root/PG_Internal -R -W
	cimauth -a -u $(PEGASUS_TEST_USER_ID) -n root/PG_InterOp -R -W
	cimauth -a -u $(PEGASUS_TEST_USER_ID) -n root/benchmark -R -W
	cimauth -a -u $(PEGASUS_TEST_USER_ID) -n root/sampleprovider -R -W
	cimauth -a -u $(PEGASUS_TEST_USER_ID) -n test/static -R -W
	cimauth -a -u $(PEGASUS_TEST_USER_ID) -n root/SampleProvider -R -W
	cimauth -a -u $(PEGASUS_TEST_USER_ID) -n root -R -W
	cimauth -a -u $(PEGASUS_TEST_USER_ID) -n test1 -R -W
	cimauth -a -u $(PEGASUS_TEST_USER_ID) -n test2 -R -W
	cimauth -a -u $(PEGASUS_TEST_USER_ID) -n test3 -R -W
	cimauth -a -u $(PEGASUS_TEST_USER_ID) -n test4 -R -W
	cimauth -a -u $(PEGASUS_TEST_USER_ID) -n test5 -R -W
	cimauth -a -u $(PEGASUS_TEST_USER_ID) -n test6 -R -W
	cimauth -a -u $(PEGASUS_TEST_USER_ID) -n test1/test2 -R -W
	cimauth -a -u $(PEGASUS_TEST_USER_ID) -n test1/test2/test3 -R -W
	cimauth -a -u $(PEGASUS_TEST_USER_ID) -n test1/test2/test3/test4 -R -W
	cimauth -a -u $(PEGASUS_TEST_USER_ID) -n test1/test2/test3/test4/test5 -R -W
	cimauth -a -u $(PEGASUS_TEST_USER_ID) -n test1/test2/test3/test4/test5/test6 -R -W

startcimWithoutSSL: FORCE
	$(MAKE) --directory=$(PEGASUS_ROOT) -f TestMakefile -i cimstart
	$(SLEEP) 5

startcimWithSSL: FORCE
	$(MAKE) --directory=$(PEGASUS_ROOT) -f TestMakefile -i cimstart CIMSERVER_CONFIG_OPTIONS="enableHttpConnection=false enableHttpsConnection=true"
	$(SLEEP) 5

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2