(file) Return to GNUmakefile CVS log (file) (dir) Up to [OMI] / omi / protocol / posthttp / tests

File: [OMI] / omi / protocol / posthttp / tests / GNUmakefile (download)
Revision: 1.1, Mon Apr 20 17:19:56 2015 UTC (9 years, 2 months ago) by krisbash
Branch: MAIN
CVS Tags: OMI_1_0_8_2, OMI_1_0_8_1, HEAD
OMI 1.0.8-1

TOP = ../../..
include $(TOP)/config.mak

#include $(TOP)/mak/rules.mak

POSTHTTP=$(BINDIR)/posthttp

define NL


endef

all:

##==============================================================================
##
## testwsman 
##
##     Rule to run one WS-Management test. It performs the following steps:
##
##         (1) Sends the request given by $(1).request.xml to server.
##         (2) Gets response back.
##         (3) Applies edits given by SED file: $(1).sed
##         (4) Diffs edited file with expected file: $(1).response.xml
##
##     This function is called like this:
##
##         $(call testwsman,TESTNAME)
##
##     Where TESTNAME is the name of some test. Three files must exist:
##
##         TESTNAME.request.xml (contains request)
##         TESTNAME.sed (contains SED edits to be applied to response)
##         TESTNAME.response.xml (contains expected response)
##
##==============================================================================

testwsman = \
	@ echo "Testing $(1)..." $(NL) \
	@ $(POSTHTTP) $(1).request.xml > $(TMPDIR)/$(1).tmp $(NL) \
	@ sed -f $(1).sed $(TMPDIR)/$(1).tmp > $(TMPDIR)/$(1).xml $(NL) \
	@ diff $(TMPDIR)/$(1).xml $(1).response.xml

##==============================================================================
##
## tests:
##
##==============================================================================

tests:
	@ $(BINDIR)/omiserver -d -i --livetime 10
	@ sleep 1
	@ echo "==== $(POSTHTTP) tests:"
	$(call testwsman,test2)
	$(call testwsman,test3)
	@ echo
	@ $(BINDIR)/omiserver -s > /dev/null

clean:

depend:

stage:
	@ $(BINDIR)/omiserver -d -i --livetime 10
	@ sleep 1
	$(POSTHTTP) test3.request.xml

print:
	$(BINDIR)/printxml print.xml

ViewCVS 0.9.2