Skip to content

Commit

Permalink
Add regression test for LDAP key fencepost bug
Browse files Browse the repository at this point in the history
ticket: 7980
  • Loading branch information
greghudson committed Aug 7, 2014
1 parent 81c332e commit 0d78da2
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/tests/t_kdb.py
Expand Up @@ -297,6 +297,17 @@ def ldap_add(dn, objectclass, attrs=[]):
realm.kinit(realm.user_princ, flags=['-R', '-S', 'alias'])
realm.klist(realm.user_princ, 'alias@KRBTEST.COM')

# Regression test for #7980 (fencepost when dividing keys up by kvno).
realm.run_kadminl('addprinc -randkey -e aes256-cts,aes128-cts kvnoprinc')
realm.run_kadminl('cpw -randkey -keepold -e aes256-cts,aes128-cts kvnoprinc')
out = realm.run_kadminl('getprinc kvnoprinc')
if 'Number of keys: 4' not in out:
fail('After cpw -keepold, wrong number of keys')
realm.run_kadminl('cpw -randkey -keepold -e aes256-cts,aes128-cts kvnoprinc')
out = realm.run_kadminl('getprinc kvnoprinc')
if 'Number of keys: 6' not in out:
fail('After cpw -keepold, wrong number of keys')

realm.stop()

# Briefly test dump and load.
Expand Down

0 comments on commit 0d78da2

Please sign in to comment.