diff --git a/e2etest/GuestProxyAgentTest/TestCases/TCPPortScalabilityCase.cs b/e2etest/GuestProxyAgentTest/TestCases/TCPPortScalabilityCase.cs index 604e4a34..9cd979a9 100644 --- a/e2etest/GuestProxyAgentTest/TestCases/TCPPortScalabilityCase.cs +++ b/e2etest/GuestProxyAgentTest/TestCases/TCPPortScalabilityCase.cs @@ -7,26 +7,14 @@ namespace GuestProxyAgentTest.TestCases { public class TCPPortScalabilityCase : TestCaseBase { - public TCPPortScalabilityCase(bool imdsSecureChannelEnabled) : base("TCPPortScalabilityCase") - { - ImdsSecureChannelEnabled = imdsSecureChannelEnabled; - } + public TCPPortScalabilityCase() : base("ConfigTCPPortScalability") + { } private bool ImdsSecureChannelEnabled { get; set; } public override async Task StartAsync(TestCaseExecutionContext context) { context.TestResultDetails = (await RunScriptViaRunCommandV2Async(context, "ConfigTCPPortScalability.ps1", null!, false)).ToTestResultDetails(context.Logger); - if(!context.TestResultDetails.Succeed) - { - return; - } - // reboot - var vmr = context.VirtualMachineResource; - await vmr.RestartAsync(Azure.WaitUntil.Completed); - List<(string, string)> parameterList = new List<(string, string)>(); - parameterList.Add(("imdsSecureChannelEnabled", ImdsSecureChannelEnabled.ToString())); - context.TestResultDetails = (await RunScriptViaRunCommandV2Async(context, "IMDSPingTest.ps1", parameterList, false)).ToTestResultDetails(context.Logger); } } } diff --git a/e2etest/GuestProxyAgentTest/TestMap/WinClient11-Arm64-TestGroup.yml b/e2etest/GuestProxyAgentTest/TestMap/WinClient11-Arm64-TestGroup.yml index de35ae28..16117af3 100644 --- a/e2etest/GuestProxyAgentTest/TestMap/WinClient11-Arm64-TestGroup.yml +++ b/e2etest/GuestProxyAgentTest/TestMap/WinClient11-Arm64-TestGroup.yml @@ -6,8 +6,8 @@ vmImageVersion: latest scenarios: - name: BVTScenario className: GuestProxyAgentTest.TestScenarios.BVTScenario - - name: BugFixesScenario - className: GuestProxyAgentTest.TestScenarios.BugFixesScenario + - name: TCPPortScalabilityScenario + className: GuestProxyAgentTest.TestScenarios.TCPPortScalabilityScenario - name: ProxyAgentExtension className: GuestProxyAgentTest.TestScenarios.ProxyAgentExtension diff --git a/e2etest/GuestProxyAgentTest/TestMap/WinClient11-TestGroup.yml b/e2etest/GuestProxyAgentTest/TestMap/WinClient11-TestGroup.yml index ea9235ac..b7c3d900 100644 --- a/e2etest/GuestProxyAgentTest/TestMap/WinClient11-TestGroup.yml +++ b/e2etest/GuestProxyAgentTest/TestMap/WinClient11-TestGroup.yml @@ -6,7 +6,7 @@ vmImageVersion: latest scenarios: - name: BVTScenario className: GuestProxyAgentTest.TestScenarios.BVTScenario - - name: BugFixesScenario - className: GuestProxyAgentTest.TestScenarios.BugFixesScenario + - name: TCPPortScalabilityScenario + className: GuestProxyAgentTest.TestScenarios.TCPPortScalabilityScenario - name: ProxyAgentExtension className: GuestProxyAgentTest.TestScenarios.ProxyAgentExtension diff --git a/e2etest/GuestProxyAgentTest/TestMap/WinServer2019-TestGroup.yml b/e2etest/GuestProxyAgentTest/TestMap/WinServer2019-TestGroup.yml index 236bd9af..ae5fb8b6 100644 --- a/e2etest/GuestProxyAgentTest/TestMap/WinServer2019-TestGroup.yml +++ b/e2etest/GuestProxyAgentTest/TestMap/WinServer2019-TestGroup.yml @@ -6,7 +6,7 @@ vmImageVersion: latest scenarios: - name: BVTScenario className: GuestProxyAgentTest.TestScenarios.BVTScenario - - name: BugFixesScenario - className: GuestProxyAgentTest.TestScenarios.BugFixesScenario + - name: TCPPortScalabilityScenario + className: GuestProxyAgentTest.TestScenarios.TCPPortScalabilityScenario - name: ProxyAgentExtension className: GuestProxyAgentTest.TestScenarios.ProxyAgentExtension diff --git a/e2etest/GuestProxyAgentTest/TestMap/WinServer2022-TestGroup.yml b/e2etest/GuestProxyAgentTest/TestMap/WinServer2022-TestGroup.yml index 12bdc19d..d7d31b79 100644 --- a/e2etest/GuestProxyAgentTest/TestMap/WinServer2022-TestGroup.yml +++ b/e2etest/GuestProxyAgentTest/TestMap/WinServer2022-TestGroup.yml @@ -6,7 +6,7 @@ vmImageVersion: latest scenarios: - className: GuestProxyAgentTest.TestScenarios.BVTScenario name: BVTScenario - - name: BugFixesScenario - className: GuestProxyAgentTest.TestScenarios.BugFixesScenario + - name: TCPPortScalabilityScenario + className: GuestProxyAgentTest.TestScenarios.TCPPortScalabilityScenario - name: ProxyAgentExtension className: GuestProxyAgentTest.TestScenarios.ProxyAgentExtension \ No newline at end of file diff --git a/e2etest/GuestProxyAgentTest/TestMap/WinServer2025-TestGroup.yml b/e2etest/GuestProxyAgentTest/TestMap/WinServer2025-TestGroup.yml index 041e7e99..9091bdca 100644 --- a/e2etest/GuestProxyAgentTest/TestMap/WinServer2025-TestGroup.yml +++ b/e2etest/GuestProxyAgentTest/TestMap/WinServer2025-TestGroup.yml @@ -6,7 +6,7 @@ vmImageVersion: latest scenarios: - className: GuestProxyAgentTest.TestScenarios.BVTScenario name: BVTScenario - - name: BugFixesScenario - className: GuestProxyAgentTest.TestScenarios.BugFixesScenario + - name: TCPPortScalabilityScenario + className: GuestProxyAgentTest.TestScenarios.TCPPortScalabilityScenario - name: ProxyAgentExtension className: GuestProxyAgentTest.TestScenarios.ProxyAgentExtension \ No newline at end of file diff --git a/e2etest/GuestProxyAgentTest/TestScenarios/BugFixesScenario.cs b/e2etest/GuestProxyAgentTest/TestScenarios/BugFixesScenario.cs deleted file mode 100644 index 00e6a69e..00000000 --- a/e2etest/GuestProxyAgentTest/TestScenarios/BugFixesScenario.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) Microsoft Corporation -// SPDX-License-Identifier: MIT -using GuestProxyAgentTest.TestCases; - -namespace GuestProxyAgentTest.TestScenarios -{ - public class BugFixesScenario : TestScenarioBase - { - public override void TestScenarioSetup() - { - AddTestCase(new InstallOrUpdateGuestProxyAgentCase()); - AddTestCase(new GuestProxyAgentValidationCase()); - AddTestCase(new TCPPortScalabilityCase(false)); - } - } -} \ No newline at end of file diff --git a/e2etest/GuestProxyAgentTest/TestScenarios/ProxyAgentExtension.cs b/e2etest/GuestProxyAgentTest/TestScenarios/ProxyAgentExtension.cs index 7b5ae1c2..530b1501 100644 --- a/e2etest/GuestProxyAgentTest/TestScenarios/ProxyAgentExtension.cs +++ b/e2etest/GuestProxyAgentTest/TestScenarios/ProxyAgentExtension.cs @@ -9,9 +9,6 @@ public class ProxyAgentExtension : TestScenarioBase { public override void TestScenarioSetup() { - string zipFile = Settings.TestSetting.Instance.zipFilePath; - string withoutExt = Path.GetFileNameWithoutExtension(zipFile); - string extractPath = Path.Combine(Path.GetDirectoryName(zipFile), withoutExt); // Passing in 0 version number for the first validation case string proxyAgentVersionBeforeUpdate = "0"; string proxyAgentVersion = Settings.TestSetting.Instance.proxyAgentVersion; diff --git a/e2etest/GuestProxyAgentTest/TestScenarios/TCPPortScalabilityScenario.cs b/e2etest/GuestProxyAgentTest/TestScenarios/TCPPortScalabilityScenario.cs new file mode 100644 index 00000000..6eace314 --- /dev/null +++ b/e2etest/GuestProxyAgentTest/TestScenarios/TCPPortScalabilityScenario.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation +// SPDX-License-Identifier: MIT +using GuestProxyAgentTest.TestCases; +using GuestProxyAgentTest.Utilities; + +namespace GuestProxyAgentTest.TestScenarios +{ + public class TCPPortScalabilityScenario : TestScenarioBase + { + public override void TestScenarioSetup() + { + if (!Constants.IS_WINDOWS()) + { + throw new InvalidOperationException("TCPPortScalability Scenario can only run on Windows VMs."); + } + + string proxyAgentVersion = Settings.TestSetting.Instance.proxyAgentVersion; + ConsoleLog(string.Format("Received ProxyAgent Version:{0}", proxyAgentVersion)); + + // This scenario must enable MSP for the new VM to test TCP port scalability. + EnableProxyAgentForNewVM = true; + + AddTestCase(new InstallOrUpdateGuestProxyAgentExtensionCase()); + AddTestCase(new GuestProxyAgentExtensionValidationCase("GuestProxyAgentExtensionValidationCaseAfterUpdate", proxyAgentVersion)); + AddTestCase(new TCPPortScalabilityCase()); + // reboot the VM to let the TCP port scalability take effect. + AddTestCase(new RebootVMCase("RebootVMCaseAfterConfigTCPPortScalability")); + AddTestCase(new IMDSPingTestCase("IMDSPingTestForPortScalability", true)); + } + } +} \ No newline at end of file