6 #include <afs/cellconfig.h>
9 #include <tests/tap/basic.h>
13 * Check if the current machine's hostname resolves to the loopback
17 afstest_IsLoopbackNetworkDefault(void)
19 char hostname
[MAXHOSTCHARS
];
23 gethostname(hostname
, sizeof(hostname
));
24 host
= gethostbyname(hostname
);
26 skip_all("Can't resolve hostname %s\n", hostname
);
28 memcpy(&addr
, host
->h_addr
, sizeof(addr
));
30 return(rx_IsLoopbackAddr(ntohl(addr
)));
34 * Skips all TAP tests if the current machine's hostname resolves to the
38 afstest_SkipTestsIfLoopbackNetIsDefault(void)
42 retval
= afstest_IsLoopbackNetworkDefault();
44 skip_all("Default IP address is on the loopback network!\n");
50 * Skips all TAP tests if the current machine's hostname can't be resolved
54 afstest_SkipTestsIfBadHostname(void)
56 char hostname
[MAXHOSTCHARS
];
59 gethostname(hostname
, sizeof(hostname
));
60 host
= gethostbyname(hostname
);
62 skip_all("Can't resolve hostname %s\n", hostname
);