From 1edbf58d239d68ecd0e4cd5be96d0878d8c5c1ec Mon Sep 17 00:00:00 2001 From: Mikkel Hagen Date: Wed, 14 Feb 2018 14:50:21 -0600 Subject: [PATCH] [skip ci] Add hosts to DVS within the test bed as well --- .../5-26-Static-IP-Address.robot | 2 -- .../nimbus-testbeds/vic-simple-cluster.rb | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/tests/manual-test-cases/Group5-Functional-Tests/5-26-Static-IP-Address.robot b/tests/manual-test-cases/Group5-Functional-Tests/5-26-Static-IP-Address.robot index fb5ed586c5..ae3571fb13 100644 --- a/tests/manual-test-cases/Group5-Functional-Tests/5-26-Static-IP-Address.robot +++ b/tests/manual-test-cases/Group5-Functional-Tests/5-26-Static-IP-Address.robot @@ -46,8 +46,6 @@ Static IP Address Create Set Environment Variable GOVC_USERNAME Administrator@vsphere.local Set Environment Variable GOVC_PASSWORD Admin\!23 - Add Host To Distributed Switch /dc1/host/cls - Log To Console Deploy VIC to the VC cluster Set Environment Variable TEST_URL_ARRAY ${vc-ip} Set Environment Variable TEST_USERNAME Administrator@vsphere.local diff --git a/tests/resources/nimbus-testbeds/vic-simple-cluster.rb b/tests/resources/nimbus-testbeds/vic-simple-cluster.rb index 80547d6da6..cf649b18fc 100644 --- a/tests/resources/nimbus-testbeds/vic-simple-cluster.rb +++ b/tests/resources/nimbus-testbeds/vic-simple-cluster.rb @@ -93,6 +93,23 @@ ] ).wait_for_completion Log.info "bridge DPG created" + + Log.info "Add hosts to the DVS" + onecluster_pnic_spec = [ VIM::DistributedVirtualSwitchHostMemberPnicSpec({:pnicDevice => 'vmnic1'}) ] + dvs_config = VIM::DVSConfigSpec({ + :configVersion => dvs.config.configVersion, + :host => cluster.host.map do |host| + { + :operation => :add, + :host => host, + :backing => VIM::DistributedVirtualSwitchHostMemberPnicBacking({ + :pnicSpec => onecluster_pnic_spec + }) + } + end + }) + dvs.ReconfigureDvs_Task(:spec => dvs_config).wait_for_completion + Log.info "Hosts added to DVS successfully" end } end