BUG#: 2706
[tpot/pegasus/.git] / TestMakefile
1 include $(PEGASUS_ROOT)/mak/config.mak
2 include $(PEGASUS_ROOT)/mak/test.mak
3
4 system = localhost
5
6 ###############################################################################
7 ##
8 ## Test Makefile for Pegasus CIMOM
9 ##
10 ## Options:
11 ##      rebuild            - Rebuild
12 ##      build              - Build
13 ##      prestarttests      - Execute functional tests
14 ##      poststarttests     - Execute poststarttests (No security, No SSL)
15 ##      tests              - Execute prestarttests and poststarttests
16 ##      standardtests      - Execute poststartests and a series of
17 ##                           posstarttests using multiple options.
18 ##
19 ###############################################################################
20
21 ###############################################################################
22 ##
23 ## Platform specific settings for several platforms.
24 ##
25 ## NOTE: Please add platform specific environment variables as appropriate.
26 ##
27 ###############################################################################
28
29 ifeq ($(PEGASUS_PLATFORM),WIN32_IX86_MSVC)
30     CIMSERVER_START_SERVICE = cimserver -start
31     CIMSERVER_STOP_SERVICE = cimserver -stop
32     SLEEP = mu sleep 5
33     REMOVE_PEGASUS_DIRECTORY = mu rmdirhier pegasus
34     MUEXE = mu.exe
35     MKDIR = $(MUEXE) mkdirhier
36     TESTS = prestarttests poststarttests
37 endif
38
39 ifeq ($(PEGASUS_PLATFORM),DARWIN_PPC_GNU)
40     CIMSERVER_START_SERVICE = cimserver
41     CIMSERVER_STOP_SERVICE = cimserver -s; true
42     SLEEP = sleep 5
43     MUEXE = mu
44     MKDIR = $(MUEXE) mkdirhier
45     TESTS = prestarttests poststarttests
46 endif
47
48 ifeq ($(OS),HPUX)
49     CIMSERVER_START_SERVICE = cimserver
50     CIMSERVER_STOP_SERVICE = cimserver -s; true
51     SLEEP = sleep 5
52     MUEXE = mu
53     MKDIR = $(MUEXE) mkdirhier
54     TESTS = prestarttests poststarttests
55 endif
56
57 ifdef PEGASUS_PLATFORM_LINUX_GENERIC_GNU
58     CIMSERVER_START_SERVICE = cimserver
59     CIMSERVER_STOP_SERVICE = cimserver -s; true
60     SLEEP = sleep 5
61     MUEXE = mu
62     MKDIR = $(MUEXE) mkdirhier
63     TESTS = prestarttests poststarttests
64 endif
65
66 error:
67         @ $(ECHO) "Specify desired makefile option (i.e., build, rebuild)"
68
69 buildmu:
70         $(MAKE) --directory=$(PEGASUS_ROOT)/src/utils/mu -f Makefile
71         $(MKDIR) $(BIN_DIR)
72
73 rebuild: clean buildmu all
74
75 build: all
76
77 all: buildmu
78         $(MAKE)  -f Makefile depend
79         $(MAKE)  -f Makefile all
80
81 doc:
82         $(MAKE) --directory=$(PEGASUS_ROOT)/doc/ProviderSpec -f Makefile
83         $(MAKE) --directory=$(PEGASUS_ROOT)/doc/DevManual -f Makefile
84
85 clean:
86         $(MAKE) -f Makefile clean
87
88 repositoryServer:
89         $(CIMSERVER_STOP_SERVICE)
90         $(SLEEP)
91         $(RMDIRHIER) $(REPOSITORY_ROOT)
92         $(CIMSERVER_START_SERVICE)
93         $(SLEEP)
94         $(MAKE) -f Makefile repositoryServer
95         $(MAKE) -f Makefile testrepositoryServer
96
97 prestarttests:
98         $(CIMSERVER_STOP_SERVICE)
99         $(SLEEP)
100         $(MAKE) -f Makefile repository
101         $(MAKE) -f Makefile testrepository
102         $(MAKE) -f Makefile tests
103         $(MAKE) --directory=$(PEGASUS_ROOT)/src/Server -f Makefile install_run
104
105 poststarttests:
106         $(MAKE) --directory=$(PEGASUS_ROOT)/src/Pegasus/CQL/tests/Queries -f Makefile clean
107         $(MAKE) --directory=$(PEGASUS_ROOT)/src/Pegasus/Query/QueryExpression/tests/Queries -f Makefile clean
108         $(MAKE) --directory=$(PEGASUS_ROOT)/test/wetest -f Makefile clean
109         $(CIMSERVER_START_SERVICE)
110         $(SLEEP)
111         $(MAKE) -f Makefile poststarttests
112
113 tests: $(TESTS)
114 ifeq ($(PEGASUS_PLATFORM),WIN32_IX86_MSVC)
115         $(CIMSERVER_STOP_SERVICE)
116         $(MAKE) --directory=$(PEGASUS_ROOT)/src/Server -f Makefile uninstall
117 endif
118         @ $(ECHO) Finished Tests
119
120 ###############################################################################
121 ##  Test Suite Definitions
122 ###############################################################################
123
124 ###############################################################################
125 ##  OOP Test Suite 1: "Out-of-Process"(OOP) Provider Tests 
126 ##
127 ##  Configuration Options: forceProviderProcesses=true
128 ##
129 ###############################################################################
130 OOP_TS1_CONFIG_OPTIONS = forceProviderProcesses=true
131 OOP_TS1_TEST_CMDS = \
132         TestClient
133
134 run_OOP_TS1:
135         $(MAKE) -f $(PEGASUS_ROOT)/mak/commands.mak runTestSuite \
136             CIMSERVER_CONFIG_OPTIONS="$(OOP_TS1_CONFIG_OPTIONS)" \
137             TESTSUITE_CMDS="$(OOP_TS1_TEST_CMDS)"
138 ###############################################################################
139
140 ###############################################################################
141 ##
142 ## Trace Configuration
143 ##
144 ## Options:
145 ##      XMLTraceOn: Enables XML request and response tracing.
146 ##      ProviderLoadTraceOn: Enables Provider load tracing.
147 ##      XML+ProviderLoadTraceOn: Enables both XML request/response and Provider
148 ##                                 load tracing.
149 ##      AllTraceOn: Enables all tracing.
150 ##      AllTraceOff: Disables all tracing.
151 ##      list: Lists trace settings.
152 ##
153 ###############################################################################
154
155 XMLTraceOn:
156         cimconfig -s traceComponents=XmlIO -c
157         cimconfig -s traceLevel=3 -c
158         cimconfig -g traceComponents
159         cimconfig -g traceLevel
160
161 ProviderLoadTraceOn:
162         cimconfig -s traceComponents=ProvManager,OsAbstraction
163         cimconfig -s traceLevel=3 -c
164         cimconfig -g traceComponents
165         cimconfig -g traceLevel
166
167 XML+ProviderLoadTraceOn:
168         cimconfig -s traceComponents=XmlIO,ProvManager,OsAbstraction
169         cimconfig -s traceLevel=3 -c
170         cimconfig -g traceComponents
171         cimconfig -g traceLevel
172
173 AllTraceOn:
174         cimconfig -s traceComponents=ALL
175         cimconfig -s traceLevel=3 -c
176         cimconfig -g traceComponents
177         cimconfig -g traceLevel
178
179 AllTraceOff:
180         cimconfig -s traceComponents=
181         cimconfig -g traceComponents
182         cimconfig -g traceLevel
183
184 list:
185         cimconfig -g traceComponents
186         cimconfig -g traceLevel
187         cimconfig -g traceFilePath
188
189 # DO NOT DELETE
190
191 standardtests:
192         $(MAKE) -f TestMakefile -i DisableSecurity
193         $(MAKE) -f TestMakefile TestCimmof
194         $(MAKE) -f TestMakefile TestNoSecurity
195         $(MAKE) -f TestMakefile EnableAuthentication
196         $(MAKE) -f TestMakefile TestLocalSecurity
197         $(MAKE) -f TestMakefile TestRemoteSecurity
198         $(MAKE) -f TestMakefile EnableAuthorization
199         $(MAKE) -f TestMakefile TestAuthorization
200
201 TestNoSecurity:
202         $(MAKE) --directory=$(PEGASUS_ROOT) -f TestMakefile tests
203         $(MAKE) -f TestMakefile RunTestClientLocal
204
205 TestLocalSecurity:
206         $(MAKE) -f TestMakefile RunTestClientLocal
207         $(MAKE) --directory=$(PEGASUS_ROOT)/test/wetest -f Makefile poststarttests HOSTNAME= PORT= USER= PASSWORD= SECURITY_ENABLED=true
208
209 TestRemoteSecurity:
210         TestClient -user guest -password guest $(system):5988
211         $(MAKE) --directory=$(PEGASUS_ROOT)/test/wetest/static -f Makefile poststarttests HOSTNAME=-h$(system) USER=-uguest PASSWORD=-wguest SECURITY_ENABLED=true
212
213 TestAuthorization:
214         DeleteNamespace -a -user guest -password guest
215         $(MAKE) -f TestMakefile RunTestClientLocal
216         TestClient -user guest -password guest $(system):5988
217         $(MAKE) --directory=$(PEGASUS_ROOT)/test/wetest/static -f Makefile poststarttests HOSTNAME=-h$(system) USER=-uguest PASSWORD=-wguest SECURITY_ENABLED=true
218
219 TestSubscriptions:
220         $(MAKE) -f TestMakefile DisableSecurity
221         $(MAKE) --directory=$(PEGASUS_ROOT) -f Makefile repository
222         $(MAKE) --directory=$(PEGASUS_ROOT) -f Makefile testrepository
223         $(MAKE) -f TestMakefile startcimWithoutSSL
224         $(MAKE) --directory=$(PEGASUS_ROOT)/test/wetest/cimv2/Subscription -f Makefile poststarttests
225         $(MAKE) -f TestMakefile stopcim
226
227 TestCimmof:
228         $(MAKE) -f Testcimmof poststarttests
229
230 RunTestClientLocal:
231         TestClient -local
232
233 DisableSecurity:
234         $(MAKE) -f TestMakefile -i stopcim
235         cimconfig -s enableAuthentication=false -p
236         cimconfig -s enableNamespaceAuthorization=false -p
237
238 EnableAuthentication:
239         $(MAKE) -f TestMakefile -i stopcim
240         cimconfig -s enableAuthentication=true -p
241         $(MAKE) -f TestMakefile startcimWithoutSSL
242         $(MAKE) -f TestMakefile ConfigureUsers
243
244 EnableAuthorization:
245         $(MAKE) -f TestMakefile -i stopcim
246         cimconfig -s enableNamespaceAuthorization=true -p
247         $(MAKE) -f TestMakefile startcimWithoutSSL
248         $(MAKE) -f TestMakefile -i ConfigureAuthorizations
249
250 EnableSSL:
251         $(MAKE) -f TestMakefile -i stopcim
252         $(MAKE) -f TestMakefile startcimWithSSL
253
254 ConfigureUsers:
255 ifndef PEGASUS_PAM_AUTHENTICATION
256         cimuser -a -u guest -w guest
257 endif
258
259 ConfigureAuthorizations:
260         cimauth -a -u guest -n test/cimv2 -R -W
261         cimauth -a -u guest -n root/cimv2 -R -W
262         cimauth -a -u guest -n root/PG_Internal -R -W
263         cimauth -a -u guest -n root/PG_InterOp -R -W
264         cimauth -a -u guest -n root/benchmark -R -W
265         cimauth -a -u guest -n root/sampleprovider -R -W
266         cimauth -a -u guest -n test/static -R -W
267         cimauth -a -u guest -n root/SampleProvider -R -W
268         cimauth -a -u guest -n root -R -W
269         cimauth -a -u guest -n test1 -R -W
270         cimauth -a -u guest -n test2 -R -W
271         cimauth -a -u guest -n test3 -R -W
272         cimauth -a -u guest -n test4 -R -W
273         cimauth -a -u guest -n test5 -R -W
274         cimauth -a -u guest -n test6 -R -W
275         cimauth -a -u guest -n test1/test2 -R -W
276         cimauth -a -u guest -n test1/test2/test3 -R -W
277         cimauth -a -u guest -n test1/test2/test3/test4 -R -W
278         cimauth -a -u guest -n test1/test2/test3/test4/test5 -R -W
279         cimauth -a -u guest -n test1/test2/test3/test4/test5/test6 -R -W
280
281 startcimWithoutSSL:
282         $(CIMSERVER_START_SERVICE)
283         $(SLEEP)
284
285 startcimWithSSL:
286         $(CIMSERVER_START_SERVICE) enableHttpConnection=false enableHttpsConnection=true
287         $(SLEEP)
288
289 stopcim:
290         $(CIMSERVER_STOP_SERVICE)
291         $(SLEEP)
292
293 rebuild:
294         $(MAKE) -f TestMakefile -i stopcim
295         rm -f rebuild.txt
296         $(MAKE) -f TestMakefile pegasus >> rebuild.txt  2>&1
297
298 pegasus:
299         $(MAKE) -f Makefile rebuild