Skip to content

Commit

Permalink
Fixed that the nimbus-testbeddeploy commands is not working (#8673)
Browse files Browse the repository at this point in the history
  • Loading branch information
ading007 authored Jun 10, 2022
1 parent 6c70cfe commit 9489f63
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions tests/resources/Nimbus-Util.robot
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ ${NIMBUS_LOCATION_FULL} NIMBUS_LOCATION=${NIMBUS_LOCATION}
*** Keywords ***
Fetch IP
[Arguments] ${name}
${out}= Execute Command ${NIMBUS_LOCATION_FULL} USER=%{NIMBUS_PERSONAL_USER} nimbus-ctl ip %{NIMBUS_PERSONAL_USER}-${name} | grep %{NIMBUS_PERSONAL_USER}-${name}
${out}= Execute Command ${NIMBUS_LOCATION_FULL} USER=%{NIMBUS_PERSONAL_USER} %{NIMBUS_CLI_PATH}/nimbus-ctl ip %{NIMBUS_PERSONAL_USER}-${name} | grep %{NIMBUS_PERSONAL_USER}-${name}
Should Not Be Empty ${out}
${len}= Get Line Count ${out}
Should Be Equal As Integers ${len} 1
Expand All @@ -39,7 +39,7 @@ Get IP

Fetch POD
[Arguments] ${name}
${out}= Execute Command ${NIMBUS_LOCATION_FULL} USER=%{NIMBUS_PERSONAL_USER} nimbus-ctl list | grep ${name} | awk '{print $1}' | uniq | head -1
${out}= Execute Command ${NIMBUS_LOCATION_FULL} USER=%{NIMBUS_PERSONAL_USER} %{NIMBUS_CLI_PATH}/nimbus-ctl list | grep ${name} | awk '{print $1}' | uniq | head -1
Should Not Be Empty ${out}
${len}= Get Line Count ${out}
Should Be Equal As Integers ${len} 1
Expand All @@ -54,7 +54,7 @@ Deploy Nimbus ESXi Server
Wait Until Keyword Succeeds 2 min 30 sec Login ${user} ${password}

:FOR ${IDX} IN RANGE 1 5
\ ${out}= Execute Command ${NIMBUS_LOCATION_FULL} USER=%{NIMBUS_PERSONAL_USER} nimbus-esxdeploy ${name} --disk=48000000 --ssd=24000000 --memory=8192 --lease=0.25 --nics 2 ${version}
\ ${out}= Execute Command ${NIMBUS_LOCATION_FULL} USER=%{NIMBUS_PERSONAL_USER} %{NIMBUS_CLI_PATH}/nimbus-esxdeploy ${name} ‐‐resultsDir %{RESULTS_DIR} --disk=48000000 --ssd=24000000 --memory=8192 --lease=0.25 --nics 2 ${version}
\ Log ${out}
\ # Make sure the deploy actually worked
\ ${status}= Run Keyword And Return Status Should Contain ${out} To manage this VM use
Expand Down Expand Up @@ -144,7 +144,7 @@ Deploy Nimbus vCenter Server
Wait Until Keyword Succeeds 2 min 30 sec Login ${user} ${password}

:FOR ${IDX} IN RANGE 1 5
\ ${out}= Execute Command ${NIMBUS_LOCATION_FULL} USER=%{NIMBUS_PERSONAL_USER} nimbus-vcvadeploy --lease=0.25 --vcvaBuild ${version} ${name}
\ ${out}= Execute Command ${NIMBUS_LOCATION_FULL} USER=%{NIMBUS_PERSONAL_USER} %{NIMBUS_CLI_PATH}/nimbus-vcvadeploy ‐‐resultsDir %{RESULTS_DIR} --lease=0.25 --vcvaBuild ${version} ${name}
\ Log ${out}
\ # Make sure the deploy actually worked
\ ${status}= Run Keyword And Return Status Should Contain ${out} Overall Status: Succeeded
Expand All @@ -171,7 +171,7 @@ Deploy Nimbus ESXi Server Async
[Tags] secret
[Arguments] ${name} ${version}=${ESX_VERSION}
Log To Console \nDeploying Nimbus ESXi server: ${name}
${out}= Run Secret SSHPASS command %{NIMBUS_USER} '%{NIMBUS_PASSWORD}' '${NIMBUS_LOCATION_FULL} USER=%{NIMBUS_PERSONAL_USER} nimbus-esxdeploy ${name} --disk\=48000000 --ssd\=24000000 --memory\=8192 --lease=0.25 --nics 2 ${version}'
${out}= Run Secret SSHPASS command %{NIMBUS_USER} '%{NIMBUS_PASSWORD}' '${NIMBUS_LOCATION_FULL} USER=%{NIMBUS_PERSONAL_USER} %{NIMBUS_CLI_PATH}/nimbus-esxdeploy ${name} ‐‐resultsDir %{RESULTS_DIR} --disk\=48000000 --ssd\=24000000 --memory\=8192 --lease=0.25 --nics 2 ${version}'
[Return] ${out}

Run Secret SSHPASS command
Expand All @@ -186,7 +186,7 @@ Deploy Nimbus vCenter Server Async
[Arguments] ${name} ${version}=${VC_VERSION}
Log To Console \nDeploying Nimbus VC server: ${name}

${out}= Run Secret SSHPASS command %{NIMBUS_USER} '%{NIMBUS_PASSWORD}' '${NIMBUS_LOCATION_FULL} USER=%{NIMBUS_PERSONAL_USER} nimbus-vcvadeploy --lease=0.25 --vcvaBuild ${version} ${name}'
${out}= Run Secret SSHPASS command %{NIMBUS_USER} '%{NIMBUS_PASSWORD}' '${NIMBUS_LOCATION_FULL} USER=%{NIMBUS_PERSONAL_USER} %{NIMBUS_CLI_PATH}/nimbus-vcvadeploy ‐‐resultsDir %{RESULTS_DIR} --lease=0.25 --vcvaBuild ${version} ${name}'
[Return] ${out}

# Deploys a nimbus testbed based on the specified testbed spec and options
Expand All @@ -200,22 +200,22 @@ Deploy Nimbus Testbed
[Arguments] ${user}=%{NIMBUS_USER} ${password}=%{NIMBUS_PASSWORD} ${spec}=${EMPTY} ${args}=${EMPTY}

Run Keyword And Ignore Error Cleanup Nimbus Folders deletePXE=${true}
${suffix}= Generate Random String 5
${specarg}= Set Variable If '${spec}' == '${EMPTY}' ${EMPTY} --testbedSpecRubyFile ./%{BUILD_TAG}/testbeds/${spec}-${suffix}
${prefix}= Generate Random String 5
${specarg}= Set Variable If '${spec}' == '${EMPTY}' ${EMPTY} --testbedSpecRubyFile ./%{BUILD_TAG}/testbeds/${prefix}-${spec}

Open Connection %{NIMBUS_GW}
Wait Until Keyword Succeeds 2 min 30 sec Login ${user} ${password}

:FOR ${IDX} IN RANGE 1 5
\ Exit For Loop If '${spec}' == '${EMPTY}'
\ ${status}= Run Keyword And Return Status Put File tests/resources/nimbus-testbeds/${spec} destination=./%{BUILD_TAG}/testbeds/${spec}-${suffix}
\ ${status}= Run Keyword And Return Status Put File tests/resources/nimbus-testbeds/${spec} destination=./%{BUILD_TAG}/testbeds/${prefix}-${spec}
\ Log ${status}
\ Sleep 3
\ ${status}= Run Keyword And Return Status SSHLibrary.File Should Exist ./%{BUILD_TAG}/testbeds/${spec}-${suffix}
\ ${status}= Run Keyword And Return Status SSHLibrary.File Should Exist ./%{BUILD_TAG}/testbeds/${prefix}-${spec}
\ Log ${status}
\ Run Keyword If ${status}== False Continue For Loop
\ Sleep 3
\ ${out}= Execute Command ${NIMBUS_LOCATION_FULL} USER=%{NIMBUS_PERSONAL_USER} nimbus-testbeddeploy --lease 0.25 ${specarg} ${args}
\ ${out}= Execute Command ${NIMBUS_LOCATION_FULL} USER=%{NIMBUS_PERSONAL_USER} %{NIMBUS_CLI_PATH}/nimbus-testbeddeploy --lease 0.25 --resultsDir %{RESULTS_DIR} ${specarg} ${args}
\ Log ${out}
\ # Make sure the deploy actually worked
\ ${status}= Run Keyword And Return Status Should Contain ${out} END TESTBED DEPLOYMENT
Expand All @@ -225,23 +225,23 @@ Deploy Nimbus Testbed

:FOR ${IDX} IN RANGE 1 5
\ Exit For Loop If '${spec}' != '${EMPTY}'
\ ${out}= Execute Command ${NIMBUS_LOCATION_FULL} USER=%{NIMBUS_PERSONAL_USER} nimbus-testbeddeploy --lease 0.25 ${specarg} ${args}
\ ${out}= Execute Command ${NIMBUS_LOCATION_FULL} USER=%{NIMBUS_PERSONAL_USER} %{NIMBUS_CLI_PATH}/nimbus-testbeddeploy --lease 0.25 --resultsDir %{RESULTS_DIR} ${specarg} ${args}
\ Log ${out}
\ # Make sure the deploy actually worked
\ ${status}= Run Keyword And Return Status Should Contain ${out} END TESTBED DEPLOYMENT
\ Return From Keyword If ${status} ${out}
\ Log To Console Nimbus deployment ${IDX} failed, trying again in 1 minute
\ Sleep 1 minutes

Run Keyword Unless '${spec}' == '${EMPTY}' Execute Command rm -rf ./%{BUILD_TAG}/testbeds/${spec}-${suffix}
Run Keyword Unless '${spec}' == '${EMPTY}' Execute Command rm -rf ./%{BUILD_TAG}/testbeds/${prefix}-${spec}

Fail Deploy Nimbus Testbed Failed 5 times over the course of more than 5 minutes

Kill Nimbus Server
[Arguments] ${user} ${password} ${name}
Open Connection %{NIMBUS_GW}
Wait Until Keyword Succeeds 2 min 30 sec Login ${user} ${password}
${out}= Execute Command ${NIMBUS_LOCATION_FULL} USER=%{NIMBUS_PERSONAL_USER} nimbus-ctl kill ${name}
${out}= Execute Command ${NIMBUS_LOCATION_FULL} USER=%{NIMBUS_PERSONAL_USER} %{NIMBUS_CLI_PATH}/nimbus-ctl kill ${name}
Log ${out}
Close connection

Expand Down Expand Up @@ -274,7 +274,7 @@ Nimbus Pod Cleanup
[Arguments] ${nimbus_pod_name} ${testbedname}
Open Connection %{NIMBUS_GW}
Wait Until Keyword Succeeds 10 min 30 sec Login %{NIMBUS_USER} %{NIMBUS_PASSWORD}
Execute Command USER=%{NIMBUS_PERSONAL_USER} NIMBUS=${nimbus_pod_name} nimbus-ctl --nimbusLocation=${NIMBUS_LOCATION} --testbed kill ${testbedname}
Execute Command USER=%{NIMBUS_PERSONAL_USER} NIMBUS=${nimbus_pod_name} %{NIMBUS_CLI_PATH}/nimbus-ctl --nimbusLocation=${NIMBUS_LOCATION} --testbed kill ${testbedname}
Close Connection
Run Keyword And Ignore Error Cleanup Nimbus Folders deletePXE=${True}

Expand Down Expand Up @@ -522,7 +522,7 @@ Deploy Nimbus NFS Datastore
Open Connection %{NIMBUS_GW}
Wait Until Keyword Succeeds 2 min 30 sec Login ${user} ${password}

${out}= Execute Command ${NIMBUS_LOCATION_FULL} USER=%{NIMBUS_PERSONAL_USER} nimbus-nfsdeploy ${name} ${additional-args}
${out}= Execute Command ${NIMBUS_LOCATION_FULL} USER=%{NIMBUS_PERSONAL_USER} %{NIMBUS_CLI_PATH}/nimbus-nfsdeploy ${name} ‐‐resultsDir %{RESULTS_DIR} ${additional-args}
Log ${out}
# Make sure the deploy actually worked
Should Contain ${out} To manage this VM use
Expand Down Expand Up @@ -607,7 +607,7 @@ Create Static IP Worker
Log To Console Create a new static ip address 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_FULL} USER=%{NIMBUS_PERSONAL_USER} nimbus-ctl --silentObjectNotFoundError kill '%{NIMBUS_PERSONAL_USER}-static-worker' && ${NIMBUS_LOCATION_FULL} USER=%{NIMBUS_PERSONAL_USER} nimbus-worker-deploy --nimbus ${NIMBUS_POD} --enableStaticIpService ${name}
${out}= Execute Command ${NIMBUS_LOCATION_FULL} USER=%{NIMBUS_PERSONAL_USER} %{NIMBUS_CLI_PATH}/nimbus-ctl --silentObjectNotFoundError kill '%{NIMBUS_PERSONAL_USER}-static-worker' && ${NIMBUS_LOCATION_FULL} USER=%{NIMBUS_PERSONAL_USER} %{NIMBUS_CLI_PATH}/nimbus-worker-deploy --nimbus ${NIMBUS_POD} --enableStaticIpService ${name}
Should Contain ${out} "deploy_status": "success"

${pod}= Fetch POD ${name}
Expand Down

0 comments on commit 9489f63

Please sign in to comment.