krb5 commit: Rename two test programs for consistency

Greg Hudson ghudson at mit.edu
Fri Nov 13 15:57:46 EST 2015


https://github.com/krb5/krb5/commit/20c3f64f0bdab2c2b6ca5b5f7fe1682565e340b2
commit 20c3f64f0bdab2c2b6ca5b5f7fe1682565e340b2
Author: Greg Hudson <ghudson at mit.edu>
Date:   Tue Nov 10 11:54:07 2015 -0500

    Rename two test programs for consistency
    
    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.

 .gitignore               |    4 +-
 src/tests/Makefile.in    |   29 +++++++--------
 src/tests/deps           |   38 ++++++++++++++++++--
 src/tests/icred.c        |   88 ++++++++++++++++++++++++++++++++++++++++++++++
 src/tests/localauth.c    |   72 +++++++++++++++++++++++++++++++++++++
 src/tests/t_general.py   |    2 +-
 src/tests/t_init_creds.c |   88 ----------------------------------------------
 src/tests/t_localauth.c  |   72 -------------------------------------
 src/tests/t_localauth.py |    6 ++--
 9 files changed, 214 insertions(+), 185 deletions(-)

diff --git a/.gitignore b/.gitignore
index b453a84..3fd3b20 100644
--- a/.gitignore
+++ b/.gitignore
@@ -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
diff --git a/src/tests/Makefile.in b/src/tests/Makefile.in
index b24e197..4ab8e6e 100644
--- a/src/tests/Makefile.in
+++ b/src/tests/Makefile.in
@@ -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
@@ -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)
 
@@ -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)
@@ -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)
@@ -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
diff --git a/src/tests/deps b/src/tests/deps
index c00840e..d280026 100644
--- a/src/tests/deps
+++ b/src/tests/deps
@@ -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 \
@@ -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 \
@@ -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 \
@@ -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
diff --git a/src/tests/t_init_creds.c b/src/tests/icred.c
similarity index 95%
rename from src/tests/t_init_creds.c
rename to src/tests/icred.c
index 6be8340..071f91c 100644
--- a/src/tests/t_init_creds.c
+++ b/src/tests/icred.c
@@ -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.
@@ -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];
diff --git a/src/tests/t_localauth.c b/src/tests/localauth.c
similarity index 94%
rename from src/tests/t_localauth.c
rename to src/tests/localauth.c
index 3a65b5b..a3f7e15 100644
--- a/src/tests/t_localauth.c
+++ b/src/tests/localauth.c
@@ -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.
@@ -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));
diff --git a/src/tests/t_general.py b/src/tests/t_general.py
index c3629e6..fbdeddf 100755
--- a/src/tests/t_general.py
+++ b/src/tests/t_general.py
@@ -29,7 +29,7 @@ for realm in multipass_realms(create_host=False):
 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)
diff --git a/src/tests/t_localauth.py b/src/tests/t_localauth.py
index 1d498ed..4590485 100755
--- a/src/tests/t_localauth.py
+++ b/src/tests/t_localauth.py
@@ -9,17 +9,17 @@ conf = {'plugins': {'localauth': { 'disable': 'k5login'}}}
 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)


More information about the cvs-krb5 mailing list