Skip to content

Commit

Permalink
Move test utilities out of dejagnu subdirectory
Browse files Browse the repository at this point in the history
Move pkinit-certs, proxy-certs, and t_inetd.c from tests/dejagnu to
tests and repoint references at the new locations.
  • Loading branch information
greghudson committed May 29, 2021
1 parent 3fa40a3 commit 7e83975
Show file tree
Hide file tree
Showing 35 changed files with 31 additions and 35 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,7 @@ local.properties
/src/tests/s2p
/src/tests/s4u2proxy
/src/tests/s4u2self
/src/tests/t_inetd
/src/tests/unlockiter

/src/tests/asn.1/expected_encode.out
Expand All @@ -440,7 +441,6 @@ local.properties
/src/tests/dejagnu/krb.sum
/src/tests/dejagnu/runenv.vals
/src/tests/dejagnu/site.exp
/src/tests/dejagnu/t_inetd
/src/tests/dejagnu/tmpdir/

/src/tests/gss-threads/gss-client
Expand Down
13 changes: 10 additions & 3 deletions src/tests/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ RUN_DB_TEST = $(RUN_SETUP) KRB5_KDC_PROFILE=kdc.conf KRB5_CONFIG=krb5.conf \

OBJS= adata.o etinfo.o forward.o gcred.o hist.o hooks.o hrealm.o \
icinterleave.o icred.o kdbtest.o localauth.o plugorder.o rdreq.o \
replay.o responder.o s2p.o s4u2self.o s4u2proxy.o unlockiter.o
replay.o responder.o s2p.o s4u2self.o s4u2proxy.o t_inetd.o \
unlockiter.o
EXTRADEPSRCS= adata.c etinfo.c forward.c gcred.c hist.c hooks.c hrealm.c \
icinterleave.c icred.c kdbtest.c localauth.c plugorder.c rdreq.c \
replay.c responder.c s2p.c s4u2self.c s4u2proxy.c unlockiter.c
replay.c responder.c s2p.c s4u2self.c s4u2proxy.c t_inetd.c \
unlockiter.c

TEST_DB = ./testdb
TEST_REALM = FOO.TEST.REALM
Expand Down Expand Up @@ -78,10 +80,15 @@ s4u2self: s4u2self.o $(KRB5_BASE_DEPLIBS)
s4u2proxy: s4u2proxy.o $(KRB5_BASE_DEPLIBS)
$(CC_LINK) -o $@ s4u2proxy.o $(KRB5_BASE_LIBS)

t_inetd: t_inetd.o $(KRB5_BASE_DEPLIBS)
$(CC_LINK) -o $@ t_inetd.o $(LIBS) $(KRB5_BASE_LIBS)

unlockiter: unlockiter.o $(KDB5_DEPLIBS) $(KADMSRV_DEPLIBS) $(KRB5_BASE_DEPLIBS)
$(CC_LINK) -o $@ unlockiter.o $(KDB5_LIBS) $(KADMSRV_LIBS) \
$(KRB5_BASE_LIBS)

all-unix: t_inetd

check-unix: kdb_check

kdc.conf: Makefile
Expand Down Expand Up @@ -184,7 +191,7 @@ check-pytests: unlockiter s4u2self
clean:
$(RM) adata etinfo forward gcred hist hooks hrealm icinterleave icred
$(RM) kdbtest localauth plugorder rdreq replay responder s2p s4u2proxy
$(RM) unlockiter s4u2self
$(RM) s4u2self t_inetd unlockiter
$(RM) krb5.conf kdc.conf
$(RM) -rf kdc_realm/sandbox ldap
$(RM) au.log
11 changes: 3 additions & 8 deletions src/tests/dejagnu/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ BUILDTOP=$(REL)..$(S)..
RUNTEST = @RUNTEST@ $(DEJAFLAGS)
RUNTESTFLAGS =

SRCS=$(srcdir)/t_inetd.c

all: t_inetd
all:

install:

Expand All @@ -19,14 +17,11 @@ check-runtest-no:
@echo 'Skipped dejagnu tests: runtest not found' >> $(SKIPTESTS)

# Set VALGRIND at run time, that may be changed when running 'make'.
check-runtest-yes: t_inetd site.exp
check-runtest-yes: site.exp
$(RUNTEST) --tool krb VALGRIND="$(VALGRIND)" $(RUNTESTFLAGS)

t_inetd: t_inetd.o $(KRB5_BASE_DEPLIBS)
$(CC_LINK) -o t_inetd t_inetd.o $(KRB5_BASE_LIBS)

clean:
$(RM) t_inetd t_inetd.o site.exp runenv.vars runenv.vals
$(RM) site.exp runenv.vars runenv.vals

