From 4ccf46d6a98d6bc97297a7b0e363a2968fae962a Mon Sep 17 00:00:00 2001 From: Marty T <120425148+tippmar-nr@users.noreply.github.com> Date: Thu, 14 Dec 2023 14:27:51 -0600 Subject: [PATCH] test: Update CSP tests to look for "Conflict" instead of "Gone" in connect response body (#2145) --- .../AspNetCoreLocalHSMDisabledAndServerSideHSMEnabledTests.cs | 3 ++- .../AspNetCoreLocalHSMEnabledAndServerSideHSMDisabledTests.cs | 3 ++- .../IntegrationTests/CSP/HighSecurityModeServerDisabled.cs | 3 ++- .../IntegrationTests/CSP/HighSecurityModeServerEnabled.cs | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/Agent/IntegrationTests/IntegrationTests/CSP/AspNetCoreLocalHSMDisabledAndServerSideHSMEnabledTests.cs b/tests/Agent/IntegrationTests/IntegrationTests/CSP/AspNetCoreLocalHSMDisabledAndServerSideHSMEnabledTests.cs index 87ba3a3b0c..5dc3430a9a 100644 --- a/tests/Agent/IntegrationTests/IntegrationTests/CSP/AspNetCoreLocalHSMDisabledAndServerSideHSMEnabledTests.cs +++ b/tests/Agent/IntegrationTests/IntegrationTests/CSP/AspNetCoreLocalHSMDisabledAndServerSideHSMEnabledTests.cs @@ -40,7 +40,8 @@ public AspNetCoreLocalHSMDisabledAndServerSideHSMEnabledTests(RemoteServiceFixtu public void Test() { // This test looks for the connect response body that was intended to be removed in P17, but was not. If it does get removed this will fail. - var notConnectedLogLine = _fixture.AgentLog.TryGetLogLine(AgentLogBase.ErrorResponseLogLinePrefixRegex + "Received HTTP status code Gone with message {\"exception\":{\"message\":\"Account Security Violation: *?"); + // 12/14/23 - the response status changed from "Gone" to "Conflict". If this test fails in the future, be alert for it possibly changing back. + var notConnectedLogLine = _fixture.AgentLog.TryGetLogLine(AgentLogBase.ErrorResponseLogLinePrefixRegex + "Received HTTP status code Conflict with message {\"exception\":{\"message\":\"Account Security Violation: *?"); Assert.NotNull(notConnectedLogLine); } } diff --git a/tests/Agent/IntegrationTests/IntegrationTests/CSP/AspNetCoreLocalHSMEnabledAndServerSideHSMDisabledTests.cs b/tests/Agent/IntegrationTests/IntegrationTests/CSP/AspNetCoreLocalHSMEnabledAndServerSideHSMDisabledTests.cs index 446671dbd5..e9f516736e 100644 --- a/tests/Agent/IntegrationTests/IntegrationTests/CSP/AspNetCoreLocalHSMEnabledAndServerSideHSMDisabledTests.cs +++ b/tests/Agent/IntegrationTests/IntegrationTests/CSP/AspNetCoreLocalHSMEnabledAndServerSideHSMDisabledTests.cs @@ -48,7 +48,8 @@ public AspNetCoreLocalHSMEnabledAndServerSideHSMDisabledTests(RemoteServiceFixtu public void Test() { // This test looks for the connect response body that was intended to be removed in P17, but was not. If it does get removed this will fail. - var notConnectedLogLine = _fixture.AgentLog.TryGetLogLine(AgentLogBase.ErrorResponseLogLinePrefixRegex + "Received HTTP status code Gone with message {\"exception\":{\"message\":\"Account Security Violation: *?"); + // 12/14/23 - the response status changed from "Gone" to "Conflict". If this test fails in the future, be alert for it possibly changing back. + var notConnectedLogLine = _fixture.AgentLog.TryGetLogLine(AgentLogBase.ErrorResponseLogLinePrefixRegex + "Received HTTP status code Conflict with message {\"exception\":{\"message\":\"Account Security Violation: *?"); Assert.NotNull(notConnectedLogLine); } } diff --git a/tests/Agent/IntegrationTests/IntegrationTests/CSP/HighSecurityModeServerDisabled.cs b/tests/Agent/IntegrationTests/IntegrationTests/CSP/HighSecurityModeServerDisabled.cs index b31626dd12..b920e60491 100644 --- a/tests/Agent/IntegrationTests/IntegrationTests/CSP/HighSecurityModeServerDisabled.cs +++ b/tests/Agent/IntegrationTests/IntegrationTests/CSP/HighSecurityModeServerDisabled.cs @@ -45,7 +45,8 @@ public HighSecurityModeServerDisabled(RemoteServiceFixtures.OwinWebApiFixture fi public void Test() { // This test looks for the connect response body that was intended to be removed in P17, but was not. If it does get removed this will fail. - var notConnectedLogLine = _fixture.AgentLog.TryGetLogLine(AgentLogBase.ErrorResponseLogLinePrefixRegex + "Received HTTP status code Gone with message {\"exception\":{\"message\":\"Account Security Violation: *?"); + // 12/14/23 - the response status changed from "Gone" to "Conflict". If this test fails in the future, be alert for it possibly changing back. + var notConnectedLogLine = _fixture.AgentLog.TryGetLogLine(AgentLogBase.ErrorResponseLogLinePrefixRegex + "Received HTTP status code Conflict with message {\"exception\":{\"message\":\"Account Security Violation: *?"); Assert.NotNull(notConnectedLogLine); } } diff --git a/tests/Agent/IntegrationTests/IntegrationTests/CSP/HighSecurityModeServerEnabled.cs b/tests/Agent/IntegrationTests/IntegrationTests/CSP/HighSecurityModeServerEnabled.cs index aca867d000..d4860a62c7 100644 --- a/tests/Agent/IntegrationTests/IntegrationTests/CSP/HighSecurityModeServerEnabled.cs +++ b/tests/Agent/IntegrationTests/IntegrationTests/CSP/HighSecurityModeServerEnabled.cs @@ -43,7 +43,8 @@ public HighSecurityModeServerEnabled(RemoteServiceFixtures.HSMOwinWebApiFixture public void Test() { // This test looks for the connect response body that was intended to be removed in P17, but was not. If it does get removed this will fail. - var notConnectedLogLine = _fixture.AgentLog.TryGetLogLine(AgentLogBase.ErrorResponseLogLinePrefixRegex + "Received HTTP status code Gone with message {\"exception\":{\"message\":\"Account Security Violation: *?"); + // 12/14/23 - the response status changed from "Gone" to "Conflict". If this test fails in the future, be alert for it possibly changing back. + var notConnectedLogLine = _fixture.AgentLog.TryGetLogLine(AgentLogBase.ErrorResponseLogLinePrefixRegex + "Received HTTP status code Conflict with message {\"exception\":{\"message\":\"Account Security Violation: *?"); Assert.NotNull(notConnectedLogLine); } }