summaryrefslogtreecommitdiffstats
path: root/src/tests/dejagnu/config
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@mit.edu>2004-03-15 01:36:42 +0000
committerKen Raeburn <raeburn@mit.edu>2004-03-15 01:36:42 +0000
commitb2eabc20132bb87f37018d8d51c4eebf009a8b7a (patch)
tree611be2c9cf003d98694ad52c3a767102c3cefc75 /src/tests/dejagnu/config
parent40021e247c821aba8a694614e22bf5c181d78284 (diff)
Set new variable portbase to supplied $PORTBASE or a default.
Use it to compute all port numbers. This should help reduce conflicts between multiple simultaneous test runs, if they supply different $PORTBASE values. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16169 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/tests/dejagnu/config')
-rw-r--r--src/tests/dejagnu/config/ChangeLog7
-rw-r--r--src/tests/dejagnu/config/default.exp45
2 files changed, 37 insertions, 15 deletions
diff --git a/src/tests/dejagnu/config/ChangeLog b/src/tests/dejagnu/config/ChangeLog
index cc05f8e9a..7d28c9206 100644
--- a/src/tests/dejagnu/config/ChangeLog
+++ b/src/tests/dejagnu/config/ChangeLog
@@ -1,3 +1,10 @@
+2004-03-14 Ken Raeburn <raeburn@mit.edu>
+
+ * default.exp: Set new variable portbase from $PORTBASE or
+ default.
+ (setup_kerberos_files, setup_krb5_conf, setup_kerberos_env): Use
+ portbase to select all port numbers.
+
2004-02-25 Ken Raeburn <raeburn@mit.edu>
* default.exp (passes): Add "mode=udp" to existing pass
diff --git a/src/tests/dejagnu/config/default.exp b/src/tests/dejagnu/config/default.exp
index 7c145ab6f..47f8a14e7 100644
--- a/src/tests/dejagnu/config/default.exp
+++ b/src/tests/dejagnu/config/default.exp
@@ -758,6 +758,18 @@ proc modify_principal { name args } {
return 1
}
+# kdc listens on +0..+3, depending whether we're testing reachable or not
+# client tries +1 and +6
+# kadmind +4
+# kpasswd +5
+# krb524 +7
+# application servers (krlogind, telnetd, krshd, ftpd, etc) +8
+if [info exists PORTBASE] {
+ set portbase $PORTBASE
+} else {
+ set portbase 3085
+}
+
# setup_kerberos_files
# This procedure will create some Kerberos files which must be created
# manually before trying to run any Kerberos programs. Returns 1 on
@@ -774,6 +786,7 @@ proc setup_kerberos_files { } {
global multipass_name
global master_key_type
global mode
+ global portbase
if ![get_hostname] {
return 0
@@ -791,8 +804,8 @@ proc setup_kerberos_files { } {
}
set conffile [open $tmppwd/kdc.conf w]
puts $conffile "\[kdcdefaults\]"
- puts $conffile " kdc_ports = 3085,3086,3087,3088,3089"
- puts $conffile " kdc_tcp_ports = 3085,3086,3087,3088,3089"
+ puts $conffile " kdc_ports = $portbase,[expr 1 + $portbase],[expr 2 + $portbase]"
+ puts $conffile " kdc_tcp_ports = $portbase,[expr 1 + $portbase],[expr 2 + $portbase]"
puts $conffile ""
puts $conffile "\[realms\]"
puts $conffile " $REALMNAME = \{"
@@ -801,8 +814,8 @@ proc setup_kerberos_files { } {
puts $conffile " admin_database_lockfile = $tmppwd/adb.lock"
puts $conffile " key_stash_file = $tmppwd/stash"
puts $conffile " acl_file = $tmppwd/acl"
- puts $conffile " kadmind_port = 3750"
- puts $conffile " kpasswd_port = 3751"
+ puts $conffile " kadmind_port = [expr 4 + $portbase]"
+ puts $conffile " kpasswd_port = [expr 5 + $portbase]"
puts $conffile " max_life = 1:00:00"
puts $conffile " max_renewable_life = 3:00:00"
puts $conffile " master_key_type = $master_key_type"
@@ -810,11 +823,11 @@ proc setup_kerberos_files { } {
puts $conffile " supported_enctypes = $supported_enctypes"
puts $conffile " kdc_supported_enctypes = $kdc_supported_enctypes"
if { $mode == "tcp" } {
- puts $conffile " kdc_ports = 3081"
- puts $conffile " kdc_tcp_ports = 3088,3091"
+ puts $conffile " kdc_ports = [expr 3 + $portbase]"
+ puts $conffile " kdc_tcp_ports = [expr 1 + $portbase],[expr 3 + $portbase]"
} else {
- puts $conffile " kdc_ports = 3088"
- puts $conffile " kdc_tcp_ports = 3081"
+ puts $conffile " kdc_ports = [expr 1 + $portbase]"
+ puts $conffile " kdc_tcp_ports = [expr 3 + $portbase]"
}
puts $conffile " default_principal_expiration = 2037.12.31.23.59.59"
puts $conffile " default_principal_flags = -postdateable forwardable"
@@ -835,7 +848,7 @@ proc setup_kerberos_files { } {
if ![file exists $tmppwd/krb.conf] {
set conffile [open $tmppwd/krb.conf w]
puts $conffile "$REALMNAME"
- puts $conffile "$REALMNAME $hostname:3088 admin server"
+ puts $conffile "$REALMNAME $hostname:[expr 1 + $portbase] admin server"
close $conffile
}
@@ -869,6 +882,7 @@ proc setup_krb5_conf { {type client} } {
global default_tkt_enctypes
global permitted_enctypes
global mode
+ global portbase
# Create a krb5.conf file.
if { ![file exists $tmppwd/krb5.$type.conf] \
@@ -898,12 +912,12 @@ proc setup_krb5_conf { {type client} } {
puts $conffile "\[realms\]"
puts $conffile " $REALMNAME = \{"
# I hope nothing's listening on 15294...
- puts $conffile " kdc = $hostname:15294"
- puts $conffile " kdc = $hostname:3088"
- puts $conffile " admin_server = $hostname:3750"
- puts $conffile " kpasswd_server = $hostname:3751"
+ puts $conffile " kdc = $hostname:[expr 6 + $portbase]"
+ puts $conffile " kdc = $hostname:[expr 1 + $portbase]"
+ puts $conffile " admin_server = $hostname:[expr 4 + $portbase]"
+ puts $conffile " kpasswd_server = $hostname:[expr 5 + $portbase]"
puts $conffile " default_domain = $domain"
- puts $conffile " krb524_server = $hostname:3752"
+ puts $conffile " krb524_server = $hostname:[expr 7 + $portbase]"
puts $conffile " \}"
puts $conffile ""
puts $conffile "\[domain_realm\]"
@@ -956,6 +970,7 @@ proc setup_kerberos_env { {type client} } {
global tmppwd
global hostname
global krb5_init_vars
+ global portbase
# Set the environment variable KRB5_CONFIG to point to our krb5.conf file.
# All the Kerberos tools check KRB5_CONFIG.
@@ -977,7 +992,7 @@ proc setup_kerberos_env { {type client} } {
verbose "KRB5RCACHEDIR=$env(KRB5RCACHEDIR)"
# Tell the Kerberos tools how to contact the $REALMNAME server.
- set env(KERBEROS_SERVER) "$REALMNAME:$hostname:3088"
+ set env(KERBEROS_SERVER) "$REALMNAME:$hostname:[expr 1 + $portbase]"
verbose "KERBEROS_SERVER=$env(KERBEROS_SERVER)"
# Get the run time environment variables... (including LD_LIBRARY_PATH)