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.
This commit is contained in:
parent
41c6c78a08
commit
cfcca89b76
@ -71,6 +71,10 @@ CURL_GETHOSTNAME=curlhost
|
|||||||
LD_PRELOAD=%PWD/libtest/.libs/libhostname.so
|
LD_PRELOAD=%PWD/libtest/.libs/libhostname.so
|
||||||
# set path to fake_auth instead of real ntlm_auth to generate NTLM type1 and type 3 messages
|
# set path to fake_auth instead of real ntlm_auth to generate NTLM type1 and type 3 messages
|
||||||
NTLM_AUTH=server/fake_ntlm
|
NTLM_AUTH=server/fake_ntlm
|
||||||
|
# set source directory so fake_ntlm can find the test files
|
||||||
|
NTLM_AUTH_SRCDIR=%SRCDIR
|
||||||
|
# set the test number
|
||||||
|
NTLM_AUTH_TESTNUM=2005
|
||||||
</setenv>
|
</setenv>
|
||||||
<command>
|
<command>
|
||||||
http://%HOSTIP:%HTTPPORT/2005 -u testuser:anypasswd --ntlm-sso
|
http://%HOSTIP:%HTTPPORT/2005 -u testuser:anypasswd --ntlm-sso
|
||||||
|
@ -58,14 +58,29 @@ int main(void)
|
|||||||
char *type1_input = NULL, *type3_input = NULL;
|
char *type1_input = NULL, *type3_input = NULL;
|
||||||
char *type1_output = NULL, *type3_output = NULL;
|
char *type1_output = NULL, *type3_output = NULL;
|
||||||
size_t size = 0;
|
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");
|
stream=fopen(filename, "rb");
|
||||||
if(!stream) {
|
if(!stream) {
|
||||||
error = ERRNO;
|
error = ERRNO;
|
||||||
logmsg("fopen() failed with error: %d %s", error, strerror(error));
|
logmsg("fopen() failed with error: %d %s", error, strerror(error));
|
||||||
logmsg("Error opening file: %s", filename);
|
logmsg("Error opening file: %s", filename);
|
||||||
logmsg("Couldn't open test file %ld", 2005);
|
logmsg("Couldn't open test file %ld", testnum);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -83,7 +98,7 @@ int main(void)
|
|||||||
error = ERRNO;
|
error = ERRNO;
|
||||||
logmsg("fopen() failed with error: %d %s", error, strerror(error));
|
logmsg("fopen() failed with error: %d %s", error, strerror(error));
|
||||||
logmsg("Error opening file: %s", filename);
|
logmsg("Error opening file: %s", filename);
|
||||||
logmsg("Couldn't open test file %ld", 2005);
|
logmsg("Couldn't open test file %ld", testnum);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -103,7 +118,7 @@ int main(void)
|
|||||||
error = ERRNO;
|
error = ERRNO;
|
||||||
logmsg("fopen() failed with error: %d %s", error, strerror(error));
|
logmsg("fopen() failed with error: %d %s", error, strerror(error));
|
||||||
logmsg("Error opening file: %s", filename);
|
logmsg("Error opening file: %s", filename);
|
||||||
logmsg("Couldn't open test file %ld", 2005);
|
logmsg("Couldn't open test file %ld", testnum);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -124,7 +139,7 @@ int main(void)
|
|||||||
error = ERRNO;
|
error = ERRNO;
|
||||||
logmsg("fopen() failed with error: %d %s", error, strerror(error));
|
logmsg("fopen() failed with error: %d %s", error, strerror(error));
|
||||||
logmsg("Error opening file: %s", filename);
|
logmsg("Error opening file: %s", filename);
|
||||||
logmsg("Couldn't open test file %ld", 2005);
|
logmsg("Couldn't open test file %ld", testnum);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user