Skip to content

Commit fb71f4c

Browse files
mfoster58mfoster58
andauthored
Adding test for continue update cluster to NetworkCloudClusterTests (Azure#49235)
* adding continue cluster update test * recording cluster tests * update sanitizer & rerecord * fix sanitizer * add container sanitizer --------- Co-authored-by: mfoster58 <[email protected]>
1 parent c110e54 commit fb71f4c

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

sdk/networkcloud/Azure.ResourceManager.NetworkCloud/assets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"AssetsRepo": "Azure/azure-sdk-assets",
33
"AssetsRepoPrefixPath": "net",
44
"TagPrefix": "net/networkcloud/Azure.ResourceManager.NetworkCloud",
5-
"Tag": "net/networkcloud/Azure.ResourceManager.NetworkCloud_b263140953"
5+
"Tag": "net/networkcloud/Azure.ResourceManager.NetworkCloud_9079956b9a"
66
}

sdk/networkcloud/Azure.ResourceManager.NetworkCloud/tests/NetworkCloudManagementTestBase.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ protected NetworkCloudManagementTestBase(bool isAsync)
3131
: base(isAsync)
3232
{
3333
BodyKeySanitizers.Add(new BodyKeySanitizer("properties.vmImageRepositoryCredentials.password") { Value = "fake-password123" });
34+
BodyKeySanitizers.Add(new BodyKeySanitizer("..containerUrl") { Value = "https://sanitized.blob.core.windows.net/container" });
3435
BodyKeySanitizers.Add(new BodyKeySanitizer("..vaultUri") { Value = "https://sanitized.vault.azure.net" });
3536

3637
SanitizersToRemove.Add("AZSDK3402");

sdk/networkcloud/Azure.ResourceManager.NetworkCloud/tests/Scenario/NetworkCloudClustersTests.cs

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,22 @@ public async Task NetworkCloudClusters()
198198
catch (Exception ex)
199199
{
200200
// special case: if the cluster was never deployed, version update (CUVA) is not allowed
201-
// once the API bug is resolved this can be used. Until then, will compare 2 strings instead
202-
// StringAssert.Contains($"cluster conditions do not pass validation for cluster {clusterName}: ClusterDeployedCondition is not True", ex.Message);
203-
StringAssert.Contains("cluster conditions do not pass validation for cluster", ex.Message);
204-
StringAssert.Contains("ClusterDeployedCondition is not True", ex.Message);
201+
StringAssert.Contains($"cluster conditions do not pass validation for cluster {clusterName}: ClusterDeployedCondition is not True", ex.Message);
202+
}
203+
204+
// Continue Cluster Update Version
205+
try
206+
{
207+
ClusterContinueUpdateVersionContent continueUpdateContent = new ClusterContinueUpdateVersionContent
208+
{
209+
MachineGroupTargetingMode = ClusterContinueUpdateVersionMachineGroupTargetingMode.AlphaByRack
210+
};
211+
var updatedClusterResult = await clusterResource.ContinueUpdateVersionAsync(WaitUntil.Completed, continueUpdateContent);
212+
}
213+
catch (Exception ex)
214+
{
215+
// special case: if the cluster was never deployed, version update (CUVA) is not allowed
216+
StringAssert.Contains($"cluster {clusterName} does not have suitable conditions to continue to update", ex.Message);
205217
}
206218

207219
// Delete

0 commit comments

Comments
 (0)