summaryrefslogtreecommitdiffstats
path: root/src/lib/kadm5/unit-test/Makefile.in
blob: 7ec2d4ec1d0db5afec256d702314aa1214984413 (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
thisconfigdir=../../..
myfulldir=lib/kadm5/unit-test
mydir=lib/kadm5/unit-test
BUILDTOP=$(REL)..$(S)..$(S)..
DEFINES = -DUSE_KADM5_API_VERSION=1
PROG_LIBPATH=-L$(TOPLIBD)
PROG_RPATH=$(KRB5_LIBDIR)
KDB_DEP_LIB=$(DL_LIB) $(THREAD_LINKOPTS)
DEFS=

SRCS= init-test.c destroy-test.c handle-test.c iter-test.c setkey-test.c \
	randkey-test.c lock-test.c

all:: init-test destroy-test client-handle-test client-iter-test
all:: randkey-test server-handle-test lock-test server-iter-test 
all:: server-setkey-test client-setkey-test

#
# The client-side test programs.
#

init-test: init-test.o $(KADMCLNT_DEPLIBS) $(KRB5_BASE_DEPLIBS)
	$(CC_LINK) -o init-test init-test.o \
		$(KADMCLNT_LIBS) $(KRB5_BASE_LIBS)

destroy-test: destroy-test.o $(KADMCLNT_DEPLIBS) $(KRB5_BASE_DEPLIBS)
	$(CC_LINK) -o destroy-test destroy-test.o \
		$(KADMCLNT_LIBS) $(KRB5_BASE_LIBS)

client-handle-test: handle-test.o $(KADMCLNT_DEPLIBS) $(KRB5_BASE_DEPLIBS)
	$(CC_LINK) -o client-handle-test handle-test.o \
		$(KADMCLNT_LIBS) $(KRB5_BASE_LIBS)

client-iter-test: iter-test.o $(KADMLCNT_DEPLIBS) $(KRB5_BASE_DEPLIBS)
	$(CC_LINK) -o client-iter-test iter-test.o \
		$(KADMCLNT_LIBS) $(KRB5_BASE_LIBS)

client-setkey-test: setkey-test.o $(KADMCLNT_DEPLIBS) $(KRB5_BASE_DEPLIBS)
	$(CC_LINK) -o client-setkey-test setkey-test.o \
		$(KADMCLNT_LIBS) $(KRB5_BASE_LIBS)

#
# The server-side test programs.
#

randkey-test: randkey-test.o $(KADMSRV_DEPLIBS) $(KRB5_BASE_DEPLIBS)
	$(CC_LINK) -o randkey-test randkey-test.o \
		$(KADMSRV_LIBS) $(KDB_DEP_LIB) $(KRB5_BASE_LIBS)

server-handle-test: handle-test.o $(KADMSRV_DEPLIBS) $(KRB5_BASE_DEPLIBS)
	$(CC_LINK) -o server-handle-test handle-test.o \
		$(KADMSRV_LIBS) $(KDB_DEP_LIB) $(KRB5_BASE_LIBS)

lock-test: lock-test.o $(KADMSRV_DEPLIBS) $(KRB5_BASE_DEPLIBS)
	$(CC_LINK) -o lock-test lock-test.o \
		$(KADMSRV_LIBS) $(KDB_DEP_LIB) $(KRB5_BASE_LIBS)

server-iter-test: iter-test.o $(KADMSRV_DEPLIBS) $(KRB5_BASE_DEPLIBS)
	$(CC_LINK) -o server-iter-test iter-test.o \
		$(KADMSRV_LIBS) $(KDB_DEP_LIB) $(KRB5_BASE_LIBS)

setkey-test.o: $(SRCTOP)/lib/kadm5/unit-test/setkey-test.c
	$(CC) $(ALL_CFLAGS) -UUSE_KADM5_API_VERSION -DUSE_KADM5_API_VERSION=2 -c $(SRCTOP)/lib/kadm5/unit-test/setkey-test.c

server-setkey-test: setkey-test.o $(KADMSRV_DEPLIBS) $(KRB5_BASE_DEPLIBS)
	$(CC_LINK) -o server-setkey-test setkey-test.o \
		$(KADMSRV_LIBS) $(KDB_DEP_LIB) $(KRB5_BASE_LIBS)

#
# The unit-test targets
#

check:: check-@DO_TEST@

check-::
	@echo "+++"
	@echo "+++ WARNING: lib/kadm5 unit tests not run."
	@echo "+++ Either tcl, runtest, or Perl is unavailable."
	@echo "+++"

check-ok unit-test:: unit-test-client unit-test-server

unit-test-client: unit-test-client-setup unit-test-client-body \
	unit-test-client-cleanup

unit-test-server: unit-test-server-setup unit-test-server-body \
	unit-test-server-cleanup

test-randkey:: randkey-test
	$(ENV_SETUP) ./randkey-test

test-handle-server:: server-handle-test
	$(ENV_SETUP) ./server-handle-test

test-handle-client:: client-handle-test
	$(ENV_SETUP) ./client-handle-test

test-noauth: init-test
	$(ENV_SETUP) ./init-test

test-destroy: destroy-test
	$(ENV_SETUP) ./destroy-test

unit-test-client-setup::
	$(ENV_SETUP) $(START_SERVERS)

unit-test-client-cleanup::
	$(ENV_SETUP) $(STOP_SERVERS)

unit-test-server-setup::
	$(ENV_SETUP) $(START_SERVERS_LOCAL)

unit-test-server-cleanup::
	$(ENV_SETUP) $(STOP_SERVERS_LOCAL)

unit-test-client-body: site.exp test-noauth test-destroy test-handle-client 
	$(ENV_SETUP) $(RUNTEST) --tool api RPC=1 API=$(CLNTTCL) \
		KINIT=$(BUILDTOP)/clients/kinit/kinit \
		KDESTROY=$(BUILDTOP)/clients/kdestroy/kdestroy \
		KADMIN_LOCAL=$(BUILDTOP)/kadmin/cli/kadmin.local \
		PRIOCNTL_HACK=@PRIOCNTL_HACK@ $(RUNTESTFLAGS)
	-mv api.log capi.log
	-mv api.sum capi.sum

unit-test-server-body: site.exp test-handle-server lock-test 
	$(ENV_SETUP) $(RUNTEST) --tool api RPC=0 API=$(SRVTCL) \
		LOCKTEST=./lock-test \
		KADMIN_LOCAL=$(BUILDTOP)/kadmin/cli/kadmin.local \
		PRIOCNTL_HACK=@PRIOCNTL_HACK@ $(RUNTESTFLAGS)
	-mv api.log sapi.log
	-mv api.sum sapi.sum

clean::
	$(RM) init-test client_init.o init-test.o
	$(RM) destroy-test destroy-test.o
	$(RM) client-handle-test handle-test.o
	$(RM) client-iter-test iter-test.o
	$(RM) randkey-test randkey-test.o
	$(RM) server-handle-test handle-test.o
	$(RM) lock-test lock-test.o
	$(RM) server-iter-test iter-test.o
	$(RM) server-setkey-test client-setkey-test setkey-test.o
	$(RM) *.log *.plog *.sum *.psum unit-test-log.*
# +++ Dependency line eater +++
# 
# Makefile dependencies follow.  This must be the last section in
# the Makefile.in file
#
$(OUTPRE)init-test.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
  $(BUILDTOP)/include/gssapi/gssapi.h $(BUILDTOP)/include/gssrpc/types.h \
  $(BUILDTOP)/include/kadm5/admin.h $(BUILDTOP)/include/kadm5/chpass_util_strings.h \
  $(BUILDTOP)/include/kadm5/kadm_err.h $(BUILDTOP)/include/krb5/krb5.h \
  $(COM_ERR_DEPS) $(SRCTOP)/include/gssrpc/auth.h $(SRCTOP)/include/gssrpc/auth_gss.h \
  $(SRCTOP)/include/gssrpc/auth_unix.h $(SRCTOP)/include/gssrpc/clnt.h \
  $(SRCTOP)/include/gssrpc/rename.h $(SRCTOP)/include/gssrpc/rpc.h \
  $(SRCTOP)/include/gssrpc/rpc_msg.h $(SRCTOP)/include/gssrpc/svc.h \
  $(SRCTOP)/include/gssrpc/svc_auth.h $(SRCTOP)/include/gssrpc/xdr.h \
  $(SRCTOP)/include/k5-platform.h $(SRCTOP)/include/k5-thread.h \
  $(SRCTOP)/include/kdb.h $(SRCTOP)/include/krb5.h init-test.c
$(OUTPRE)destroy-test.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
  $(BUILDTOP)/include/gssapi/gssapi.h $(BUILDTOP)/include/gssrpc/types.h \
  $(BUILDTOP)/include/kadm5/admin.h $(BUILDTOP)/include/kadm5/admin_internal.h \
  $(BUILDTOP)/include/kadm5/chpass_util_strings.h $(BUILDTOP)/include/kadm5/client_internal.h \
  $(BUILDTOP)/include/kadm5/kadm_err.h $(BUILDTOP)/include/krb5/krb5.h \
  $(COM_ERR_DEPS) $(SRCTOP)/include/gssrpc/auth.h $(SRCTOP)/include/gssrpc/auth_gss.h \
  $(SRCTOP)/include/gssrpc/auth_unix.h $(SRCTOP)/include/gssrpc/clnt.h \
  $(SRCTOP)/include/gssrpc/rename.h $(SRCTOP)/include/gssrpc/rpc.h \
  $(SRCTOP)/include/gssrpc/rpc_msg.h $(SRCTOP)/include/gssrpc/svc.h \
  $(SRCTOP)/include/gssrpc/svc_auth.h $(SRCTOP)/include/gssrpc/xdr.h \
  $(SRCTOP)/include/k5-platform.h $(SRCTOP)/include/k5-thread.h \
  $(SRCTOP)/include/kdb.h $(SRCTOP)/include/krb5.h destroy-test.c
$(OUTPRE)handle-test.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
  $(BUILDTOP)/include/gssapi/gssapi.h $(BUILDTOP)/include/gssrpc/types.h \
  $(BUILDTOP)/include/kadm5/admin.h $(BUILDTOP)/include/kadm5/admin_internal.h \
  $(BUILDTOP)/include/kadm5/chpass_util_strings.h $(BUILDTOP)/include/kadm5/client_internal.h \
  $(BUILDTOP)/include/kadm5/kadm_err.h $(BUILDTOP)/include/krb5/krb5.h \
  $(COM_ERR_DEPS) $(SRCTOP)/include/gssrpc/auth.h $(SRCTOP)/include/gssrpc/auth_gss.h \
  $(SRCTOP)/include/gssrpc/auth_unix.h $(SRCTOP)/include/gssrpc/clnt.h \
  $(SRCTOP)/include/gssrpc/rename.h $(SRCTOP)/include/gssrpc/rpc.h \
  $(SRCTOP)/include/gssrpc/rpc_msg.h $(SRCTOP)/include/gssrpc/svc.h \
  $(SRCTOP)/include/gssrpc/svc_auth.h $(SRCTOP)/include/gssrpc/xdr.h \
  $(SRCTOP)/include/k5-platform.h $(SRCTOP)/include/k5-thread.h \
  $(SRCTOP)/include/kdb.h $(SRCTOP)/include/krb5.h handle-test.c
$(OUTPRE)iter-test.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
  $(BUILDTOP)/include/gssapi/gssapi.h $(BUILDTOP)/include/gssrpc/types.h \
  $(BUILDTOP)/include/kadm5/admin.h $(BUILDTOP)/include/kadm5/chpass_util_strings.h \
  $(BUILDTOP)/include/kadm5/kadm_err.h $(BUILDTOP)/include/krb5/krb5.h \
  $(COM_ERR_DEPS) $(SRCTOP)/include/gssrpc/auth.h $(SRCTOP)/include/gssrpc/auth_gss.h \
  $(SRCTOP)/include/gssrpc/auth_unix.h $(SRCTOP)/include/gssrpc/clnt.h \
  $(SRCTOP)/include/gssrpc/rename.h $(SRCTOP)/include/gssrpc/rpc.h \
  $(SRCTOP)/include/gssrpc/rpc_msg.h $(SRCTOP)/include/gssrpc/svc.h \
  $(SRCTOP)/include/gssrpc/svc_auth.h $(SRCTOP)/include/gssrpc/xdr.h \
  $(SRCTOP)/include/k5-platform.h $(SRCTOP)/include/k5-thread.h \
  $(SRCTOP)/include/kdb.h $(SRCTOP)/include/krb5.h iter-test.c
$(OUTPRE)setkey-test.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
  $(BUILDTOP)/include/gssapi/gssapi.h $(BUILDTOP)/include/gssrpc/types.h \
  $(BUILDTOP)/include/kadm5/admin.h $(BUILDTOP)/include/kadm5/chpass_util_strings.h \
  $(BUILDTOP)/include/kadm5/kadm_err.h $(BUILDTOP)/include/krb5/krb5.h \
  $(BUILDTOP)/include/osconf.h $(BUILDTOP)/include/profile.h \
  $(COM_ERR_DEPS) $(SRCTOP)/include/gssrpc/auth.h $(SRCTOP)/include/gssrpc/auth_gss.h \
  $(SRCTOP)/include/gssrpc/auth_unix.h $(SRCTOP)/include/gssrpc/clnt.h \
  $(SRCTOP)/include/gssrpc/rename.h $(SRCTOP)/include/gssrpc/rpc.h \
  $(SRCTOP)/include/gssrpc/rpc_msg.h $(SRCTOP)/include/gssrpc/svc.h \
  $(SRCTOP)/include/gssrpc/svc_auth.h $(SRCTOP)/include/gssrpc/xdr.h \
  $(SRCTOP)/include/k5-err.h $(SRCTOP)/include/k5-int.h \
  $(SRCTOP)/include/k5-platform.h $(SRCTOP)/include/k5-plugin.h \
  $(SRCTOP)/include/k5-thread.h $(SRCTOP)/include/kdb.h \
  $(SRCTOP)/include/krb5.h $(SRCTOP)/include/krb5/locate_plugin.h \
  $(SRCTOP)/include/krb5/preauth_plugin.h $(SRCTOP)/include/port-sockets.h \
  $(SRCTOP)/include/socket-utils.h setkey-test.c
$(OUTPRE)randkey-test.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
  $(BUILDTOP)/include/gssapi/gssapi.h $(BUILDTOP)/include/gssrpc/types.h \
  $(BUILDTOP)/include/kadm5/admin.h $(BUILDTOP)/include/kadm5/chpass_util_strings.h \
  $(BUILDTOP)/include/kadm5/kadm_err.h $(BUILDTOP)/include/krb5/krb5.h \
  $(COM_ERR_DEPS) $(SRCTOP)/include/gssrpc/auth.h $(SRCTOP)/include/gssrpc/auth_gss.h \
  $(SRCTOP)/include/gssrpc/auth_unix.h $(SRCTOP)/include/gssrpc/clnt.h \
  $(SRCTOP)/include/gssrpc/rename.h $(SRCTOP)/include/gssrpc/rpc.h \
  $(SRCTOP)/include/gssrpc/rpc_msg.h $(SRCTOP)/include/gssrpc/svc.h \
  $(SRCTOP)/include/gssrpc/svc_auth.h $(SRCTOP)/include/gssrpc/xdr.h \
  $(SRCTOP)/include/k5-platform.h $(SRCTOP)/include/k5-thread.h \
  $(SRCTOP)/include/kdb.h $(SRCTOP)/include/krb5.h randkey-test.c
$(OUTPRE)lock-test.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
  $(BUILDTOP)/include/gssapi/gssapi.h $(BUILDTOP)/include/gssrpc/types.h \
  $(BUILDTOP)/include/kadm5/admin.h $(BUILDTOP)/include/kadm5/chpass_util_strings.h \
  $(BUILDTOP)/include/kadm5/kadm_err.h $(BUILDTOP)/include/krb5/krb5.h \
  $(COM_ERR_DEPS) $(SRCTOP)/include/gssrpc/auth.h $(SRCTOP)/include/gssrpc/auth_gss.h \
  $(SRCTOP)/include/gssrpc/auth_unix.h $(SRCTOP)/include/gssrpc/clnt.h \
  $(SRCTOP)/include/gssrpc/rename.h $(SRCTOP)/include/gssrpc/rpc.h \
  $(SRCTOP)/include/gssrpc/rpc_msg.h $(SRCTOP)/include/gssrpc/svc.h \
  $(SRCTOP)/include/gssrpc/svc_auth.h $(SRCTOP)/include/gssrpc/xdr.h \
  $(SRCTOP)/include/k5-platform.h $(SRCTOP)/include/k5-thread.h \
  $(SRCTOP)/include/kdb.h $(SRCTOP)/include/krb5.h lock-test.c