Skip to content

Commit

Permalink
govc: add more cases for namespace.update in namespace.bats
Browse files Browse the repository at this point in the history
Signed-off-by: Stoyan Zhelyazkov <[email protected]>
  • Loading branch information
spacegospod committed Apr 9, 2024
1 parent e89edd2 commit aeb64c5
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions govc/test/namespace.bats
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,22 @@ load test_helper
assert_equal "1" $(echo $ns | jq -r '."vm_service_spec"."vm_classes"' | jq length)
assert_equal "class1" $(echo $ns | jq -r '."vm_service_spec"."vm_classes"[0]')

run govc namespace.update -content-libraries=lib3 test-namespace-1
assert_success

ns=$(govc namespace.info test-namespace-1 | jq)
assert_equal "1" $(echo $ns | jq -r '."vm_service_spec"."content_libraries"' | jq length)
assert_equal "lib3" $(echo $ns | jq -r '."vm_service_spec"."content_libraries"[0]')
assert_equal "0" $(echo $ns | jq -r '."vm_service_spec"."vm_classes"' | jq length)

run govc namespace.update -vm-classes=class3 test-namespace-1
assert_success

ns=$(govc namespace.info test-namespace-1 | jq)
assert_equal "0" $(echo $ns | jq -r '."vm_service_spec"."content_libraries"' | jq length)
assert_equal "1" $(echo $ns | jq -r '."vm_service_spec"."vm_classes"' | jq length)
assert_equal "class3" $(echo $ns | jq -r '."vm_service_spec"."vm_classes"[0]')

run govc namespace.update -content-libraries=lib1,lib2 -vm-classes=class1 non-existing-namespace
assert_failure
assert_matches "404 Not Found"
Expand Down

0 comments on commit aeb64c5

Please sign in to comment.