~ubuntu-branches/ubuntu/maverick/krb5/maverick

« back to all changes in this revision

Viewing changes to src/tests/dejagnu/krb-standalone/kadmin.exp

  • Committer: Bazaar Package Importer
  • Author(s): Sam Hartman
  • Date: 2009-05-07 16:16:34 UTC
  • mfrom: (13.1.7 sid)
  • Revision ID: james.westby@ubuntu.com-20090507161634-xqyk0s9na0le4flj
Tags: 1.7dfsg~beta1-4
When  decrypting the TGS response fails with the subkey, try with the
session key to work around Heimdal bug, Closes: #527353 

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
# This is a DejaGnu test script.
3
3
# This script tests Kerberos kadmin5 using kadmin.local as verification.
4
4
 
5
 
# Set up the kerberos database.
6
 
if {![get_hostname] \
7
 
    || ![setup_kerberos_files] \
8
 
    || ![setup_kerberos_env] \
9
 
    || ![setup_kerberos_db 0]} {
10
 
    return
11
 
}
12
 
 
13
 
# find kpasswd
14
 
if ![info exists KPASSWD] {
15
 
    set KPASSWD [findfile $objdir/../../clients/kpasswd/kpasswd]
16
 
}
17
 
 
18
 
# find kdestroy
19
 
if ![info exists KDESTROY] {
20
 
    set KDESTROY [findfile $objdir/../../clients/kdestroy/kdestroy]
21
 
}
22
 
 
23
5
#++
24
6
# kadmin_add    - Test add new v5 principal function of kadmin.
25
7
#
68
50
        # use kadmin.local to verify that a principal was created and that its
69
51
        # salt types are 0 (normal).
70
52
        #
 
53
        envstack_push
 
54
        setup_kerberos_env kdc
71
55
        spawn $KADMIN_LOCAL -r $REALMNAME
 
56
        envstack_pop
72
57
        expect_after {
73
58
            -i $spawn_id
74
59
            timeout {
169
154
        # use kadmin.local to verify that a principal was created and that its
170
155
        # salt types are 0 (normal).
171
156
        #
 
157
        envstack_push
 
158
        setup_kerberos_env kdc
172
159
        spawn $KADMIN_LOCAL -r $REALMNAME
 
160
        envstack_pop
173
161
        expect_after {
174
162
             -i $spawn_id
175
163
            timeout {
395
383
    global KEY
396
384
    global spawn_id
397
385
 
398
 
    spawn $KADMIN -p krbtest/admin@$REALMNAME -q "get_principals *"
 
386
    # "*" would match everything
 
387
    # "*n" should match a few like kadmin/admin but see ticket 5667
 
388
    spawn $KADMIN -p krbtest/admin@$REALMNAME -q "get_principals *n"
399
389
    expect_after {
400
390
        "Cannot contact any KDC" {
401
391
            fail "kadmin ldb lost KDC"
568
558
        #
569
559
        # use kadmin.local to verify that the old principal is not present.
570
560
        #
 
561
        envstack_push
 
562
        setup_kerberos_env kdc
571
563
        spawn $KADMIN_LOCAL -r $REALMNAME
 
564
        envstack_pop
572
565
        expect_after {
573
566
            -i $spawn_id
574
567
            timeout {
692
685
    #
693
686
    # use kadmin.local to verify that a policy was created
694
687
    #
 
688
    envstack_push
 
689
    setup_kerberos_env kdc
695
690
    spawn $KADMIN_LOCAL -r $REALMNAME
 
691
    envstack_pop
696
692
    expect_after {
697
693
        -i $spawn_id
698
694
        timeout {
775
771
    #
776
772
    # use kadmin.local to verify that the old policy is not present.
777
773
    #
 
774
    envstack_push
 
775
    setup_kerberos_env kdc
778
776
    spawn $KADMIN_LOCAL -r $REALMNAME
 
777
    envstack_pop
779
778
    expect_after {
780
779
        -i $spawn_id
781
780
        timeout {
1062
1061
    verbose "kadmin_test succeeded"
1063
1062
}
1064
1063
 
1065
 
# Run the test.
1066
 
set status [catch kadmin_test msg]
1067
 
 
1068
 
# Shut down the kerberos daemons and the rsh daemon.
1069
 
stop_kerberos_daemons
1070
 
 
1071
 
if { $status != 0 } {
1072
 
    send_error "ERROR: error in kadmin.exp\n"
1073
 
    send_error "$msg\n"
1074
 
    exit 1
 
1064
run_once kadmin {
 
1065
    # Set up the kerberos database.
 
1066
    if {![get_hostname] \
 
1067
            || ![setup_kerberos_files] \
 
1068
            || ![setup_kerberos_env] \
 
1069
            || ![setup_kerberos_db 0]} {
 
1070
        return
 
1071
    }
 
1072
 
 
1073
    # Run the test.
 
1074
    set status [catch kadmin_test msg]
 
1075
 
 
1076
    # Shut down the kerberos daemons and the rsh daemon.
 
1077
    stop_kerberos_daemons
 
1078
 
 
1079
    if { $status != 0 } {
 
1080
        send_error "ERROR: error in kadmin.exp\n"
 
1081
        send_error "$msg\n"
 
1082
        exit 1
 
1083
    }
1075
1084
}