svn rev #22215: branches/krb5-1-7/src/ clients/kvno/ tests/kdc_realm/ tests/kdc_realm/input_conf/
tlyu@MIT.EDU
tlyu at MIT.EDU
Tue Apr 14 15:53:59 EDT 2009
http://src.mit.edu/fisheye/changelog/krb5/?cs=22215
Commit By: tlyu
Log Message:
ticket: 6463
version_fixed: 1.7
subject: realm referral test cases forcing KRB5_NT_UNKNOWN
------------------------------------------------------------------------
r22072 | tsitkova | 2009-03-10 10:49:43 -0400 (Tue, 10 Mar 2009) | 2 lines
Changed paths:
A /trunk/src/tests/kdc_realm/input_conf/test_KDCs_1.conf
M /trunk/src/tests/kdc_realm/input_conf/test_setup.conf
M /trunk/src/tests/kdc_realm/kdcref.py
Added test for KRB5_NT_UNKNOWN princ type
------------------------------------------------------------------------
r22069 | tsitkova | 2009-03-09 10:21:20 -0400 (Mon, 09 Mar 2009) | 2 lines
Changed paths:
M /trunk/src/clients/kvno/kvno.c
Introduced '-u' option to kvno to enforce KRB5_NT_UNKNOWN princ type.
------------------------------------------------------------------------
Changed Files:
U branches/krb5-1-7/src/clients/kvno/kvno.c
A branches/krb5-1-7/src/tests/kdc_realm/input_conf/test_KDCs_1.conf
U branches/krb5-1-7/src/tests/kdc_realm/input_conf/test_setup.conf
U branches/krb5-1-7/src/tests/kdc_realm/kdcref.py
Modified: branches/krb5-1-7/src/clients/kvno/kvno.c
===================================================================
--- branches/krb5-1-7/src/clients/kvno/kvno.c 2009-04-14 19:53:56 UTC (rev 22214)
+++ branches/krb5-1-7/src/clients/kvno/kvno.c 2009-04-14 19:53:59 UTC (rev 22215)
@@ -39,7 +39,7 @@
static void xusage()
{
- fprintf(stderr, "usage: %s [-C] [-c ccache] [-e etype] [-k keytab] [-S sname] service1 service2 ...\n",
+ fprintf(stderr, "usage: %s [-C] [-u] [-c ccache] [-e etype] [-k keytab] [-S sname] service1 service2 ...\n",
prog);
exit(1);
}
@@ -48,7 +48,7 @@
static void do_v5_kvno (int argc, char *argv[],
char *ccachestr, char *etypestr, char *keytab_name,
- char *sname, int canon);
+ char *sname, int canon, int unknown);
#include <com_err.h>
static void extended_com_err_fn (const char *, errcode_t, const char *,
@@ -59,7 +59,7 @@
int option;
char *etypestr = NULL, *ccachestr = NULL, *keytab_name = NULL;
char *sname = NULL;
- int canon = 0;
+ int canon = 0, unknown = 0;
set_com_err_hook (extended_com_err_fn);
@@ -67,7 +67,7 @@
prog = strrchr(argv[0], '/');
prog = prog ? (prog + 1) : argv[0];
- while ((option = getopt(argc, argv, "Cc:e:hk:qS:")) != -1) {
+ while ((option = getopt(argc, argv, "uCc:e:hk:qS:")) != -1) {
switch (option) {
case 'C':
canon = 1;
@@ -89,7 +89,18 @@
break;
case 'S':
sname = optarg;
+ if (unknown == 1){
+ fprintf(stderr, "Options -u and -S are mutually exclusive\n");
+ xusage();
+ }
break;
+ case 'u':
+ unknown = 1;
+ if (sname){
+ fprintf(stderr, "Options -u and -S are mutually exclusive\n");
+ xusage();
+ }
+ break;
default:
xusage();
break;
@@ -100,7 +111,7 @@
xusage();
do_v5_kvno(argc - optind, argv + optind,
- ccachestr, etypestr, keytab_name, sname, canon);
+ ccachestr, etypestr, keytab_name, sname, canon, unknown);
return 0;
}
@@ -119,7 +130,7 @@
static void do_v5_kvno (int count, char *names[],
char * ccachestr, char *etypestr, char *keytab_name,
- char *sname, int canon)
+ char *sname, int canon, int unknown)
{
krb5_error_code ret;
int i, errors;
@@ -190,6 +201,9 @@
errors++;
continue;
}
+ if (unknown == 1) {
+ krb5_princ_type(context, in_creds.server) = KRB5_NT_UNKNOWN;
+ }
ret = krb5_unparse_name(context, in_creds.server, &princ);
if (ret) {
Added: branches/krb5-1-7/src/tests/kdc_realm/input_conf/test_KDCs_1.conf
===================================================================
--- branches/krb5-1-7/src/tests/kdc_realm/input_conf/test_KDCs_1.conf 2009-04-14 19:53:56 UTC (rev 22214)
+++ branches/krb5-1-7/src/tests/kdc_realm/input_conf/test_KDCs_1.conf 2009-04-14 19:53:59 UTC (rev 22215)
@@ -0,0 +1,9 @@
+krb5_priKDC_template.conf,0
+krb5_priKDC_1_template.conf,1
+krb5_priKDC_2_template.conf,0
+krb5_priKDC_3_template.conf,1
+krb5_priKDC_4_template.conf,1
+krb5_priKDC_5_template.conf,1
+krb5_priKDC_6_template.conf,1
+krb5_priKDC_7_template.conf,0
+krb5_priKDC_8_template.conf,1
Modified: branches/krb5-1-7/src/tests/kdc_realm/input_conf/test_setup.conf
===================================================================
--- branches/krb5-1-7/src/tests/kdc_realm/input_conf/test_setup.conf 2009-04-14 19:53:56 UTC (rev 22214)
+++ branches/krb5-1-7/src/tests/kdc_realm/input_conf/test_setup.conf 2009-04-14 19:53:59 UTC (rev 22215)
@@ -1,5 +1,6 @@
sandboxDir=tests/kdc_realm/sandbox
testKDCconf=test_KDCs.conf
+testKDCconf_1=test_KDCs_1.conf
principals=test_princs.conf
tier1=sandbox/tier1
-tier2=sandbox/tier2
\ No newline at end of file
+tier2=sandbox/tier2
Modified: branches/krb5-1-7/src/tests/kdc_realm/kdcref.py
===================================================================
--- branches/krb5-1-7/src/tests/kdc_realm/kdcref.py 2009-04-14 19:53:56 UTC (rev 22214)
+++ branches/krb5-1-7/src/tests/kdc_realm/kdcref.py 2009-04-14 19:53:59 UTC (rev 22215)
@@ -28,6 +28,7 @@
self._sandboxTier1 = '%s/%s' % (self._sandboxDir, 'tier1')
self._sandboxTier2 = '%s/%s' % (self._sandboxDir, 'tier2')
self._configurations = self._readServerConfiguration('%s/%s' % (self._confDir,confParams['testKDCconf']))
+ self._configurations_1 = self._readServerConfiguration('%s/%s' % (self._confDir,confParams['testKDCconf_1']))
self._principals = self._readTestInputs('%s/%s' % (self._confDir,confParams['principals']))
os.environ["LD_LIBRARY_PATH"] = '%s/lib' % self._buildDir
self._pidRefKDC = 0
@@ -94,7 +95,7 @@
raise LaunchError, err_msg
- def _launchClient(self, args, env):
+ def _launchClient(self, args, env, princType):
"""
kinit & kvno
"""
@@ -109,7 +110,11 @@
# testHost', 'mybox.mit.edu is a srv defined in referral KDC. Get its kvno
cmd = '%s/clients/kvno/kvno' % self._buildDir
- handle = Popen([cmd, '-C', '-S', 'testHost', 'mybox.mit.edu'],
+ if princType == 0:
+ handle = Popen([cmd, '-C', '-S', 'testHost', 'mybox.mit.edu'],
+ env = env, stdin=PIPE, stdout=PIPE, stderr=PIPE)
+ if princType == 1:
+ handle = Popen([cmd, '-C', '-u', 'testHost/mybox.mit.edu'],
env = env, stdin=PIPE, stdout=PIPE, stderr=PIPE)
(out, err) = handle.communicate()
handle.wait()
@@ -185,7 +190,7 @@
self._tier1Init = True
- def _launchTestingPair(self, srvParam,clntParam):
+ def _launchTestingPair(self, srvParam,clntParam, princType):
# launch KDC
server_env = os.environ.copy()
server_env["KRB5_KDC_PROFILE"] = '%s/kdc.conf' % self._sandboxTier2
@@ -198,9 +203,9 @@
'%s/%s' % (self._confDir,'kdc_pri_template.conf'),
self._vars)
if self._tier2Init == False:
- pid = self._createDB(server_env)
- self._crossRealm('Y.COM', 'Z.COM', server_env)
- self._tier2Init = True
+ pid = self._createDB(server_env)
+ self._crossRealm('Y.COM', 'Z.COM', server_env)
+ self._tier2Init = True
server = self._launchKDC( 2, server_args, server_env)
@@ -211,7 +216,7 @@
'%s/%s' % (self._confDir, 'krb5_priCL_template.conf'),
self._vars)
client_env["KRB5_KDC_PROFILE"] = server_env["KRB5_KDC_PROFILE"]
- rc = self._launchClient(clntParam, client_env)
+ rc = self._launchClient(clntParam, client_env, princType)
self._kill(server)
return rc
@@ -232,9 +237,15 @@
result = dict()
for princs in self._principals:
for conf in self._configurations:
- rc = self._launchTestingPair( conf['confName'], princs % self._vars)
+ rc = self._launchTestingPair( conf['confName'], princs % self._vars, 0)
result[conf['confName']] = {'expected':conf['expected'], 'actual':rc}
- print 'Test code for configuration %s principal %s: %s' % (conf, princs, rc)
+ print 'Test code for configuration %s principal %s type KRB5_NT_SRV_HST: %s' % (conf, princs, rc)
+ self.printTestResults(result)
+ for conf in self._configurations_1:
+ rc = self._launchTestingPair( conf['confName'], princs % self._vars, 1)
+ result[conf['confName']] = {'expected':conf['expected'], 'actual':rc}
+ print 'Test code for configuration %s principal %si type KRB5_NT_UNKNOWN: %s' % (conf, princs, rc)
+ self.printTestResults(result)
return result
@@ -317,7 +328,6 @@
test = Launcher(src_path)
result = test.run('main')
test.clean()
- test.printTestResults(result)
except:
if test is not None:
More information about the cvs-krb5
mailing list