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 f204ecd550..fb5ed586c5 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 @@ -21,20 +21,48 @@ Suite Teardown Run Keyword And Ignore Error Nimbus Cleanup ${list} *** Keywords *** Static IP Address Create [Timeout] 110 minutes + Log To Console Starting Static IP Address test... Set Suite Variable ${NIMBUS_LOCATION} NIMBUS_LOCATION=wdc Run Keyword And Ignore Error Nimbus Cleanup ${list} ${false} + ${name}= Evaluate 'vic-5-26-' + str(random.randint(1000,9999)) modules=random + ${out}= Deploy Nimbus Testbed %{NIMBUS_USER} %{NIMBUS_PASSWORD} --noSupportBundles --plugin testng --vcvaBuild ${VC_VERSION} --esxBuild ${ESX_VERSION} --testbedName vic-simple-cluster --testbedSpecRubyFile /dbc/pa-dbc1111/mhagen/nimbus-testbeds/testbeds/vic-simple-cluster.rb --runName ${name} + Open Connection %{NIMBUS_GW} Wait Until Keyword Succeeds 10 min 30 sec Login %{NIMBUS_USER} %{NIMBUS_PASSWORD} - ${esx1} ${esx2} ${esx3} ${vc} ${esx1-ip} ${esx2-ip} ${esx3-ip} ${vc-ip}= Create a Simple VC Cluster dc1 cls - Log To Console Finished Creating Cluster ${vc} - Set Suite Variable @{list} ${esx1} ${esx2} ${esx3} %{NIMBUS_USER}-${vc} + ${vc-ip}= Get IP ${name}.vc.0 + ${pod}= Fetch POD ${name}.vc.0 + Set Suite Variable ${NIMBUS_POD} ${pod} + Close Connection + + Set Suite Variable @{list} %{NIMBUS_USER}-${name}.esx.0 %{NIMBUS_USER}-${name}.esx.1 %{NIMBUS_USER}-${name}.esx.2 %{NIMBUS_USER}-${name}.nfs.0 %{NIMBUS_USER}-${name}.vc.0 + Log To Console Finished Creating Cluster ${name} ${out}= Get Static IP Address Set Suite Variable ${static} ${out} - Append To List ${list} %{STATIC_WORKER_NAME} + Append To List ${list} %{STATIC_WORKER_NAME} + + Log To Console Set environment variables up for GOVC + Set Environment Variable GOVC_URL ${vc-ip} + 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 + Set Environment Variable TEST_PASSWORD Admin\!23 + Set Environment Variable BRIDGE_NETWORK bridge + Set Environment Variable PUBLIC_NETWORK vm-network + Remove Environment Variable TEST_DATACENTER + Set Environment Variable TEST_DATASTORE nfs0-1 + Set Environment Variable TEST_RESOURCE cls + Set Environment Variable TEST_TIMEOUT 15m *** Test Cases *** Test Log To Console \nStarting test... + Custom Testbed Keepalive /dbc/pa-dbc1111/mhagen + Install VIC Appliance To Test Server additional-args=--public-network-ip &{static}[ip]/&{static}[netmask] --public-network-gateway &{static}[gateway] --dns-server 10.170.16.48 Run Regression Tests \ No newline at end of file diff --git a/tests/resources/Nimbus-Util.robot b/tests/resources/Nimbus-Util.robot index 122de3a15c..3541dfd1a5 100644 --- a/tests/resources/Nimbus-Util.robot +++ b/tests/resources/Nimbus-Util.robot @@ -443,16 +443,23 @@ Create Static IP Worker Open Connection %{NIMBUS_GW} Wait Until Keyword Succeeds 10 min 30 sec Login %{NIMBUS_USER} %{NIMBUS_PASSWORD} Log To Console Create a new static ip address worker... - ${out}= Execute Command ${NIMBUS_LOCATION} nimbus-ctl --silentObjectNotFoundError kill '%{NIMBUS_USER}-static-worker' && ${NIMBUS_LOCATION} nimbus-worker-deploy --enableStaticIpService static-worker + ${name}= Evaluate 'static-worker-' + str(random.randint(1000,9999)) + str(time.clock()) modules=random,time + Log To Console \nDeploying static ip worker: ${name} + ${out}= Execute Command ${NIMBUS_LOCATION} nimbus-ctl --silentObjectNotFoundError kill '%{NIMBUS_USER}-static-worker' && ${NIMBUS_LOCATION} nimbus-worker-deploy --nimbus ${NIMBUS_POD} --enableStaticIpService ${name} Should Contain ${out} "deploy_status": "success" - Set Environment Variable STATIC_WORKER_NAME %{NIMBUS_USER}-static-worker - ${ip}= Get IP static-worker + + ${pod}= Fetch POD ${name} + Run Keyword If '${pod}' != '${NIMBUS_POD}' Kill Nimbus Server %{NIMBUS_USER} %{NIMBUS_PASSWORD} %{NIMBUS_USER}-${name} + Run Keyword If '${pod}' != '${NIMBUS_POD}' Fail Nimbus pod suggestion failed + + Set Environment Variable STATIC_WORKER_NAME %{NIMBUS_USER}-${name} + ${ip}= Get IP ${name} Set Environment Variable STATIC_WORKER_IP ${ip} Close Connection Get Static IP Address ${status} ${message}= Run Keyword And Ignore Error Environment Variable Should Be Set STATIC_WORKER_IP - Run Keyword If '${status}' == 'FAIL' Create Static IP Worker + Run Keyword If '${status}' == 'FAIL' Wait Until Keyword Succeeds 10x 10s Create Static IP Worker Log To Console Curl a new static ip address from the created worker... ${out}= Run curl -s http://%{STATIC_WORKER_IP}:4827/nsips diff --git a/tests/resources/nimbus-testbeds/vic-simple-cluster.rb b/tests/resources/nimbus-testbeds/vic-simple-cluster.rb new file mode 100644 index 0000000000..80547d6da6 --- /dev/null +++ b/tests/resources/nimbus-testbeds/vic-simple-cluster.rb @@ -0,0 +1,99 @@ +oneGB = 1 * 1000 * 1000 # in KB + +$testbed = Proc.new do + { + "name" => "vic-simple-cluster", + "version" => 3, + "esx" => (0..2).map do | idx | + { + "name" => "esx.#{idx}", + "vc" => "vc.0", + "style" => "fullInstall", + "desiredPassword" => "e2eFunctionalTest", + "disks" => [ 30 * oneGB, 30 * oneGB, 30 * oneGB], + "nics" => 2, + "mountNfs" => ["nfs.0"], + "clusterName" => "cls", + } + end, + + "nfs" => [ + { + "name" => "nfs.0", + "type" => "NFS41" + } + ], + + "vcs" => [ + { + "name" => "vc.0", + "type" => "vcva", + "dcName" => "dc1", + "clusters" => [{"name" => "cls", "vsan" => false, "enableDrs" => true, "enableHA" => true}], + "addHosts" => "allInSameCluster", + } + ], + + "postBoot" => Proc.new do |runId, testbedSpec, vmList, catApi, logDir| + esxList = vmList['esx'] + esxList.each do |host| + host.ssh do |ssh| + ssh.exec!("esxcli network firewall set -e false") + end + end + vc = vmList['vc'][0] + vim = VIM.connect vc.rbvmomiConnectSpec + datacenters = vim.serviceInstance.content.rootFolder.childEntity.grep(RbVmomi::VIM::Datacenter) + raise "Couldn't find a Datacenter precreated" if datacenters.length == 0 + datacenter = datacenters.first + Log.info "Found a datacenter successfully in the system, name: #{datacenter.name}" + clusters = datacenter.hostFolder.children + raise "Couldn't find a cluster precreated" if clusters.length == 0 + cluster = clusters.first + Log.info "Found a cluster successfully in the system, name: #{cluster.name}" + + dvs = datacenter.networkFolder.CreateDVS_Task( + :spec => { + :configSpec => { + :name => "test-ds" + }, + } + ).wait_for_completion + Log.info "Vds DSwitch created" + + dvpg1 = dvs.AddDVPortgroup_Task( + :spec => [ + { + :name => "management", + :type => :earlyBinding, + :numPorts => 12, + } + ] + ).wait_for_completion + Log.info "management DPG created" + + dvpg2 = dvs.AddDVPortgroup_Task( + :spec => [ + { + :name => "vm-network", + :type => :earlyBinding, + :numPorts => 12, + } + ] + ).wait_for_completion + Log.info "vm-network DPG created" + + dvpg3 = dvs.AddDVPortgroup_Task( + :spec => [ + { + :name => "bridge", + :type => :earlyBinding, + :numPorts => 12, + } + ] + ).wait_for_completion + Log.info "bridge DPG created" + end + } +end +