Skip to content

Commit

Permalink
vcsim: propagate VMwareDVSConfigSpec in CreateDVS_Task
Browse files Browse the repository at this point in the history
Fixes #3264
  • Loading branch information
dougm committed Nov 8, 2023
1 parent a092311 commit e19137f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
13 changes: 13 additions & 0 deletions govc/test/network.bats
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@

load test_helper

@test "network dvs" {
vcsim_env

run govc dvs.create -discovery-protocol cdp -product-version 6.6.0 -mtu 1500 DVS1
assert_success

dvs=$(govc object.collect -o -json network/DVS1)

assert_equal cdp "$(jq -r .config.linkDiscoveryProtocolConfig.protocol <<<"$dvs")"
assert_equal 1500 "$(jq -r .config.maxMtu <<<"$dvs")"
assert_equal 6.6.0 "$(jq -r .summary.productInfo.version <<<"$dvs")"
}

@test "network dvs backing" {
vcsim_env

Expand Down
9 changes: 9 additions & 0 deletions simulator/folder.go
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,15 @@ func (f *Folder) CreateDVSTask(ctx *Context, req *types.CreateDVS_Task) soap.Has
},
}

if spec, ok := req.Spec.ConfigSpec.(*types.VMwareDVSConfigSpec); ok {
configInfo.LinkDiscoveryProtocolConfig = spec.LinkDiscoveryProtocolConfig
configInfo.MaxMtu = spec.MaxMtu
configInfo.IpfixConfig = spec.IpfixConfig
configInfo.LacpApiVersion = spec.LacpApiVersion
configInfo.MulticastFilteringMode = spec.MulticastFilteringMode
configInfo.NetworkOffloadSpecId = spec.NetworkOffloadSpecId
}

if spec.Contact != nil {
configInfo.Contact = *spec.Contact
}
Expand Down

0 comments on commit e19137f

Please sign in to comment.