public void TwoClientsReadSameSharedVHD() { ulong requestIdforFirstClient = 0; BaseTestSite.Log.Add(LogEntryKind.TestStep, "1. The first client opens a shared virtual disk file and expects success."); OpenSharedVHD(TestConfig.NameOfSharedVHDX, requestIdforFirstClient++); BaseTestSite.Log.Add(LogEntryKind.TestStep, "2. The first client reads file content and expects success."); byte[] payload; uint status = client.Read(0, 512, out payload); BaseTestSite.Assert.AreEqual( (uint)Smb2Status.STATUS_SUCCESS, status, "Read content of shared virtual disk file from the first client should succeed, actual status: {0}", GetStatus(status)); ulong requestIdforSecondClient = 0; BaseTestSite.Log.Add(LogEntryKind.TestStep, "3. The second client opens a shared virtual disk file and expects success."); this.secondClient = new RsvdClient(TestConfig.Timeout); OpenSharedVHD(TestConfig.NameOfSharedVHDX, requestIdforSecondClient, rsvdClient: secondClient); requestIdforSecondClient++; BaseTestSite.Log.Add(LogEntryKind.TestStep, "4. The second client reads file content and expects success."); status = secondClient.Read(0, 512, out payload); BaseTestSite.Assert.AreEqual( (uint)Smb2Status.STATUS_SUCCESS, status, "Read content of shared virtual disk file from the second client should succeed, actual status: {0}", GetStatus(status)); BaseTestSite.Log.Add(LogEntryKind.TestStep, "5. The first client closes the file."); client.CloseSharedVirtualDisk(); BaseTestSite.Log.Add(LogEntryKind.TestStep, "6. The second client closes the file."); secondClient.CloseSharedVirtualDisk(); }
public void TwoClientsReadSameSharedVHD() { BaseTestSite.Log.Add(LogEntryKind.TestStep, "1. The first client opens a shared virtual disk file and expects success."); OpenSharedVHD(TestConfig.NameOfSharedVHDX, RSVD_PROTOCOL_VERSION.RSVD_PROTOCOL_VERSION_1, 0); BaseTestSite.Log.Add(LogEntryKind.TestStep, "2. The first client reads file content and expects success."); byte[] payload; uint status = client.Read(0, 512, out payload); BaseTestSite.Assert.AreEqual( (uint)Smb2Status.STATUS_SUCCESS, status, "Read content of shared virtual disk file from the first client should succeed, actual status: {0}", GetStatus(status)); BaseTestSite.Log.Add(LogEntryKind.TestStep, "3. The second client opens a shared virtual disk file and expects success."); this.secondClient = new RsvdClient(TestConfig.Timeout); OpenSharedVHD(TestConfig.NameOfSharedVHDX, RSVD_PROTOCOL_VERSION.RSVD_PROTOCOL_VERSION_1, 0, rsvdClient: secondClient); BaseTestSite.Log.Add(LogEntryKind.TestStep, "4. The second client reads file content and expects success."); status = secondClient.Read(0, 512, out payload); BaseTestSite.Assert.AreEqual( (uint)Smb2Status.STATUS_SUCCESS, status, "Read content of shared virtual disk file from the second client should succeed, actual status: {0}", GetStatus(status)); BaseTestSite.Log.Add(LogEntryKind.TestStep, "5. The first client closes the file."); client.CloseSharedVirtualDisk(); BaseTestSite.Log.Add(LogEntryKind.TestStep, "6. The second client closes the file."); secondClient.CloseSharedVirtualDisk(); }