diff --git a/lib/krb5/test_plugin.c b/lib/krb5/test_plugin.c index 3c277af65..ed6a9e7f1 100644 --- a/lib/krb5/test_plugin.c +++ b/lib/krb5/test_plugin.c @@ -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);