blob: f7f7fd85fee113d2a7bdf42124cab5a3013128f2 (
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
|
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) $(VALGRIND) ./randkey-test
test-handle-server:: server-handle-test
$(ENV_SETUP) $(VALGRIND) ./server-handle-test
test-handle-client:: client-handle-test
$(ENV_SETUP) $(VALGRIND) ./client-handle-test
test-noauth: init-test
$(ENV_SETUP) $(VALGRIND) ./init-test
test-destroy: destroy-test
$(ENV_SETUP) $(VALGRIND) ./destroy-test
unit-test-client-setup::
$(ENV_SETUP) $(VALGRIND) $(START_SERVERS)
unit-test-client-cleanup::
$(ENV_SETUP) $(STOP_SERVERS)
unit-test-server-setup::
$(ENV_SETUP) $(VALGRIND) $(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@ VALGRIND="$(VALGRIND)" \
$(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@ VALGRIND="$(VALGRIND)" \
$(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.*
|