svn rev #22009: branches/krb5-1-7/src/kadmin/ passwd/unit-test/kpasswd.0/ testing/scripts/

tlyu@MIT.EDU tlyu at MIT.EDU
Tue Feb 17 11:11:49 EST 2009


http://src.mit.edu/fisheye/changelog/krb5/?cs=22009
Commit By: tlyu
Log Message:
ticket: 6358
version_fixed: 1.7
status: resolved

pull up r21867, r21868 from trunk

 ------------------------------------------------------------------------
 r21868 | raeburn | 2009-02-02 15:37:41 -0500 (Mon, 02 Feb 2009) | 6 lines
 Changed paths:
    M /trunk/src/kadmin/passwd/unit-test/kpasswd.0/changing.exp
    M /trunk/src/kadmin/testing/scripts/init_db

 ticket: 6358

 Revise last change to better resemble the original test, keeping the
 min-lifetime test code collected together.  Change policy to have a
 minimum password lifetime of 10s instead of 30s, and reduce the test
 delays accordingly.
 ------------------------------------------------------------------------
 r21867 | raeburn | 2009-02-02 14:29:52 -0500 (Mon, 02 Feb 2009) | 10 lines
 Changed paths:
    M /trunk/src/kadmin/passwd/unit-test/kpasswd.0/changing.exp

 ticket: 6358
 subject: speed up kpasswd tests

 Reorder some tests and tune delays, so that we don't need to run for
 much more than twice the min-password-life interval when testing that
 functionality.  (This could be made faster if we can assume that
 init_db will always have been run immediately before the tests start.)

 In my tests, this cuts something like 11 seconds off the run time (now
 down to about 65 seconds).
 ------------------------------------------------------------------------


Changed Files:
U   branches/krb5-1-7/src/kadmin/passwd/unit-test/kpasswd.0/changing.exp
U   branches/krb5-1-7/src/kadmin/testing/scripts/init_db
Modified: branches/krb5-1-7/src/kadmin/passwd/unit-test/kpasswd.0/changing.exp
===================================================================
--- branches/krb5-1-7/src/kadmin/passwd/unit-test/kpasswd.0/changing.exp	2009-02-17 16:10:53 UTC (rev 22008)
+++ branches/krb5-1-7/src/kadmin/passwd/unit-test/kpasswd.0/changing.exp	2009-02-17 16:11:49 UTC (rev 22009)
@@ -12,6 +12,8 @@
 # Here are the tests
 #
 
+set pol2_time [timestamp]
+
 test_3pass {test2} {D.5: different new passwords} test2 test2 test2 foobar \
 	4 {New passwords do not match - password not changed.}
 
@@ -89,8 +91,13 @@
 test_win {pol1} {successful change} pol1 polBBBBBB polCCCCCC
 test_win {pol1} {successful change} pol1 polCCCCCC pol111111
 
-verbose "(sleeping 30 seconds)"
-catch "exec sleep 30"
+# Under "make check", init_db will just have been run and we could
+# jump right into the too-soon test.  But if someone is working with
+# the test suite manually, init_db may have been run a while ago.
+# So, force some known state, first.
+set delay [expr $pol2_time + 11 - [timestamp]]
+verbose "(sleeping $delay seconds so pol2 password can be changed)"
+sleep $delay
 
 test_win {pol2} {successful change} pol2 pol222222 polbbbbbb
 
@@ -98,8 +105,9 @@
 	polbbbbbb pol222222 pol222222 \
 	4 {Password cannot be changed because it was changed too recently.  Please wait until .*[12][0-9][0-9][0-9] before you change it.  If you need to change your password before then, contact your system security administrator.}
 
-verbose "(sleeping 30 seconds)"
-catch "exec sleep 30"
+# Now delay a little longer (if needed) and try changing pol2's
+# password again.
+verbose "(sleeping 10 seconds)"
+sleep 10
 
 test_win {pol2} {password min life passed} pol2 polbbbbbb pol222222
-

Modified: branches/krb5-1-7/src/kadmin/testing/scripts/init_db
===================================================================
--- branches/krb5-1-7/src/kadmin/testing/scripts/init_db	2009-02-17 16:10:53 UTC (rev 22008)
+++ branches/krb5-1-7/src/kadmin/testing/scripts/init_db	2009-02-17 16:11:49 UTC (rev 22009)
@@ -106,7 +106,7 @@
 
     {ovsec_kadm_create_policy $server_handle "test-pol 0 10000 8 2 3 0" \
 	    {OVSEC_KADM_POLICY OVSEC_KADM_PW_MIN_LENGTH OVSEC_KADM_PW_MIN_CLASSES OVSEC_KADM_PW_MAX_LIFE OVSEC_KADM_PW_HISTORY_NUM}}
-    {ovsec_kadm_create_policy $server_handle "once-a-min 30 0 0 0 0 0" \
+    {ovsec_kadm_create_policy $server_handle "once-a-min 10 0 0 0 0 0" \
 	    {OVSEC_KADM_POLICY OVSEC_KADM_PW_MIN_LIFE}}
     {ovsec_kadm_create_policy $server_handle "dict-only 0 0 0 0 0 0" \
 	    {OVSEC_KADM_POLICY}}




More information about the cvs-krb5 mailing list