From 285b8d7055d96ac5485a6241b23921d15ca0b1d1 Mon Sep 17 00:00:00 2001 From: Lily Pan Date: Tue, 29 Oct 2024 11:03:55 -0700 Subject: [PATCH] clean up --- e2e/const.go | 7 +-- e2e/scenario_helpers_test.go | 71 ----------------------- node-bootstrapper/{consts.go => const.go} | 0 3 files changed, 3 insertions(+), 75 deletions(-) rename node-bootstrapper/{consts.go => const.go} (100%) diff --git a/e2e/const.go b/e2e/const.go index 203e9e3ee69..33c87174c36 100644 --- a/e2e/const.go +++ b/e2e/const.go @@ -1,9 +1,8 @@ package e2e const ( - buildIDTagKey = "buildID" - defaultNamespace = "default" - extensionErrorCodeRegex = `ProvisioningState/failed/(\d+)` - // This is the error pattern we want to parse the exit code, see query https://dataexplorer.azure.com/clusters/aks/databases/AKSprod?query=H4sIAAAAAAAAA13MMQ7CMAxA0Z1TWJkZwhGqkoGBCXEANzWtIXUq2wIqcXjCyvyffmeb5L6K09u77Pxk33YfeM2kBItNkFtDFoPQX9KZzHCiqyyoNmNJqlUDoIx%2FNgkOheCGXGgMbbhqvVP2H9tDXUnRucrp2JLjg%2BAQY%2FwC8d99zowAAAA%3D + buildIDTagKey = "buildID" + defaultNamespace = "default" + extensionErrorCodeRegex = `ProvisioningState/failed/(\d+)` linuxExtensionExitCodeStr = `Enable failed: failed to execute command: command terminated with exit status=(\d+)` ) diff --git a/e2e/scenario_helpers_test.go b/e2e/scenario_helpers_test.go index fbb4e5a41ab..07964248042 100644 --- a/e2e/scenario_helpers_test.go +++ b/e2e/scenario_helpers_test.go @@ -193,77 +193,6 @@ func getCustomScriptExtensionStatus(ctx context.Context, t *testing.T, resourceG } func parseLinuxCSEMessage(t *testing.T, status armcompute.InstanceViewStatus) (*datamodel.CSEStatus, *datamodel.CSEStatusParsingError) { - // Base Case Happy Path 1: https://dataexplorer.azure.com/clusters/aks/databases/AKSprod?query=H4sIAAAAAAAAAxWMuw4CIRAAe79iQ4%2FBEyQWV1zOxs9Ylo2iES6wPi7x48VuJpnM1NZMc8nCH5lI0ivJuvnC%2B8qVoSxcUVLJ5xOMI6gQfETrvDaETlt7PGg0znTydh%2FY%2BoGNAswRHu0C1K%2BYcgPVBOXZtnOJrPp8qeXGJP%2Bom%2BCdYfcD%2BmnPWogAAAA%3D - // status.Code: ProvisioningState/succeeded - // status.Message - /* - Enable succeeded: - [stdout] - { \"ExitCode\": \"0\", \"Output\": \"Tue Dec 28" , "ExecDuration": "53", "KernelStartTime": "Tue 2024-02-27 21:18:05 UTC" } } - - [stderr] - Bootup is not yet finished. Please try again later. - */ - - // Base Case Happy Path 2: https://dataexplorer.azure.com/clusters/aks/databases/AKSprod?query=H4sIAAAAAAAAAz2Muw7CMAwAd77Cyh5kGkq6dKjKwme4roGASKrEPCrx8RQGxpPuritz5D5FlZd2rOERdF694XmWLJAmyaQhxcMe2haMr3fOyREtctXYLY7eDoOvLTE655B8I2L%2B9a2cgJczhVjAFCW9l3Wfxp8y5XQR1q%2B0kNJVYPMBUMXHZowAAAA%3D - // status.Code: ProvisioningState/failed/0 - // status.Message - /* - Enable failed: - [stdout] - { \"ExitCode\": \"53\", \"Output\": \"Tue Dec 28" , "ExecDuration": "53", "KernelStartTime": "Tue 2024-02-27 21:18:05 UTC" } } - - [stderr] - Bootup is not yet finished. Please try again later. - */ - - // Corner Case 1: https://dataexplorer.azure.com/clusters/aks/databases/AKSprod?query=H4sIAAAAAAAAA22OOwrDMBBE%2B5xiUa9goWDhwoWxmxxjkdaJEiyZ1eYjyOGj9IFpHsMbZio1%2BTknobdMXuIzSj184HUlJsg7MUrM6bzAOIJydrCh7wdt3Gr1yTirEWnVaMyAXYt3nQJMAbZyAd9WMaYCqgjKoxznHOhfPTOhUAChbc%2BMXCFEJi%2BZq2pfds63Rj%2BpkeCdwHwBehIYpLcAAAA%3D - // status.Code: ProvisioningState/succeeded - // status.Message - /* - Enable succeeded: - [stdout] - { \"ExitCode\": \"0\", \"Output\": \"Tue Dec 28" , "ExecDuration": "53", "KernelStartTime": "Tue 2024-02-27 21:18:05 UTC" } } - Created temporary directory: /tmp/tmp.jnPaiNfqEn - Collecting system information... - - [stderr] - Bootup is not yet finished. Please try again later. - */ - - // Corner Case 2: https://dataexplorer.azure.com/clusters/aks/databases/AKSprod?query=H4sIAAAAAAAAAz2MOw7CMBAFe06xcm8pRsFOkyIiDcfwbjZgPnZkL59IHB6noRnpSfNmKGukY4rCHxlIwivIuvvC%2B8KZIS2cvYQUTyP0PSj0nTVuRt0gGd3ifNBda7HCccN7h4as%2Br8f5QxUyz7EAmoMxeOdoTyJmCeeNnHJ6cokm1qX%2BBuD%2BQHGxYrxkgAAAA%3D%3D - // status.Code: ProvisioningState/succeeded - // status.Message - /* - Disable succeeded - */ - - // Failed Case 1: https://dataexplorer.azure.com/clusters/aks/databases/AKSprod?query=H4sIAAAAAAAAA1WNzQ6CMBCE7z7FpndMSAv%2BJBwIXnyMtV2kaltCF4HEh7fEaOJtJvPNTB0Xr5vgmWauNdun5WXzgqmjgSD0NCDb4M8nqCoQSkmTt7rMioORmdoRZvs9qcyoiymoxFJKJeBXd%2FEKOk2j9RFEi%2FZBBjgAzaRHppQ5h94cvwKYBmc9csImy10CLUNk5DFWhRSwMv%2Bjn3DbBEMi%2FfZDuJHmFUqO8U6QvwH2%2FZiC4gAAAA%3D%3D - // status.Code: ProvisioningState/failed/0 - // status.Message - /* - Enable failed: failed to execute command: command terminated with exit status=53 - [stdout] - (deflated 82%) - adding: var/log/azure/Microsoft.Azure.Monitor.AzureMonitorLinuxAgent/CommandExecution.log (deflated 76%) - adding: var/log/azure/Microsoft.Azure.Monitor.AzureMonitorLinuxAgent/extension.log (deflated 79%) - adding: var/log/syslog (deflated 90%) - adding: var/log/syslog.1 (deflated 82%) - adding: var/log/syslog.2.gz (deflated 5%) - [stderr] - Bootup is not yet finished. Please try again later. - */ - - // Failed Case 2: https://dataexplorer.azure.com/clusters/aks/databases/AKSprod?query=H4sIAAAAAAAAA12MOw7CMBAFe06xcm%2BUj6VAkSJKGo6xWa%2FBQOwo3gCRODymoaB50khvpktboD4G4Zd0JP7hZdu94XnhhSHOvKD4GE4DtC2og0NDNZJmR6SNIdRYVIU%2BVo5HY8umamoFP31KZ6CcRh8SKC8wrUlgZEgzk3eeLcRw3%2FIQK8Bg%2F4wkKGva99GyytF5iVcm%2BZ4yCd4Yyg8BJ8iuvwAAAA%3D%3D - // status.Code: ProvisioningState/failed/0 - // status.Message - /* - Enable failed: failed to get configuration: invalid configuration: 'commandToExecute' was specified both in public and protected settings; it must be specified only once - */ - - // Base Case and Corner Case, we should return valid CSEStatus - // Failed Case 1, we should return exitCode and filter out those VMs and recreate - // Failed Case 2, we should return error and filter out those VMs and recreate if status.Code == nil || status.Message == nil { t.Logf("No valid Status code or Message provided from cse extension") return nil, datamodel.NewError(datamodel.InvalidCSEMessage, "No valid Status code or Message provided from cse extension") diff --git a/node-bootstrapper/consts.go b/node-bootstrapper/const.go similarity index 100% rename from node-bootstrapper/consts.go rename to node-bootstrapper/const.go