From: Simon Wilkinson Date: Sun, 30 Jan 2011 20:54:30 +0000 (+0000) Subject: tests: Fix auth/superuser-t.c to work on Linux X-Git-Tag: upstream/1.8.0_pre1^2~4221 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=66bd7cf95ead1c27d81a25f4ca75b49ec173c136;p=packages%2Fo%2Fopenafs.git tests: Fix auth/superuser-t.c to work on Linux Fix the superuser tests so that they can be run on Linux. This requires explicitly including sys/wait.h so we can use waitpid, and changing some initialisation ordering so that we initialise the RX library before we try and fake an rxkad token. Change-Id: I8439ff6211a50c749ea22819e2d836409a64d2ad Reviewed-on: http://gerrit.openafs.org/3776 Tested-by: BuildBot Reviewed-by: Derrick Brashear --- diff --git a/tests/auth/superuser-t.c b/tests/auth/superuser-t.c index 6cbc59692..339d19042 100644 --- a/tests/auth/superuser-t.c +++ b/tests/auth/superuser-t.c @@ -26,6 +26,10 @@ #include +#ifdef HAVE_SYS_WAIT_H +#include +#endif + #ifdef IGNORE_SOME_GCC_WARNINGS # pragma GCC diagnostic warning "-Wdeprecated-declarations" #endif @@ -223,14 +227,14 @@ startClient(char *configPath) /* Now, what happens if we're doing something over the network instead */ + code = rx_Init(0); + is_int(code, 0, "Initialised RX"); + /* Fake up an rx ticket. Note that this will be for the magic 'superuser' */ code = afsconf_ClientAuth(dir, &class, &classIndex); is_int(code, 0, "Can successfully create superuser token"); /* Start a connection to our test service with it */ - code = rx_Init(0); - is_int(code, 0, "Started RX"); - he = gethostbyname("localhost"); if (!he) { printf("Couldn't look up server hostname");