Commit efe7c309 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

adsldp/tests: Handle more cases of ERROR_DS_SERVER_DOWN.

Probably server protects itself from quick successive connections from the same client and returns LDAP_SERVER_DOWN. Signed-off-by: 's avatarDmitry Timoshkov <dmitry@baikal.ru> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 57f3d503
...@@ -69,7 +69,7 @@ DWORD map_ldap_error(DWORD err) ...@@ -69,7 +69,7 @@ DWORD map_ldap_error(DWORD err)
case LDAP_NO_OBJECT_CLASS_MODS: return ERROR_DS_CANT_MOD_OBJ_CLASS; case LDAP_NO_OBJECT_CLASS_MODS: return ERROR_DS_CANT_MOD_OBJ_CLASS;
case LDAP_RESULTS_TOO_LARGE: return ERROR_DS_OBJECT_RESULTS_TOO_LARGE; case LDAP_RESULTS_TOO_LARGE: return ERROR_DS_OBJECT_RESULTS_TOO_LARGE;
case LDAP_AFFECTS_MULTIPLE_DSAS: return ERROR_DS_AFFECTS_MULTIPLE_DSAS; case LDAP_AFFECTS_MULTIPLE_DSAS: return ERROR_DS_AFFECTS_MULTIPLE_DSAS;
case LDAP_SERVER_DOWN: return ERROR_DS_SERVER_DOWN; case LDAP_SERVER_DOWN: return ERROR_DS_SERVER_DOWN;
case LDAP_LOCAL_ERROR: return ERROR_DS_LOCAL_ERROR; case LDAP_LOCAL_ERROR: return ERROR_DS_LOCAL_ERROR;
case LDAP_ENCODING_ERROR: return ERROR_DS_ENCODING_ERROR; case LDAP_ENCODING_ERROR: return ERROR_DS_ENCODING_ERROR;
case LDAP_DECODING_ERROR: return ERROR_DS_DECODING_ERROR; case LDAP_DECODING_ERROR: return ERROR_DS_DECODING_ERROR;
......
...@@ -106,11 +106,23 @@ static void test_LDAP(void) ...@@ -106,11 +106,23 @@ static void test_LDAP(void)
IDispatch_Release(disp); IDispatch_Release(disp);
hr = ADsOpenObject(path, user, password, test[i].flags, &IID_IADs, (void **)&ads); hr = ADsOpenObject(path, user, password, test[i].flags, &IID_IADs, (void **)&ads);
if (hr == HRESULT_FROM_WIN32(ERROR_DS_SERVER_DOWN))
{
SysFreeString(path);
skip("server is down\n");
break;
}
ok(hr == test[i].hr || hr == test[i].hr_ads_get, "%d: got %#x, expected %#x\n", i, hr, test[i].hr); ok(hr == test[i].hr || hr == test[i].hr_ads_get, "%d: got %#x, expected %#x\n", i, hr, test[i].hr);
if (hr == S_OK) if (hr == S_OK)
IADs_Release(ads); IADs_Release(ads);
hr = ADsGetObject(path, &IID_IDispatch, (void **)&disp); hr = ADsGetObject(path, &IID_IDispatch, (void **)&disp);
if (hr == HRESULT_FROM_WIN32(ERROR_DS_SERVER_DOWN))
{
SysFreeString(path);
skip("server is down\n");
break;
}
ok(hr == test[i].hr || hr == test[i].hr_ads_get, "%d: got %#x, expected %#x\n", i, hr, test[i].hr); ok(hr == test[i].hr || hr == test[i].hr_ads_get, "%d: got %#x, expected %#x\n", i, hr, test[i].hr);
if (hr == S_OK) if (hr == S_OK)
IDispatch_Release(disp); IDispatch_Release(disp);
...@@ -337,8 +349,12 @@ todo_wine ...@@ -337,8 +349,12 @@ todo_wine
ok(hr == E_NOINTERFACE, "got %#x\n", hr); ok(hr == E_NOINTERFACE, "got %#x\n", hr);
hr = ADsGetObject(L"LDAP://ldap.forumsys.com", &IID_IDirectorySearch, (void **)&ds); hr = ADsGetObject(L"LDAP://ldap.forumsys.com", &IID_IDirectorySearch, (void **)&ds);
if (hr == HRESULT_FROM_WIN32(ERROR_DS_SERVER_DOWN))
{
skip("server is down\n");
return;
}
ok(hr == S_OK, "got %#x\n", hr); ok(hr == S_OK, "got %#x\n", hr);
if (hr != S_OK) return;
pref.dwSearchPref = ADS_SEARCHPREF_SEARCH_SCOPE; pref.dwSearchPref = ADS_SEARCHPREF_SEARCH_SCOPE;
pref.vValue.dwType = ADSTYPE_INTEGER; pref.vValue.dwType = ADSTYPE_INTEGER;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment