summaryrefslogtreecommitdiffstats
path: root/TestMakefile
blob: e192b55b66ba011a9a79a201e1f865c9e0286f3c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
include $(PEGASUS_ROOT)/mak/config.mak
include $(PEGASUS_ROOT)/mak/test.mak

system = localhost

###############################################################################
##
## Test Makefile for Pegasus CIMOM
##
## Options:
##      rebuild            - Rebuild
##      build              - Build 
##      prestarttests      - Execute functional tests
##      poststarttests     - Execute poststarttests (No security, No SSL)
##      tests              - Execute prestarttests and poststarttests
##      standardtests      - Execute poststartests and a series of
##                           posstarttests using multiple options.
## 
###############################################################################

###############################################################################
##
## Platform specific settings for several platforms.
##
## NOTE: Please add platform specific environment variables as appropriate. 
##
###############################################################################

ifeq ($(PEGASUS_PLATFORM),WIN32_IX86_MSVC)
  CIMSERVER_START_SERVICE = cimserver -start
  CIMSERVER_STOP_SERVICE = cimserver -stop
  SLEEP =
  REMOVE_PEGASUS_DIRECTORY = mu rmdirhier pegasus
  MUEXE = mu.exe
  COPYMU = copy src\utils\mu\$(MUEXE) /y $(MUEXE)
  MKDIR = src/utils/mu/mu mkdirhier
  TESTS = prestarttests poststarttests
endif

ifeq ($(OS),HPUX)
  CIMSERVER_START_SERVICE = cimserver
  CIMSERVER_STOP_SERVICE = cimserver -s; true
  SLEEP = sleep 5
  MUEXE = mu
  COPYMU = cp -f src/utils/mu/$(MUEXE) $(BIN_DIR)/$(MUEXE)
  MKDIR = src/utils/mu/mu mkdirhier
  TESTS = prestarttests poststarttests
endif

ifdef PEGASUS_PLATFORM_LINUX_GENERIC_GNU
  CIMSERVER_START_SERVICE = cimserver
  CIMSERVER_STOP_SERVICE = cimserver -s; true
  SLEEP = sleep 5
  MUEXE = mu
  COPYMU = cp -f src/utils/mu/$(MUEXE) $(BIN_DIR)/$(MUEXE)
  MKDIR = src/utils/mu/mu mkdirhier
  TESTS = prestarttests poststarttests
endif

error: 
	@ echo "Specify desired makefile option (i.e., build, rebuild)"

buildmu:
	$(MAKE) --directory=$(PEGASUS_ROOT)/src/utils/mu -f Makefile
	$(MKDIR) $(BIN_DIR)
	$(COPYMU)

rebuild: clean buildmu all

build: all

all: buildmu
	$(MAKE)  -f Makefile depend
	$(MAKE)  -f Makefile all

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

clean:
	$(MAKE) -f Makefile clean

repositoryServer: 
	$(CIMSERVER_STOP_SERVICE)
	$(SLEEP)
	$(RMDIRHIER) $(REPOSITORY_ROOT)
	$(CIMSERVER_START_SERVICE)
	$(SLEEP)
	$(MAKE) -f Makefile repositoryServer
	$(MAKE) -f Makefile testrepositoryServer

prestarttests: 
	$(CIMSERVER_STOP_SERVICE)
	$(SLEEP)
	$(MAKE) -f Makefile repository
	$(MAKE) -f Makefile testrepository
	$(MAKE) -f Makefile tests
	$(MAKE) --directory=$(PEGASUS_ROOT)/src/Server -f Makefile install

poststarttests:
	$(MAKE) --directory=$(PEGASUS_ROOT)/test/wetest -f Makefile clean
	$(CIMSERVER_START_SERVICE)
	$(SLEEP)
	$(MAKE) -f Makefile poststarttests

