Skip to content

Commit 46c1d6f

Browse files
author
Kanan Mehta
committed
test: add test for nodepool update with artifact streaming
1 parent 2d90542 commit 46c1d6f

File tree

1 file changed

+96
-0
lines changed

1 file changed

+96
-0
lines changed

src/aks-preview/azext_aks_preview/tests/latest/test_aks_commands.py

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16443,6 +16443,102 @@ def test_aks_nodepool_update_with_artifact_streaming(
1644316443
],
1644416444
)
1644516445

16446+
@live_only()
16447+
@AllowLargeResponse()
16448+
@AKSCustomResourceGroupPreparer(
16449+
random_name_length=17, name_prefix="clitest", location="eastus"
16450+
)
16451+
def test_aks_nodepool_update_with_disable_artifact_streaming(
16452+
self, resource_group, resource_group_location
16453+
):
16454+
aks_name = self.create_random_name("cliakstest", 16)
16455+
nodepool_name = self.create_random_name("n", 6)
16456+
16457+
self.kwargs.update(
16458+
{
16459+
"resource_group": resource_group,
16460+
"name": aks_name,
16461+
"location": resource_group_location,
16462+
"ssh_key_value": self.generate_ssh_keys(),
16463+
"node_pool_name": nodepool_name,
16464+
"node_vm_size": "standard_d2s_v3",
16465+
}
16466+
)
16467+
16468+
self.cmd(
16469+
"aks create "
16470+
"--resource-group={resource_group} "
16471+
"--name={name} "
16472+
"--location={location} "
16473+
"--ssh-key-value={ssh_key_value} "
16474+
"--nodepool-name={node_pool_name} "
16475+
"--node-count=1 "
16476+
"--node-vm-size={node_vm_size} "
16477+
"--aks-custom-headers AKSHTTPCustomFeatures=Microsoft.ContainerService/ArtifactStreamingPreview",
16478+
checks=[
16479+
self.check("provisioningState", "Succeeded"),
16480+
],
16481+
)
16482+
16483+
# disable artifact streaming on a nodepool that never had it enabled
16484+
self.cmd(
16485+
"aks nodepool update "
16486+
"--resource-group={resource_group} "
16487+
"--cluster-name={name} "
16488+
"--name={node_pool_name} "
16489+
"--disable-artifact-streaming "
16490+
"--aks-custom-headers AKSHTTPCustomFeatures=Microsoft.ContainerService/ArtifactStreamingPreview",
16491+
checks=[
16492+
self.check("provisioningState", "Succeeded"),
16493+
self.check(
16494+
"artifactStreamingProfile.enabled", False
16495+
),
16496+
],
16497+
)
16498+
16499+
# enable artifact streaming
16500+
self.cmd(
16501+
"aks nodepool update "
16502+
"--resource-group={resource_group} "
16503+
"--cluster-name={name} "
16504+
"--name={node_pool_name} "
16505+
"--enable-artifact-streaming "
16506+
"--aks-custom-headers AKSHTTPCustomFeatures=Microsoft.ContainerService/ArtifactStreamingPreview",
16507+
checks=[
16508+
self.check("provisioningState", "Succeeded"),
16509+
self.check(
16510+
"artifactStreamingProfile.enabled", True
16511+
),
16512+
],
16513+
)
16514+
16515+
# disable artifact streaming
16516+
self.cmd(
16517+
"aks nodepool update "
16518+
"--resource-group={resource_group} "
16519+
"--cluster-name={name} "
16520+
"--name={node_pool_name} "
16521+
"--disable-artifact-streaming "
16522+
"--aks-custom-headers AKSHTTPCustomFeatures=Microsoft.ContainerService/ArtifactStreamingPreview",
16523+
checks=[
16524+
self.check("provisioningState", "Succeeded"),
16525+
self.check(
16526+
"artifactStreamingProfile.enabled", False
16527+
),
16528+
],
16529+
)
16530+
16531+
# delete
16532+
cmd = (
16533+
"aks delete --resource-group={resource_group} --name={name} --yes --no-wait"
16534+
)
16535+
self.cmd(
16536+
cmd,
16537+
checks=[
16538+
self.is_empty(),
16539+
],
16540+
)
16541+
1644616542
@AllowLargeResponse()
1644716543
@AKSCustomResourceGroupPreparer(
1644816544
random_name_length=17, name_prefix="clitest", location="westus2"

0 commit comments

Comments
 (0)