/TestSuites/ADFamily/src/TestSuite/MS-DRSR/Failures/DrsReplicaSyncFailures.cs

https://github.com/microsoft/WindowsProtocolTestSuites · C# · 570 lines · 432 code · 36 blank · 102 comment · 6 complexity · 707393eea855a93d8bbd4026a6d21087 MD5 · raw file

  1. // Copyright (c) Microsoft. All rights reserved.
  2. // Licensed under the MIT license. See LICENSE file in the project root for full license information.
  3. using System;
  4. using System.Collections.Generic;
  5. using Microsoft.VisualStudio.TestTools.UnitTesting;
  6. using Microsoft.Protocols.TestTools;
  7. using Microsoft.Protocols.TestTools.StackSdk;
  8. using Microsoft.Protocols.TestTools.StackSdk.ActiveDirectory.Drsr;
  9. namespace Microsoft.Protocols.TestSuites.ActiveDirectory.Drsr
  10. {
  11. [TestClass]
  12. public class DrsReplicaSyncFailures : DrsrFailureTestClassBase
  13. {
  14. #region Class Initialization and Cleanup
  15. [ClassInitialize]
  16. public static new void ClassInitialize(TestContext context)
  17. {
  18. DrsrFailureTestClassBase.BaseInitialize(context);
  19. }
  20. [ClassCleanup]
  21. public static new void ClassCleanup()
  22. {
  23. DrsrFailureTestClassBase.BaseCleanup();
  24. }
  25. #endregion
  26. #region Test Initialization and Cleanup
  27. protected override void TestInitialize()
  28. {
  29. base.TestInitialize();
  30. }
  31. protected override void TestCleanup()
  32. {
  33. base.TestCleanup();
  34. }
  35. #endregion
  36. #region TestCases
  37. [TestCategory("Win2003")]
  38. [ServerType(DcServerTypes.Any)]
  39. [SupportedADType(ADInstanceType.Both)]
  40. [Priority(0)]
  41. [Description("")]
  42. [TestCategory("PDC")]
  43. [TestCategory("DomainWin2008R2")]
  44. [TestCategory("ForestWin2008R2")]
  45. [TestCategory("MS-DRSR")]
  46. [TestMethod]
  47. public void DRSR_DRSReplicaSync_Invalid_Input_1()
  48. {
  49. DrsrTestChecker.Check();
  50. DRSReplicaSync_Invalid_Input_1(DrsReplicaSync_Versions.V1);
  51. }
  52. [TestCategory("Winv1803")]
  53. [ServerType(DcServerTypes.Any)]
  54. [SupportedADType(ADInstanceType.Both)]
  55. [Priority(0)]
  56. [Description("")]
  57. [TestCategory("PDC")]
  58. [TestCategory("DomainWinV1803")]
  59. [TestCategory("MS-DRSR")]
  60. [TestMethod]
  61. public void DRSR_DRSReplicaSyncV2_Invalid_Input_1()
  62. {
  63. DrsrTestChecker.Check();
  64. DRSReplicaSync_Invalid_Input_1(DrsReplicaSync_Versions.V2);
  65. }
  66. [TestCategory("Win2003")]
  67. [ServerType(DcServerTypes.Any)]
  68. [SupportedADType(ADInstanceType.Both)]
  69. [Priority(0)]
  70. [Description("")]
  71. [TestCategory("PDC")]
  72. [TestCategory("DomainWin2008R2")]
  73. [TestCategory("ForestWin2008R2")]
  74. [TestCategory("MS-DRSR")]
  75. [TestMethod]
  76. public void DRSR_DRSReplicaSync_Invalid_Input_2()
  77. {
  78. DrsrTestChecker.Check();
  79. DRSReplicaSync_Invalid_Input_2(DrsReplicaSync_Versions.V1);
  80. }
  81. [TestCategory("Winv1803")]
  82. [ServerType(DcServerTypes.Any)]
  83. [SupportedADType(ADInstanceType.Both)]
  84. [Priority(0)]
  85. [Description("")]
  86. [TestCategory("PDC")]
  87. [TestCategory("DomainWinV1803")]
  88. [TestCategory("MS-DRSR")]
  89. [TestMethod]
  90. public void DRSR_DRSReplicaSyncV2_Invalid_Input_2()
  91. {
  92. DrsrTestChecker.Check();
  93. DRSReplicaSync_Invalid_Input_2(DrsReplicaSync_Versions.V2);
  94. }
  95. [TestCategory("Win2003")]
  96. [ServerType(DcServerTypes.Any)]
  97. [SupportedADType(ADInstanceType.Both)]
  98. [Priority(0)]
  99. [Description("")]
  100. [TestCategory("PDC")]
  101. [TestCategory("DomainWin2008R2")]
  102. [TestCategory("ForestWin2008R2")]
  103. [TestCategory("MS-DRSR")]
  104. [TestMethod]
  105. public void DRSR_DRSReplicaSync_Invalid_Input_3()
  106. {
  107. DrsrTestChecker.Check();
  108. DRSReplicaSync_Invalid_Input_3(DrsReplicaSync_Versions.V1);
  109. }
  110. [TestCategory("Winv1803")]
  111. [ServerType(DcServerTypes.Any)]
  112. [SupportedADType(ADInstanceType.Both)]
  113. [Priority(0)]
  114. [Description("")]
  115. [TestCategory("PDC")]
  116. [TestCategory("DomainWinV1803")]
  117. [TestCategory("MS-DRSR")]
  118. [TestMethod]
  119. public void DRSR_DRSReplicaSyncV2_Invalid_Input_3()
  120. {
  121. DrsrTestChecker.Check();
  122. DRSReplicaSync_Invalid_Input_3(DrsReplicaSync_Versions.V2);
  123. }
  124. [TestCategory("Win2003")]
  125. [ServerType(DcServerTypes.Any)]
  126. [SupportedADType(ADInstanceType.Both)]
  127. [Priority(0)]
  128. [Description("")]
  129. [TestCategory("PDC")]
  130. [TestCategory("DomainWin2008R2")]
  131. [TestCategory("ForestWin2008R2")]
  132. [TestCategory("MS-DRSR")]
  133. [TestMethod]
  134. public void DRSR_DRSReplicaSync_Invalid_Input_4()
  135. {
  136. DrsrTestChecker.Check();
  137. DRSReplicaSync_Invalid_Input_4(DrsReplicaSync_Versions.V1);
  138. }
  139. [TestCategory("Winv1803")]
  140. [ServerType(DcServerTypes.Any)]
  141. [SupportedADType(ADInstanceType.Both)]
  142. [Priority(0)]
  143. [Description("")]
  144. [TestCategory("PDC")]
  145. [TestCategory("DomainWinV1803")]
  146. [TestCategory("MS-DRSR")]
  147. [TestMethod]
  148. public void DRSR_DRSReplicaSyncV2_Invalid_Input_4()
  149. {
  150. DrsrTestChecker.Check();
  151. DRSReplicaSync_Invalid_Input_4(DrsReplicaSync_Versions.V2);
  152. }
  153. [TestCategory("Win2003")]
  154. [ServerType(DcServerTypes.Any)]
  155. [SupportedADType(ADInstanceType.DS)]
  156. [Priority(0)]
  157. [Description("")]
  158. [TestCategory("PDC")]
  159. [TestCategory("DomainWin2008R2")]
  160. [TestCategory("ForestWin2008R2")]
  161. [TestCategory("MS-DRSR")]
  162. [TestMethod]
  163. public void DRSR_DRSReplicaSync_Access_Denied()
  164. {
  165. DrsrTestChecker.Check();
  166. DRSReplicaSync_Access_Denied(DrsReplicaSync_Versions.V1);
  167. }
  168. [TestCategory("Winv1803")]
  169. [ServerType(DcServerTypes.Any)]
  170. [SupportedADType(ADInstanceType.DS)]
  171. [Priority(0)]
  172. [Description("")]
  173. [TestCategory("PDC")]
  174. [TestCategory("DomainWinV1803")]
  175. [TestCategory("MS-DRSR")]
  176. [TestMethod]
  177. public void DRSR_DRSReplicaSyncV2_Access_Denied()
  178. {
  179. DrsrTestChecker.Check();
  180. DRSReplicaSync_Access_Denied(DrsReplicaSync_Versions.V2);
  181. }
  182. [TestCategory("Win2003")]
  183. [ServerType(DcServerTypes.Any)]
  184. [SupportedADType(ADInstanceType.DS)]
  185. [Priority(0)]
  186. [Description("")]
  187. [TestCategory("PDC")]
  188. [TestCategory("DomainWin2008R2")]
  189. [TestCategory("ForestWin2008R2")]
  190. [TestCategory("MS-DRSR")]
  191. [TestMethod]
  192. public void DRSR_DRSReplicaSync_No_Replica()
  193. {
  194. DrsrTestChecker.Check();
  195. DRSReplicaSync_No_Replica(DrsReplicaSync_Versions.V1);
  196. }
  197. [TestCategory("Winv1803")]
  198. [ServerType(DcServerTypes.Any)]
  199. [SupportedADType(ADInstanceType.DS)]
  200. [Priority(0)]
  201. [Description("")]
  202. [TestCategory("PDC")]
  203. [TestCategory("DomainWinV1803")]
  204. [TestCategory("MS-DRSR")]
  205. [TestMethod]
  206. public void DRSR_DRSReplicaSyncV2_No_Replica()
  207. {
  208. DrsrTestChecker.Check();
  209. DRSReplicaSync_No_Replica(DrsReplicaSync_Versions.V2);
  210. }
  211. #endregion
  212. #region Private Methods
  213. private void DRSReplicaSync_Invalid_Input_1(DrsReplicaSync_Versions dwInVersion)
  214. {
  215. uint ret = drsTestClient.DrsBind(
  216. EnvironmentConfig.Machine.WritableDC1,
  217. EnvironmentConfig.User.ParentDomainAdmin,
  218. DRS_EXTENSIONS_IN_FLAGS.DRS_EXT_BASE);
  219. /* comments from TD */
  220. /*
  221. options := msgIn.ulOptions
  222. if msgIn.pNC = null
  223. or (not DRS_SYNC_ALL in options
  224. and msgIn.uuidDsaSrc = null
  225. and msgIn.pszDsaSrc = null) then
  226. return ERROR_DS_DRA_INVALID_PARAMETER
  227. endif
  228. */
  229. /* Create request message */
  230. DRS_MSG_REPSYNC msgIn = new DRS_MSG_REPSYNC();
  231. switch (dwInVersion)
  232. {
  233. case DrsReplicaSync_Versions.V1:
  234. msgIn = drsTestClient.CreateDrsReplicaSyncV1Request();
  235. /* Setting param #1 */
  236. //msgIn.V1.pNC = null;
  237. break;
  238. case DrsReplicaSync_Versions.V2:
  239. msgIn = drsTestClient.CreateDrsReplicaSyncV2Request();
  240. break;
  241. default:
  242. BaseTestSite.Assert.Fail("The version {0} is not supported.", dwInVersion);
  243. break;
  244. }
  245. /* Issue the request */
  246. ret = drsTestClient.DRSClient.DrsReplicaSync(
  247. EnvironmentConfig.DrsContextStore[EnvironmentConfig.Machine.WritableDC1],
  248. (uint)dwInVersion,
  249. msgIn);
  250. BaseTestSite.Assert.AreEqual<uint>(
  251. (uint)Win32ErrorCode_32.ERROR_DS_DRA_INVALID_PARAMETER,
  252. ret,
  253. "DrsReplicaSync: return code mismatch."
  254. );
  255. }
  256. private void DRSReplicaSync_Invalid_Input_2(DrsReplicaSync_Versions dwInVersion)
  257. {
  258. uint ret = drsTestClient.DrsBind(
  259. EnvironmentConfig.Machine.WritableDC1,
  260. EnvironmentConfig.User.ParentDomainAdmin,
  261. DRS_EXTENSIONS_IN_FLAGS.DRS_EXT_BASE);
  262. /* comments from TD */
  263. /*
  264. options := msgIn.ulOptions
  265. if msgIn.pNC = null
  266. or (not DRS_SYNC_ALL in options
  267. and msgIn.uuidDsaSrc = null
  268. and msgIn.pszDsaSrc = null) then
  269. return ERROR_DS_DRA_INVALID_PARAMETER
  270. endif
  271. */
  272. /* Create request message */
  273. DRS_MSG_REPSYNC msgIn = new DRS_MSG_REPSYNC();
  274. // NC
  275. DsServer srv = (DsServer)EnvironmentConfig.MachineStore[EnvironmentConfig.Machine.WritableDC1];
  276. RootDSE rootDse = LdapUtility.GetRootDSE(srv);
  277. DSNAME ncDsname = LdapUtility.CreateDSNameForObject(srv, rootDse.configurationNamingContext);
  278. switch (dwInVersion)
  279. {
  280. case DrsReplicaSync_Versions.V1:
  281. msgIn = drsTestClient.CreateDrsReplicaSyncV1Request();
  282. /* Setting param #1 */
  283. msgIn.V1.ulOptions = 0;
  284. /* Setting param #2 */
  285. msgIn.V1.uuidDsaSrc = Guid.Empty;
  286. /* Setting param #3 */
  287. msgIn.V1.pszDsaSrc = null;
  288. msgIn.V1.pNC = ncDsname;
  289. break;
  290. case DrsReplicaSync_Versions.V2:
  291. msgIn = drsTestClient.CreateDrsReplicaSyncV2Request();
  292. /* Setting param #1 */
  293. msgIn.V2.ulOptions = 0;
  294. /* Setting param #2 */
  295. msgIn.V2.uuidDsaSrc = Guid.Empty;
  296. /* Setting param #3 */
  297. msgIn.V2.pszDsaSrc = null;
  298. msgIn.V2.pNC = ncDsname;
  299. break;
  300. default:
  301. BaseTestSite.Assert.Fail("The version {0} is not supported.", dwInVersion);
  302. break;
  303. }
  304. /* Issue the request */
  305. ret = drsTestClient.DRSClient.DrsReplicaSync(
  306. EnvironmentConfig.DrsContextStore[EnvironmentConfig.Machine.WritableDC1],
  307. (uint)dwInVersion,
  308. msgIn);
  309. BaseTestSite.Assert.AreEqual<uint>(
  310. (uint)Win32ErrorCode_32.ERROR_DS_DRA_INVALID_PARAMETER,
  311. ret,
  312. "DrsReplicaSync: return code mismatch."
  313. );
  314. }
  315. private void DRSReplicaSync_Invalid_Input_3(DrsReplicaSync_Versions dwInVersion)
  316. {
  317. uint ret = drsTestClient.DrsBind(
  318. EnvironmentConfig.Machine.WritableDC1,
  319. EnvironmentConfig.User.ParentDomainAdmin,
  320. DRS_EXTENSIONS_IN_FLAGS.DRS_EXT_BASE);
  321. /* comments from TD */
  322. /*
  323. if (DRS_SYNC_BYNAME in options and msgIn.pszDsaSrc = null)
  324. or (not DRS_SYNC_BYNAME in options and msgIn.uuidDsaSrc = null)
  325. or (not DRS_SYNC_BYNAME in options and msgIn.uuidDsaSrc = NULLGUID) then
  326. return ERROR_DS_DRA_INVALID_PARAMETER
  327. endif
  328. */
  329. /* Create request message */
  330. DRS_MSG_REPSYNC msgIn = new DRS_MSG_REPSYNC();
  331. // NC
  332. DsServer srv = (DsServer)EnvironmentConfig.MachineStore[EnvironmentConfig.Machine.WritableDC1];
  333. RootDSE rootDse = LdapUtility.GetRootDSE(srv);
  334. DSNAME ncDsname = LdapUtility.CreateDSNameForObject(srv, rootDse.configurationNamingContext);
  335. switch (dwInVersion)
  336. {
  337. case DrsReplicaSync_Versions.V1:
  338. msgIn = drsTestClient.CreateDrsReplicaSyncV1Request();
  339. /* Setting param #1 */
  340. msgIn.V1.ulOptions = (uint)DRS_OPTIONS.DRS_SYNC_BYNAME;
  341. /* Setting param #2 */
  342. msgIn.V1.pszDsaSrc = null;
  343. msgIn.V1.pNC = ncDsname;
  344. break;
  345. case DrsReplicaSync_Versions.V2:
  346. msgIn = drsTestClient.CreateDrsReplicaSyncV2Request();
  347. /* Setting param #1 */
  348. msgIn.V2.ulOptions = (uint)DRS_OPTIONS.DRS_SYNC_BYNAME;
  349. /* Setting param #2 */
  350. msgIn.V2.pszDsaSrc = null;
  351. msgIn.V2.pNC = ncDsname;
  352. break;
  353. default:
  354. BaseTestSite.Assert.Fail("The version {0} is not supported.", dwInVersion);
  355. break;
  356. }
  357. /* Issue the request */
  358. ret = drsTestClient.DRSClient.DrsReplicaSync(
  359. EnvironmentConfig.DrsContextStore[EnvironmentConfig.Machine.WritableDC1],
  360. (uint)dwInVersion,
  361. msgIn);
  362. BaseTestSite.Assert.AreEqual<uint>(
  363. (uint)Win32ErrorCode_32.ERROR_DS_DRA_INVALID_PARAMETER,
  364. ret,
  365. "DrsReplicaSync: return code mismatch."
  366. );
  367. }
  368. private void DRSReplicaSync_Invalid_Input_4(DrsReplicaSync_Versions dwInVersion)
  369. {
  370. uint ret = drsTestClient.DrsBind(
  371. EnvironmentConfig.Machine.WritableDC1,
  372. EnvironmentConfig.User.ParentDomainAdmin,
  373. DRS_EXTENSIONS_IN_FLAGS.DRS_EXT_BASE);
  374. /* comments from TD */
  375. /*
  376. if (DRS_SYNC_BYNAME in options and msgIn.pszDsaSrc = null)
  377. or (not DRS_SYNC_BYNAME in options and msgIn.uuidDsaSrc = null)
  378. or (not DRS_SYNC_BYNAME in options and msgIn.uuidDsaSrc = NULLGUID) then
  379. return ERROR_DS_DRA_INVALID_PARAMETER
  380. endif
  381. */
  382. /* Create request message */
  383. DRS_MSG_REPSYNC msgIn = new DRS_MSG_REPSYNC();
  384. // NC
  385. DsServer srv = (DsServer)EnvironmentConfig.MachineStore[EnvironmentConfig.Machine.WritableDC1];
  386. RootDSE rootDse = LdapUtility.GetRootDSE(srv);
  387. DSNAME ncDsname = LdapUtility.CreateDSNameForObject(srv, rootDse.configurationNamingContext);
  388. switch (dwInVersion)
  389. {
  390. case DrsReplicaSync_Versions.V1:
  391. msgIn = drsTestClient.CreateDrsReplicaSyncV1Request();
  392. /* Setting param #1 */
  393. msgIn.V1.ulOptions = 0;
  394. /* Setting param #2 */
  395. msgIn.V1.uuidDsaSrc = Guid.Empty;
  396. msgIn.V1.pNC = ncDsname;
  397. break;
  398. case DrsReplicaSync_Versions.V2:
  399. msgIn = drsTestClient.CreateDrsReplicaSyncV2Request();
  400. /* Setting param #1 */
  401. msgIn.V2.ulOptions = 0;
  402. /* Setting param #2 */
  403. msgIn.V2.uuidDsaSrc = Guid.Empty;
  404. msgIn.V2.pNC = ncDsname;
  405. break;
  406. default:
  407. BaseTestSite.Assert.Fail("The version {0} is not supported.", dwInVersion);
  408. break;
  409. }
  410. /* Issue the request */
  411. ret = drsTestClient.DRSClient.DrsReplicaSync(
  412. EnvironmentConfig.DrsContextStore[EnvironmentConfig.Machine.WritableDC1],
  413. (uint)dwInVersion,
  414. msgIn);
  415. BaseTestSite.Assert.AreEqual<uint>(
  416. (uint)Win32ErrorCode_32.ERROR_DS_DRA_INVALID_PARAMETER,
  417. ret,
  418. "DrsReplicaSync: return code mismatch."
  419. );
  420. }
  421. private void DRSReplicaSync_Access_Denied(DrsReplicaSync_Versions dwInVersion)
  422. {
  423. uint ret = drsTestClient.DrsBind(
  424. EnvironmentConfig.Machine.WritableDC1,
  425. EnvironmentConfig.User.ParentDomainUser,
  426. DRS_EXTENSIONS_IN_FLAGS.DRS_EXT_BASE);
  427. /* comments from TD */
  428. /*
  429. if AccessCheckCAR(nc, DS-Replication-Synchronize) then
  430. return ERROR_DS_DRA_ACCESS_DENIED
  431. endif
  432. */
  433. /* comments from likezh */
  434. /*
  435. !AccessCheckCAR(nc, DS-Replication-Synchronize)
  436. */
  437. //throw new NotImplementedException();
  438. /* Create request message */
  439. DRS_MSG_REPSYNC msgIn = new DRS_MSG_REPSYNC();
  440. // NC
  441. DsServer srv = (DsServer)EnvironmentConfig.MachineStore[EnvironmentConfig.Machine.WritableDC1];
  442. RootDSE rootDse = LdapUtility.GetRootDSE(srv);
  443. DSNAME ncDsname = LdapUtility.CreateDSNameForObject(srv, rootDse.defaultNamingContext);
  444. switch (dwInVersion)
  445. {
  446. case DrsReplicaSync_Versions.V1:
  447. msgIn = drsTestClient.CreateDrsReplicaSyncV1Request();
  448. msgIn.V1.pNC = ncDsname;
  449. // This API will check the uuidDsaSrc first to validate the input, so
  450. // to go thru that we set the uuidDsaSrc to any guid.
  451. msgIn.V1.uuidDsaSrc = DRSConstants.DrsRpcInterfaceGuid;
  452. break;
  453. case DrsReplicaSync_Versions.V2:
  454. msgIn = drsTestClient.CreateDrsReplicaSyncV2Request();
  455. msgIn.V2.pNC = ncDsname;
  456. // This API will check the uuidDsaSrc first to validate the input, so
  457. // to go thru that we set the uuidDsaSrc to any guid.
  458. msgIn.V2.uuidDsaSrc = DRSConstants.DrsRpcInterfaceGuid;
  459. break;
  460. default:
  461. BaseTestSite.Assert.Fail("The version {0} is not supported.", dwInVersion);
  462. break;
  463. }
  464. /* Issue the request */
  465. ret = drsTestClient.DRSClient.DrsReplicaSync(
  466. EnvironmentConfig.DrsContextStore[EnvironmentConfig.Machine.WritableDC1],
  467. (uint)dwInVersion,
  468. msgIn);
  469. BaseTestSite.Assert.AreEqual<uint>(
  470. (uint)Win32ErrorCode_32.ERROR_DS_DRA_ACCESS_DENIED,
  471. ret,
  472. "DrsReplicaSync: return code mismatch."
  473. );
  474. }
  475. private void DRSReplicaSync_No_Replica(DrsReplicaSync_Versions dwInVersion)
  476. {
  477. uint ret = drsTestClient.DrsBind(
  478. EnvironmentConfig.Machine.WritableDC1,
  479. EnvironmentConfig.User.ParentDomainAdmin,
  480. DRS_EXTENSIONS_IN_FLAGS.DRS_EXT_BASE);
  481. /* comments from TD */
  482. /*
  483. rf := select all v in nc!repsFrom
  484. where DRS_SYNC_ALL in options
  485. or (DRS_SYNC_BYNAME in options
  486. and v.naDsa = msgIn.pszDsaSrc)
  487. or (not DRS_SYNC_BYNAME in options
  488. and v.uuidDsa = msgIn.uuidDsaSrc)
  489. if rf = null then
  490. return ERROR_DS_DRA_NO_REPLICA
  491. endif
  492. */
  493. /* Create request message */
  494. DRS_MSG_REPSYNC msgIn = new DRS_MSG_REPSYNC();
  495. // NC
  496. DsServer srv = (DsServer)EnvironmentConfig.MachineStore[EnvironmentConfig.Machine.WritableDC1];
  497. RootDSE rootDse = LdapUtility.GetRootDSE(srv);
  498. DSNAME ncDsname = LdapUtility.CreateDSNameForObject(srv, rootDse.defaultNamingContext);
  499. switch (dwInVersion)
  500. {
  501. case DrsReplicaSync_Versions.V1:
  502. msgIn = drsTestClient.CreateDrsReplicaSyncV1Request();
  503. /* Setting param #1 */
  504. msgIn.V1.pszDsaSrc = "InvalidDsaSrc";
  505. /* Setting param #2 */
  506. msgIn.V1.ulOptions = (uint)DRS_OPTIONS.DRS_SYNC_BYNAME;
  507. msgIn.V1.pNC = ncDsname;
  508. break;
  509. case DrsReplicaSync_Versions.V2:
  510. msgIn = drsTestClient.CreateDrsReplicaSyncV2Request();
  511. /* Setting param #1 */
  512. msgIn.V2.pszDsaSrc = "InvalidDsaSrc";
  513. /* Setting param #2 */
  514. msgIn.V2.ulOptions = (uint)DRS_OPTIONS.DRS_SYNC_BYNAME;
  515. msgIn.V2.pNC = ncDsname;
  516. break;
  517. default:
  518. BaseTestSite.Assert.Fail("The version {0} is not supported.", dwInVersion);
  519. break;
  520. }
  521. /* Issue the request */
  522. ret = drsTestClient.DRSClient.DrsReplicaSync(
  523. EnvironmentConfig.DrsContextStore[EnvironmentConfig.Machine.WritableDC1],
  524. (uint)dwInVersion,
  525. msgIn);
  526. BaseTestSite.Assert.AreEqual<uint>(
  527. (uint)Win32ErrorCode_32.ERROR_DS_DRA_NO_REPLICA,
  528. ret,
  529. "DrsReplicaSync: return code mismatch."
  530. );
  531. }
  532. #endregion
  533. }
  534. }