Skip to content

Commit

Permalink
Rename two test programs for consistency
Browse files Browse the repository at this point in the history
In src/tests, rename t_init_creds.c and t_localauth.c to icred.c and
localauth.c for consistency with the other C test programs in that
directory.
  • Loading branch information
greghudson committed Nov 13, 2015
1 parent bee2d86 commit 20c3f64
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 29 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -254,16 +254,16 @@ testlog
/src/tests/gcred
/src/tests/hist
/src/tests/hrealm
/src/tests/icred
/src/tests/kdbtest
/src/tests/kdc.conf
/src/tests/krb5.conf
/src/tests/localauth
/src/tests/plugorder
/src/tests/rdreq
/src/tests/responder
/src/tests/s2p
/src/tests/s4u2proxy
/src/tests/t_init_creds
/src/tests/t_localauth

/src/tests/asn.1/expected_encode.out
/src/tests/asn.1/expected_trval.out
Expand Down
29 changes: 14 additions & 15 deletions src/tests/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ SUBDIRS = resolve asn.1 create hammer verify gssapi dejagnu shlib \
RUN_DB_TEST = $(RUN_SETUP) KRB5_KDC_PROFILE=kdc.conf KRB5_CONFIG=krb5.conf \
LC_ALL=C $(VALGRIND)

OBJS= adata.o etinfo.o gcred.o hist.o hrealm.o kdbtest.o plugorder.o \
t_init_creds.o t_localauth.o rdreq.o responder.o s2p.o s4u2proxy.o
EXTRADEPSRCS= adata.c etinfo.c gcred.c hist.c hrealm.c kdbtest.c plugorder.c \
t_init_creds.c t_localauth.c rdreq.o responder.c s2p.c s4u2proxy.c
OBJS= adata.o etinfo.o gcred.o hist.o hrealm.o icred.o kdbtest.o localauth.o \
plugorder.o rdreq.o responder.o s2p.o s4u2proxy.o
EXTRADEPSRCS= adata.c etinfo.c gcred.c hist.c hrealm.c icred.c kdbtest.c \
localauth.c plugorder.c rdreq.o responder.c s2p.c s4u2proxy.c

TEST_DB = ./testdb
TEST_REALM = FOO.TEST.REALM
Expand All @@ -36,10 +36,16 @@ hist: hist.o $(KDB5_DEPLIBS) $(KADMSRV_DEPLIBS) $(KRB5_BASE_DEPLIBS)
hrealm: hrealm.o $(KRB5_BASE_DEPLIBS)
$(CC_LINK) -o $@ hrealm.o $(KRB5_BASE_LIBS)

icred: icred.o $(KRB5_BASE_DEPLIBS)
$(CC_LINK) -o $@ icred.o $(KRB5_BASE_LIBS)

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

localauth: localauth.o $(KRB5_BASE_DEPLIBS)
$(CC_LINK) -o $@ localauth.o $(KRB5_BASE_LIBS)

plugorder: plugorder.o $(KRB5_BASE_DEPLIBS)
$(CC_LINK) -o $@ plugorder.o $(KRB5_BASE_LIBS)

Expand All @@ -55,12 +61,6 @@ s2p: s2p.o $(KRB5_BASE_DEPLIBS)
s4u2proxy: s4u2proxy.o $(KRB5_BASE_DEPLIBS)
$(CC_LINK) -o $@ s4u2proxy.o $(KRB5_BASE_LIBS)

t_init_creds: t_init_creds.o $(KRB5_BASE_DEPLIBS)
$(CC_LINK) -o $@ t_init_creds.o $(KRB5_BASE_LIBS)

t_localauth: t_localauth.o $(KRB5_BASE_DEPLIBS)
$(CC_LINK) -o $@ t_localauth.o $(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)
Expand Down Expand Up @@ -107,8 +107,8 @@ kdb_check: kdc.conf krb5.conf
$(RUN_DB_TEST) ../kadmin/dbutil/kdb5_util $(KADMIN_OPTS) destroy -f
$(RM) $(TEST_DB)* stash_file

check-pytests:: adata etinfo gcred hist hrealm kdbtest plugorder rdreq
check-pytests:: responder s2p s4u2proxy t_init_creds t_localauth unlockiter
check-pytests:: adata etinfo gcred hist hrealm icred kdbtest localauth
check-pytests:: plugorder rdreq responder s2p s4u2proxy unlockiter
$(RUNPYTEST) $(srcdir)/t_general.py $(PYTESTFLAGS)
$(RUNPYTEST) $(srcdir)/t_dump.py $(PYTESTFLAGS)
$(RUNPYTEST) $(srcdir)/t_iprop.py $(PYTESTFLAGS)
Expand Down Expand Up @@ -159,8 +159,7 @@ check-pytests:: responder s2p s4u2proxy t_init_creds t_localauth unlockiter
$(RUNPYTEST) $(srcdir)/t_tabdump.py $(PYTESTFLAGS)

clean::
$(RM) gcred hist hrealm kdbtest plugorder rdreq responder s2p
$(RM) adata etinfo gcred hist hrealm kdbtest plugorder rdreq responder
$(RM) s2p s4u2proxy t_init_creds t_localauth krb5.conf kdc.conf
$(RM) adata etinfo gcred hist hrealm icred kdbtest localauth plugorder
$(RM) rdreq responder s2p s4u2proxy krb5.conf kdc.conf
$(RM) -rf kdc_realm/sandbox ldap
$(RM) au.log
38 changes: 34 additions & 4 deletions src/tests/deps
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
#
# Generated makefile dependencies follow.
#
$(OUTPRE)adata.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
$(BUILDTOP)/include/krb5/krb5.h $(BUILDTOP)/include/osconf.h \
$(BUILDTOP)/include/profile.h $(COM_ERR_DEPS) $(top_srcdir)/include/k5-buf.h \
$(top_srcdir)/include/k5-err.h $(top_srcdir)/include/k5-gmt_mktime.h \
$(top_srcdir)/include/k5-int-pkinit.h $(top_srcdir)/include/k5-int.h \
$(top_srcdir)/include/k5-platform.h $(top_srcdir)/include/k5-plugin.h \
$(top_srcdir)/include/k5-thread.h $(top_srcdir)/include/k5-trace.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 adata.c
$(OUTPRE)etinfo.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
$(BUILDTOP)/include/krb5/krb5.h $(BUILDTOP)/include/osconf.h \
$(BUILDTOP)/include/profile.h $(COM_ERR_DEPS) $(top_srcdir)/include/k5-buf.h \
$(top_srcdir)/include/k5-err.h $(top_srcdir)/include/k5-gmt_mktime.h \
$(top_srcdir)/include/k5-int-pkinit.h $(top_srcdir)/include/k5-int.h \
$(top_srcdir)/include/k5-platform.h $(top_srcdir)/include/k5-plugin.h \
$(top_srcdir)/include/k5-thread.h $(top_srcdir)/include/k5-trace.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 etinfo.c
$(OUTPRE)gcred.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
$(BUILDTOP)/include/krb5/krb5.h $(BUILDTOP)/include/osconf.h \
$(BUILDTOP)/include/profile.h $(COM_ERR_DEPS) $(top_srcdir)/include/k5-buf.h \
Expand Down Expand Up @@ -40,6 +60,8 @@ $(OUTPRE)hrealm.$(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 hrealm.c
$(OUTPRE)icred.$(OBJEXT): $(BUILDTOP)/include/krb5/krb5.h \
$(COM_ERR_DEPS) $(top_srcdir)/include/krb5.h icred.c
$(OUTPRE)kdbtest.$(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 All @@ -50,6 +72,8 @@ $(OUTPRE)kdbtest.$(OBJEXT): $(BUILDTOP)/include/gssapi/gssapi.h \
$(top_srcdir)/include/gssrpc/svc.h $(top_srcdir)/include/gssrpc/svc_auth.h \
$(top_srcdir)/include/gssrpc/xdr.h $(top_srcdir)/include/kdb.h \
$(top_srcdir)/include/krb5.h kdbtest.c
$(OUTPRE)localauth.$(OBJEXT): $(BUILDTOP)/include/krb5/krb5.h \
$(COM_ERR_DEPS) $(top_srcdir)/include/krb5.h localauth.c
$(OUTPRE)plugorder.$(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 \
Expand All @@ -69,13 +93,19 @@ $(OUTPRE)plugorder.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
$(top_srcdir)/include/krb5/authdata_plugin.h $(top_srcdir)/include/krb5/plugin.h \
$(top_srcdir)/include/krb5/pwqual_plugin.h $(top_srcdir)/include/port-sockets.h \
$(top_srcdir)/include/socket-utils.h plugorder.c
$(OUTPRE)t_init_creds.$(OBJEXT): $(BUILDTOP)/include/krb5/krb5.h \
$(COM_ERR_DEPS) $(top_srcdir)/include/krb5.h t_init_creds.c
$(OUTPRE)t_localauth.$(OBJEXT): $(BUILDTOP)/include/krb5/krb5.h \
$(COM_ERR_DEPS) $(top_srcdir)/include/krb5.h t_localauth.c
$(OUTPRE)responder.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
$(BUILDTOP)/include/krb5/krb5.h $(COM_ERR_DEPS) $(top_srcdir)/include/k5-json.h \
$(top_srcdir)/include/k5-platform.h $(top_srcdir)/include/k5-thread.h \
$(top_srcdir)/include/krb5.h responder.c
$(OUTPRE)s2p.$(OBJEXT): $(BUILDTOP)/include/krb5/krb5.h \
$(COM_ERR_DEPS) $(top_srcdir)/include/krb5.h s2p.c
$(OUTPRE)s4u2proxy.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
$(BUILDTOP)/include/krb5/krb5.h $(BUILDTOP)/include/osconf.h \
$(BUILDTOP)/include/profile.h $(COM_ERR_DEPS) $(top_srcdir)/include/k5-buf.h \
$(top_srcdir)/include/k5-err.h $(top_srcdir)/include/k5-gmt_mktime.h \
$(top_srcdir)/include/k5-int-pkinit.h $(top_srcdir)/include/k5-int.h \
$(top_srcdir)/include/k5-platform.h $(top_srcdir)/include/k5-plugin.h \
$(top_srcdir)/include/k5-thread.h $(top_srcdir)/include/k5-trace.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
4 changes: 2 additions & 2 deletions src/tests/t_init_creds.c → src/tests/icred.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/t_init_creds.c - test harness for getting initial creds */
/* tests/icred.c - test harness for getting initial creds */
/*
* Copyright (C) 2013 by the Massachusetts Institute of Technology.
* All rights reserved.
Expand Down Expand Up @@ -62,7 +62,7 @@ main(int argc, char **argv)
krb5_creds creds;

if (argc != 3) {
fprintf(stderr, "Usage: t_init_creds princname password\n");
fprintf(stderr, "Usage: icred princname password\n");
exit(1);
}
princstr = argv[1];
Expand Down
4 changes: 2 additions & 2 deletions src/tests/t_localauth.c → src/tests/localauth.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/t_localauth.c - test harness for kuserok and aname_to_lname */
/* tests/localauth.c - test harness for kuserok and aname_to_lname */
/*
* Copyright (C) 2013 by the Massachusetts Institute of Technology.
* All rights reserved.
Expand Down Expand Up @@ -55,7 +55,7 @@ main(int argc, char **argv)
char buf[1024];

if (argc < 2 || argc > 3) {
fprintf(stderr, "Usage: t_localauth principal [localuser]\n");
fprintf(stderr, "Usage: localauth principal [localuser]\n");
return 1;
}
check(krb5_init_context(&ctx));
Expand Down
2 changes: 1 addition & 1 deletion src/tests/t_general.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
conf={'plugins': {'pwqual': {'disable': 'empty'}}}
realm = K5Realm(create_user=False, create_host=False, krb5_conf=conf)
realm.run([kadminl, 'addprinc', '-pw', '', 'user'])
realm.run(['./t_init_creds', 'user', ''])
realm.run(['./icred', 'user', ''])
realm.stop()

realm = K5Realm(create_host=False)
Expand Down
6 changes: 3 additions & 3 deletions src/tests/t_localauth.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@
realm = K5Realm(create_kdb=False, krb5_conf=conf)

def test_an2ln(env, aname, result, msg):
out = realm.run(['./t_localauth', aname], env=env)
out = realm.run(['./localauth', aname], env=env)
if out != result + '\n':
fail(msg)

def test_an2ln_err(env, aname, err, msg):
out = realm.run(['./t_localauth', aname], env=env, expected_code=1)
out = realm.run(['./localauth', aname], env=env, expected_code=1)
if err not in out:
fail(msg)

def test_userok(env, aname, lname, ok, msg):
out = realm.run(['./t_localauth', aname, lname], env=env)
out = realm.run(['./localauth', aname, lname], env=env)
if ((ok and out != 'yes\n') or
(not ok and out != 'no\n')):
fail(msg)
Expand Down

0 comments on commit 20c3f64

Please sign in to comment.