Skip to content

Commit dd6bf66

Browse files
committed
vcsim: Improve sim for pub/sub content libs
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 <[email protected]>
1 parent eff7c95 commit dd6bf66

File tree

9 files changed

+1031
-78
lines changed

9 files changed

+1031
-78
lines changed

govc/test/library.bats

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ load test_helper
223223
run govc library.import -pull -c fake -a MD5 -n invalid-md5 my-content "https://$(govc env GOVC_URL)/folder/$TTYLINUX_NAME.ova"
224224
assert_failure # invalid checksum
225225

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

@@ -668,7 +668,14 @@ EOF
668668
run govc library.sync subscribed-content/ttylinux-latest
669669
assert_success
670670

671-
# assert cached is false after item sync
671+
# assert cached is false after item sync for ondemand library sans -f=true (force)
672+
cached=$(govc library.info subscribed-content/ttylinux-latest | grep Cached: | awk '{print $2}')
673+
assert_equal "false" "$cached"
674+
675+
run govc library.sync -f=true subscribed-content/ttylinux-latest
676+
assert_success
677+
678+
# assert cached is true after item sync with -f=true (force)
672679
cached=$(govc library.info subscribed-content/ttylinux-latest | grep Cached: | awk '{print $2}')
673680
assert_equal "true" "$cached"
674681

0 commit comments

Comments
 (0)