From: Russ Allbery Date: Thu, 12 Dec 2013 06:01:49 +0000 (-0800) Subject: Rename the class test set to letter X-Git-Tag: release/2.2~16 X-Git-Url: https://git.eyrie.org/?a=commitdiff_plain;h=6e2bed2d7ca57737db3a2c2f54be270aa1b54e97;p=kerberos%2Fkrb5-strength.git Rename the class test set to letter Next is to add support for full character class rules, which will reuse a similar name, so move the simplistic character class rules to the name letter.json. --- diff --git a/tests/data/passwords/class.json b/tests/data/passwords/letter.json similarity index 100% rename from tests/data/passwords/class.json rename to tests/data/passwords/letter.json diff --git a/tests/plugin/heimdal-t.c b/tests/plugin/heimdal-t.c index 903fed9..95deac9 100644 --- a/tests/plugin/heimdal-t.c +++ b/tests/plugin/heimdal-t.c @@ -29,9 +29,9 @@ * named cdb_tests, cracklib_tests, and principal_tests. */ #include -#include #include #include +#include #include @@ -148,8 +148,8 @@ main(void) */ count = ARRAY_SIZE(cracklib_tests); count += ARRAY_SIZE(cdb_tests); - count += ARRAY_SIZE(class_tests); count += ARRAY_SIZE(length_tests); + count += ARRAY_SIZE(letter_tests); count += ARRAY_SIZE(principal_tests) * 2; plan(5 + count * 2); @@ -186,7 +186,7 @@ main(void) for (i = 0; i < ARRAY_SIZE(principal_tests); i++) is_password_test(verifier, &principal_tests[i]); - /* Add character class restrictions. */ + /* Add simple character class restrictions. */ setup_argv[5] = (char *) "require_ascii_printable"; setup_argv[6] = (char *) "true"; setup_argv[7] = (char *) "require_non_letter"; @@ -194,9 +194,9 @@ main(void) setup_argv[9] = NULL; run_setup((const char **) setup_argv); - /* Run the character class tests. */ - for (i = 0; i < ARRAY_SIZE(class_tests); i++) - is_password_test(verifier, &class_tests[i]); + /* Run the simple character class tests. */ + for (i = 0; i < ARRAY_SIZE(letter_tests); i++) + is_password_test(verifier, &letter_tests[i]); /* * Add length restrictions and remove the dictionary. This should only do diff --git a/tests/plugin/mit-t.c b/tests/plugin/mit-t.c index 3f96284..7e5a268 100644 --- a/tests/plugin/mit-t.c +++ b/tests/plugin/mit-t.c @@ -30,9 +30,9 @@ * named cdb_tests, cracklib_tests, and principal_tests. */ #include -#include #include #include +#include #include @@ -166,8 +166,8 @@ main(void) */ count = 2 * ARRAY_SIZE(cracklib_tests); count += ARRAY_SIZE(cdb_tests); - count += ARRAY_SIZE(class_tests); count += ARRAY_SIZE(length_tests); + count += ARRAY_SIZE(letter_tests); count += 2 * ARRAY_SIZE(principal_tests); plan(2 + 5 + count * 2); @@ -239,7 +239,7 @@ main(void) is_password_test(ctx, vtable, data, &cracklib_tests[i]); vtable->close(ctx, data); - /* Add character class configuration to krb5.conf. */ + /* Add simple character class configuration to krb5.conf. */ setup_argv[5] = (char *) "require_ascii_printable"; setup_argv[6] = (char *) "true"; setup_argv[7] = (char *) "require_non_letter"; @@ -253,13 +253,13 @@ main(void) if (code != 0) bail_krb5(ctx, code, "cannot initialize Kerberos context"); - /* Run all the character class tests. */ + /* Run all the simple character class tests. */ code = vtable->open(ctx, NULL, &data); - is_int(0, code, "Plugin initialization (character class)"); + is_int(0, code, "Plugin initialization (simple character class)"); if (code != 0) bail("cannot continue after plugin initialization failure"); - for (i = 0; i < ARRAY_SIZE(class_tests); i++) - is_password_test(ctx, vtable, data, &class_tests[i]); + for (i = 0; i < ARRAY_SIZE(letter_tests); i++) + is_password_test(ctx, vtable, data, &letter_tests[i]); vtable->close(ctx, data); /* diff --git a/tests/tools/heimdal-strength-t b/tests/tools/heimdal-strength-t index 9c2d163..918b884 100755 --- a/tests/tools/heimdal-strength-t +++ b/tests/tools/heimdal-strength-t @@ -149,7 +149,7 @@ sub load_password_tests { # Load the password tests from JSON. Accumulate a total count of tests for # the testing plan. my (%tests, $count); -for my $type (qw(cdb class cracklib length principal)) { +for my $type (qw(cdb cracklib length letter principal)) { my $tests = load_password_tests("$type.json"); $tests{$type} = $tests; $count += scalar(@{$tests}); @@ -188,7 +188,7 @@ for my $test (@{ $tests{length} }) { check_password($test); } -# Install the krb5.conf file for character class restrictions. +# Install the krb5.conf file for simple character class restrictions. $krb5_conf = create_krb5_conf( { require_ascii_printable => 'true', @@ -198,8 +198,8 @@ $krb5_conf = create_krb5_conf( local $ENV{KRB5_CONFIG} = $krb5_conf; # Run the character class tests. -note('Password character class checks'); -for my $test (@{ $tests{class} }) { +note('Simple password character class checks'); +for my $test (@{ $tests{letter} }) { check_password($test); }