#include <afs/afsutil.h>
#include <rx/rxkad.h>
-#include <tap/basic.h>
+#include <tests/tap/basic.h>
#include "test.h"
#include "common.h"
struct afsconf_typedKeyList *typedKeyList;
char *dirname;
char *keyfile;
+ char *keyfilesrc;
afs_int32 kvno;
int code;
int i;
/* Create a temporary afs configuration directory */
- dirname = buildTestConfig();
+ dirname = afstest_BuildTestConfig();
if (asprintf(&keyfile, "%s/KeyFile", dirname) == -1)
goto out;
+ /* Work out the path to our KeyFile. If the test harness hasn't set
+ * the SOURCE environment variable, then assume it is in our CWD */
+ if (getenv("SOURCE") == NULL) {
+ keyfilesrc = strdup("KeyFile");
+ } else {
+ if (asprintf(&keyfilesrc, "%s/auth/KeyFile", getenv("SOURCE")) == -1)
+ goto out;
+ }
+
/* First, copy in a known keyfile */
- code = copy("KeyFile", keyfile);
+ code = copy(keyfilesrc, keyfile);
+ free(keyfilesrc);
if (code)
goto out;
afsconf_Close(dir);
- unlinkTestConfig(dirname);
+ afstest_UnlinkTestConfig(dirname);
free(dirname);
free(keyfile);
/* Start a new test configuration */
- dirname = buildTestConfig();
+ dirname = afstest_BuildTestConfig();
dir = afsconf_Open(dirname);
ok(dir != NULL, "Sucessfully opened brand new config directory");
if (dir == NULL)
" ... with the right key");
out:
- unlinkTestConfig(dirname);
+ afstest_UnlinkTestConfig(dirname);
return 0;
}