Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
Lily Pan committed Oct 29, 2024
1 parent fe869bd commit 285b8d7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 75 deletions.
7 changes: 3 additions & 4 deletions e2e/const.go
Original file line number Diff line number Diff line change
@@ -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+)`
)
71 changes: 0 additions & 71 deletions e2e/scenario_helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
File renamed without changes.

0 comments on commit 285b8d7

Please sign in to comment.