Skip to content

Commit

Permalink
vcsim: Improve sim for pub/sub content libs
Browse files Browse the repository at this point in the history
This patch greatly improves the experience when simulating subscribed
content libraries. The libraries now more accurately simulate syncing,
as well as maintain actual copies of the published items instead of
referencing the original items. This means the subscribed items will
have unique item IDs as they do in the real system.

Signed-off-by: akutz <akutz@vmware.com>
  • Loading branch information
akutz committed Dec 30, 2024
1 parent eff7c95 commit dd6bf66
Show file tree
Hide file tree
Showing 9 changed files with 1,031 additions and 78 deletions.
11 changes: 9 additions & 2 deletions govc/test/library.bats
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ load test_helper
run govc library.import -pull -c fake -a MD5 -n invalid-md5 my-content "https://$(govc env GOVC_URL)/folder/$TTYLINUX_NAME.ova"
assert_failure # invalid checksum

sum=$(md5sum "$GOVC_IMAGES/$TTYLINUX_NAME.ovf" | awk '{print $1}')
sum=$(md5sum "$GOVC_IMAGES/$TTYLINUX_NAME.ova" | awk '{print $1}')
run govc library.import -pull -c "$sum" -a MD5 -n ttylinux-unpacked my-content "https://$(govc env GOVC_URL)/folder/$TTYLINUX_NAME.ova"
assert_success

Expand Down Expand Up @@ -668,7 +668,14 @@ EOF
run govc library.sync subscribed-content/ttylinux-latest
assert_success

# assert cached is false after item sync
# assert cached is false after item sync for ondemand library sans -f=true (force)
cached=$(govc library.info subscribed-content/ttylinux-latest | grep Cached: | awk '{print $2}')
assert_equal "false" "$cached"

run govc library.sync -f=true subscribed-content/ttylinux-latest
assert_success

# assert cached is true after item sync with -f=true (force)
cached=$(govc library.info subscribed-content/ttylinux-latest | grep Cached: | awk '{print $2}')
assert_equal "true" "$cached"

Expand Down
Loading

0 comments on commit dd6bf66

Please sign in to comment.