Fix lib/krb5/test_plugin.c test
The resolver plugin doesn't have a way to say "and stop here", so the lookup done in lib/krb5/test_plugin.c can produce more results than used to be expected, and indeed nowadays it does. The fix is to ensure that we have the desired results and ignore the others.
This commit is contained in:
@@ -114,11 +114,13 @@ main(int argc, char **argv)
|
||||
|
||||
while(krb5_krbhst_next_as_string(context, handle, host, sizeof(host)) == 0){
|
||||
found++;
|
||||
if (strcmp(host, "127.0.0.2") != 0 && strcmp(host, "tcp/127.0.0.2") != 0)
|
||||
if (!found && strcmp(host, "127.0.0.2") != 0 && strcmp(host, "tcp/127.0.0.2") != 0)
|
||||
krb5_errx(context, 1, "wrong address: %s", host);
|
||||
}
|
||||
if (!found)
|
||||
krb5_errx(context, 1, "failed to find host");
|
||||
if (found < 2)
|
||||
krb5_errx(context, 1, "did not get the two expected results");
|
||||
|
||||
krb5_krbhst_free(context, handle);
|
||||
|
||||
|
Reference in New Issue
Block a user