tests: $(TESTS)
ifeq ($(PEGASUS_PLATFORM),WIN32_IX86_MSVC)
	$(CIMSERVER_STOP_SERVICE)
	$(MAKE) --directory=$(PEGASUS_ROOT)/src/Server -f Makefile uninstall
endif
	@ echo Finished Tests

###############################################################################
##
## Trace Configuration
##
## 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:
	cimconfig -s traceComponents=ALL
	cimconfig -s traceLevel=3 -c
	cimconfig -g traceComponents
	cimconfig -g traceLevel

AllTraceOff:
	cimconfig -s traceComponents=
	cimconfig -g traceComponents
	cimconfig -g traceLevel

list:
	cimconfig -g traceComponents
	cimconfig -g traceLevel
	cimconfig -g traceFilePath

# DO NOT DELETE

standardtests: 
	$(MAKE) -f TestMakefile -i DisableSecurity
	$(MAKE) -f TestMakefile TestCimmof
	$(MAKE) -f TestMakefile TestNoSecurity
	$(MAKE) -f TestMakefile EnableAuthentication 
	$(MAKE) -f TestMakefile TestLocalSecurity
	$(MAKE) -f TestMakefile TestRemoteSecurity
	$(MAKE) -f TestMakefile EnableAuthorization
	$(MAKE) -f TestMakefile TestAuthorization 

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

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

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

TestAuthorization:
	DeleteNamespace -a -user guest -password guest
	$(MAKE) -f TestMakefile RunTestClientLocal
	TestClient -user guest -password guest $(system):5988
	$(MAKE) --directory=$(PEGASUS_ROOT)/test/wetest/static -f Makefile poststarttests HOSTNAME=-h$(system) USER=-uguest PASSWORD=-wguest SECURITY_ENABLED=true

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

TestCimmof:
	$(MAKE) -f Testcimmof poststarttests


RunTestClientLocal:
	TestClient -local

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

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

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

EnableSSL:
	$(MAKE) -f TestMakefile -i stopcim
	$(MAKE) -f TestMakefile startcimWithSSL

ConfigureUsers:
ifndef PEGASUS_PAM_AUTHENTICATION
	cimuser -a -u guest -w guest
endif

ConfigureAuthorizations:
	cimauth -a -u guest -n test/cimv2 -R -W
	cimauth -a -u guest -n root/cimv2 -R -W
	cimauth -a -u guest -n root/PG_Internal -R -W
	cimauth -a -u guest -n root/PG_InterOp -R -W
	cimauth -a -u guest -n root/benchmark -R -W
	cimauth -a -u guest -n root/sampleprovider -R -W
	cimauth -a -u guest -n test/static -R -W
	cimauth -a -u guest -n root/SampleProvider -R -W
	cimauth -a -u guest -n root -R -W
	cimauth -a -u guest -n test1 -R -W
	cimauth -a -u guest -n test2 -R -W
	cimauth -a -u guest -n test3 -R -W
	cimauth -a -u guest -n test4 -R -W
	cimauth -a -u guest -n test5 -R -W
	cimauth -a -u guest -n test6 -R -W
	cimauth -a -u guest -n test1/test2 -R -W
	cimauth -a -u guest -n test1/test2/test3 -R -W
	cimauth -a -u guest -n test1/test2/test3/test4 -R -W
	cimauth -a -u guest -n test1/test2/test3/test4/test5 -R -W
	cimauth -a -u guest -n test1/test2/test3/test4/test5/test6 -R -W

startcimWithoutSSL:
	cimserver
	sleep 10

startcimWithSSL:
	cimserver enableHttpConnection=false enableHttpsConnection=true
	sleep 10

stopcim:
	$(CIMSERVER_STOP_SERVICE)
	sleep 5

rebuild:
	$(MAKE) -f TestMakefile -i stopcim	
	rm -f rebuild.txt
	$(MAKE) -f TestMakefile pegasus >> rebuild.txt  2>&1

pegasus:
	$(MAKE) -f Makefile rebuild