clean-unix::
$(RM) -rf tmpdir dbg.log krb.log krb.sum
Expand Down
4 changes: 2 additions & 2 deletions src/tests/dejagnu/config/default.exp
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ foreach i {
{KTUTIL $objdir/../../kadmin/ktutil/ktutil}
{KLIST $objdir/../../clients/klist/klist}
{KDESTROY $objdir/../../clients/kdestroy/kdestroy}
{T_INETD $objdir/t_inetd}
{T_INETD $objdir/../t_inetd}
{KPROPLOG $objdir/../../kprop/kproplog}
{KPASSWD $objdir/../../clients/kpasswd/kpasswd}
{KPROPD $objdir/../../kprop/kpropd}
Expand Down Expand Up @@ -735,7 +735,7 @@ proc setup_krb5_conf { {type client} } {
global srcdir
global env

set pkinit_certs [findfile "[pwd]/$srcdir/pkinit-certs" "[pwd]/$srcdir/pkinit-certs" "$srcdir/pkinit-certs"]
set pkinit_certs [findfile "[pwd]/$srcdir/../pkinit-certs" "$srcdir/../pkinit-certs"]
# Create a krb5.conf file.
if { ![file exists $tmppwd/krb5.$type.conf] \
|| $last_passname_conf != $multipass_name } {
Expand Down
6 changes: 1 addition & 5 deletions src/tests/dejagnu/deps
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
#
# Generated makefile dependencies follow.
#
$(OUTPRE)t_inetd.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
$(COM_ERR_DEPS) t_inetd.c
# No dependencies here.
2 changes: 2 additions & 0 deletions src/tests/deps
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ $(OUTPRE)s4u2proxy.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
$(top_srcdir)/include/krb5.h $(top_srcdir)/include/krb5/authdata_plugin.h \
$(top_srcdir)/include/krb5/plugin.h $(top_srcdir)/include/port-sockets.h \
$(top_srcdir)/include/socket-utils.h s4u2proxy.c
$(OUTPRE)t_inetd.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
$(COM_ERR_DEPS) t_inetd.c
$(OUTPRE)unlockiter.$(OBJEXT): $(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 \
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/tests/t_authdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
skipped('anonymous ticket authdata tests', 'PKINIT not built')
else:
# Set up a realm with PKINIT support and get anonymous tickets.
certs = os.path.join(srctop, 'tests', 'dejagnu', 'pkinit-certs')
certs = os.path.join(srctop, 'tests', 'pkinit-certs')
ca_pem = os.path.join(certs, 'ca.pem')
kdc_pem = os.path.join(certs, 'kdc.pem')
privkey_pem = os.path.join(certs, 'privkey.pem')
Expand Down
2 changes: 1 addition & 1 deletion src/tests/t_certauth.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
if not os.path.exists(os.path.join(plugins, 'preauth', 'pkinit.so')):
skip_rest('certauth tests', 'PKINIT module not built')

certs = os.path.join(srctop, 'tests', 'dejagnu', 'pkinit-certs')
certs = os.path.join(srctop, 'tests', 'pkinit-certs')
ca_pem = os.path.join(certs, 'ca.pem')
kdc_pem = os.path.join(certs, 'kdc.pem')
privkey_pem = os.path.join(certs, 'privkey.pem')
Expand Down
2 changes: 1 addition & 1 deletion src/tests/dejagnu/t_inetd.c → src/tests/t_inetd.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/* tests/dejagnu/t_inetd.c */
/* tests/t_inetd.c */
/*
* Copyright 1991 by the Massachusetts Institute of Technology.
* All Rights Reserved.
Expand Down
2 changes: 1 addition & 1 deletion src/tests/t_pkinit.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
soft_pkcs11 = os.path.join(buildtop, 'tests', 'softpkcs11', 'softpkcs11.so')

# Construct a krb5.conf fragment configuring pkinit.
certs = os.path.join(srctop, 'tests', 'dejagnu', 'pkinit-certs')
certs = os.path.join(srctop, 'tests', 'pkinit-certs')
ca_pem = os.path.join(certs, 'ca.pem')
kdc_pem = os.path.join(certs, 'kdc.pem')
user_pem = os.path.join(certs, 'user.pem')
Expand Down
18 changes: 7 additions & 11 deletions src/tests/t_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,13 @@

# Construct a krb5.conf fragment configuring the client to use a local proxy
# server.
proxysubjectpem = os.path.join(srctop, 'tests', 'dejagnu', 'proxy-certs',
'proxy-subject.pem')
proxysanpem = os.path.join(srctop, 'tests', 'dejagnu', 'proxy-certs',
'proxy-san.pem')
proxyidealpem = os.path.join(srctop, 'tests', 'dejagnu', 'proxy-certs',
'proxy-ideal.pem')
proxywrongpem = os.path.join(srctop, 'tests', 'dejagnu', 'proxy-certs',
'proxy-no-match.pem')
proxybadpem = os.path.join(srctop, 'tests', 'dejagnu', 'proxy-certs',
'proxy-badsig.pem')
proxyca = os.path.join(srctop, 'tests', 'dejagnu', 'proxy-certs', 'ca.pem')
proxycerts = os.path.join(srctop, 'tests', 'proxy-certs')
proxysubjectpem = os.path.join(proxycerts, 'proxy-subject.pem')
proxysanpem = os.path.join(proxycerts, 'proxy-san.pem')
proxyidealpem = os.path.join(proxycerts, 'proxy-ideal.pem')
proxywrongpem = os.path.join(proxycerts, 'proxy-no-match.pem')
proxybadpem = os.path.join(proxycerts, 'proxy-badsig.pem')
proxyca = os.path.join(proxycerts, 'ca.pem')
proxyurl = 'https://localhost:$port5/KdcProxy'
proxyurlupcase = 'https://LocalHost:$port5/KdcProxy'
proxyurl4 = 'https://127.0.0.1:$port5/KdcProxy'
Expand Down
2 changes: 1 addition & 1 deletion src/util/k5test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1397,7 +1397,7 @@ def cross_realms(num, xtgts=None, args=None, **keywords):
kvno = os.path.join(buildtop, 'clients', 'kvno', 'kvno')
kdestroy = os.path.join(buildtop, 'clients', 'kdestroy', 'kdestroy')
kpasswd = os.path.join(buildtop, 'clients', 'kpasswd', 'kpasswd')
t_inetd = os.path.join(buildtop, 'tests', 'dejagnu', 't_inetd')
t_inetd = os.path.join(buildtop, 'tests', 't_inetd')
kproplog = os.path.join(buildtop, 'kprop', 'kproplog')
kpropd = os.path.join(buildtop, 'kprop', 'kpropd')
kprop = os.path.join(buildtop, 'kprop', 'kprop')

0 comments on commit 7e83975

Please sign in to comment.