$(LIB_rfc3961) $(LIB_roken) \
$(XLIBS)
-authcon-t: authcon-t.o ../common/config.o
- $(LT_LDRULE_static) authcon-t.o ../common/config.o \
+authcon-t: authcon-t.o ../common/config.o ../common/network.o
+ $(LT_LDRULE_static) authcon-t.o ../common/config.o ../common/network.o \
$(MODULE_LIBS)
superuser-t: superuser-t.o ../common/config.o ../common/rxkad.o \
- test.cs.o test.ss.o test.xdr.o
+ test.cs.o test.ss.o test.xdr.o ../common/network.o
$(LT_LDRULE_static) superuser-t.o ../common/config.o \
../common/rxkad.o ../common/servers.o \
- test.cs.o test.ss.o test.xdr.o \
+ test.cs.o test.ss.o test.xdr.o ../common/network.o \
$(MODULE_LIBS)
-keys-t: keys-t.o ../common/config.o
- $(LT_LDRULE_static) keys-t.o ../common/config.o $(MODULE_LIBS)
+keys-t: keys-t.o ../common/config.o ../common/network.o
+ $(LT_LDRULE_static) keys-t.o ../common/config.o ../common/network.o $(MODULE_LIBS)
-realms-t: realms-t.o ../common/config.o
- $(LT_LDRULE_static) realms-t.o ../common/config.o $(MODULE_LIBS)
+realms-t: realms-t.o ../common/config.o ../common/network.o
+ $(LT_LDRULE_static) realms-t.o ../common/config.o ../common/network.o $(MODULE_LIBS)
writekeyfile: writekeyfile.o
$(LT_LDRULE_static) writekeyfile.o $(MODULE_LIBS)
struct afsconf_typedKey *key;
int code = 0;
+ afstest_SkipTestsIfBadHostname();
+
plan(9);
dirname = afstest_BuildTestConfig();
int code;
int i;
+ afstest_SkipTestsIfBadHostname();
+
plan(134);
/* Create a temporary afs configuration directory */
int
main(int argc, char **argv)
{
+ afstest_SkipTestsIfBadHostname();
+
plan(113);
test_edges();
int code;
int ret = 0;
+ afstest_SkipTestsIfBadHostname();
+
/* Start the client and the server if requested */
if (argc == 3 ) {
/* network.c */
extern int afstest_IsLoopbackNetworkDefault(void);
extern int afstest_SkipTestsIfLoopbackNetIsDefault(void);
+extern void afstest_SkipTestsIfBadHostname(void);
#include <hcrypto/des.h>
+#include <tests/tap/basic.h>
#include "common.h"
static FILE *
gethostname(hostname, sizeof(hostname));
host = gethostbyname(hostname);
+ if (!host) {
+ skip_all("Can't resolve hostname %s\n", hostname);
+ }
memcpy(&addr, host->h_addr, sizeof(addr));
return(rx_IsLoopbackAddr(ntohl(addr)));
}
return retval;
}
+
+/*!
+ * Skips all TAP tests if the current machine's hostname can't be resolved
+ * to any IP address.
+ */
+void
+afstest_SkipTestsIfBadHostname(void)
+{
+ char hostname[MAXHOSTCHARS];
+ struct hostent *host;
+
+ gethostname(hostname, sizeof(hostname));
+ host = gethostbyname(hostname);
+ if (!host)
+ skip_all("Can't resolve hostname %s\n", hostname);
+}
struct ubik_client *ubikClient = NULL;
int ret = 0;
- plan(6);
-
+ /* Skip all tests if the current hostname can't be resolved */
+ afstest_SkipTestsIfBadHostname();
/* Skip all tests if the current hostname is on the loopback network */
afstest_SkipTestsIfLoopbackNetIsDefault();
+ plan(6);
+
code = rx_Init(0);
dirname = afstest_BuildTestConfig();