aboutsummaryrefslogtreecommitdiff
path: root/tests/server
diff options
context:
space:
mode:
authorDan Fandrich <dan@coneharvesters.com>2011-07-26 12:47:04 -0700
committerDan Fandrich <dan@coneharvesters.com>2011-07-26 12:48:16 -0700
commitcfcca89b761aeb314b6afdc6449e4bedf6df15d6 (patch)
treedd9250f548814d507948ac5c0b785207f8153c24 /tests/server
parent41c6c78a0887d8eabf258a8349d537f3d1ede25b (diff)
Fixed test 2005 to work in out-of-tree builds
Also, set the test number in the test data file so fake_ntlm can be reused in future tests.
Diffstat (limited to 'tests/server')
-rw-r--r--tests/server/fake_ntlm.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/tests/server/fake_ntlm.c b/tests/server/fake_ntlm.c
index de7110636..f7abf621b 100644
--- a/tests/server/fake_ntlm.c
+++ b/tests/server/fake_ntlm.c
@@ -58,14 +58,29 @@ int main(void)
char *type1_input = NULL, *type3_input = NULL;
char *type1_output = NULL, *type3_output = NULL;
size_t size = 0;
+ int testnum;
+ const char *env;
- filename = test2file(2005);
+ env = getenv("NTLM_AUTH_TESTNUM");
+ if (env) {
+ testnum = strtoul(env, NULL, 10);
+ } else {
+ logmsg("Test number not specified in NTLM_AUTH_TESTNUM");
+ exit(1);
+ }
+
+ env = getenv("NTLM_AUTH_SRCDIR");
+ if (env) {
+ path = env;
+ }
+
+ filename = test2file(testnum);
stream=fopen(filename, "rb");
if(!stream) {
error = ERRNO;
logmsg("fopen() failed with error: %d %s", error, strerror(error));
logmsg("Error opening file: %s", filename);
- logmsg("Couldn't open test file %ld", 2005);
+ logmsg("Couldn't open test file %ld", testnum);
exit(1);
}
else {
@@ -83,7 +98,7 @@ int main(void)
error = ERRNO;
logmsg("fopen() failed with error: %d %s", error, strerror(error));
logmsg("Error opening file: %s", filename);
- logmsg("Couldn't open test file %ld", 2005);
+ logmsg("Couldn't open test file %ld", testnum);
exit(1);
}
else {
@@ -103,7 +118,7 @@ int main(void)
error = ERRNO;
logmsg("fopen() failed with error: %d %s", error, strerror(error));
logmsg("Error opening file: %s", filename);
- logmsg("Couldn't open test file %ld", 2005);
+ logmsg("Couldn't open test file %ld", testnum);
exit(1);
}
else {
@@ -124,7 +139,7 @@ int main(void)
error = ERRNO;
logmsg("fopen() failed with error: %d %s", error, strerror(error));
logmsg("Error opening file: %s", filename);
- logmsg("Couldn't open test file %ld", 2005);
+ logmsg("Couldn't open test file %ld", testnum);
exit(1);
}
else {