Skip to content

Add a nightly test for vicadmin tests on isolated vch#7793

Merged
8 commits merged intomasterfrom
unknown repository
Apr 24, 2018
Merged

Add a nightly test for vicadmin tests on isolated vch#7793
8 commits merged intomasterfrom
unknown repository

Conversation

@ghost
Copy link

@ghost ghost commented Apr 19, 2018

Fixes #7102

Adds a nightly test that:

  • Spins up a simple vc with a static ip in nimbus
  • Deploys a VCH that is on an isolated public network with no wan connection
  • Runs a variety of vicadmin tests to verify it functions properly without a wan connection.

@@ -0,0 +1,101 @@
# Copyright 2016-2017 VMware, Inc. All Rights Reserved.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: 2018

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks :).

${dvs}= Run govc find -type DistributedVirtualSwitch | head -n1
${rc} ${output}= Run And Return Rc And Output govc dvs.portgroup.add -vlan=${vlan} -dvs ${dvs} dpg-no-wan

${output}= Run bin/vic-machine-linux create --debug 1 --name=%{VCH-NAME} --target=%{TEST_URL}%{TEST_DATACENTER} --thumbprint=%{TEST_THUMBPRINT} --user=%{TEST_USERNAME} --image-store=%{TEST_DATASTORE} --password=%{TEST_PASSWORD} --force=true --compute-resource=%{TEST_RESOURCE} --no-tlsverify --bridge-network=%{BRIDGE_NETWORK} --management-network=%{PUBLIC_NETWORK} --client-network=%{PUBLIC_NETWORK} --client-network-ip &{static}[ip]/&{static}[netmask] --client-network-gateway &{static}[gateway] --public-network dpg-no-wan --public-network-ip 192.168.100.2/24 --public-network-gateway 192.168.100.1 --dns-server 10.170.16.48 --insecure-registry wdc-harbor-ci.eng.vmware.com
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you want to use Install VIC Appliance To Test Server (from VCH-Util), which supports a ${additional-args} argument (for passing the arguments it doesn't handle by default).

This has a few mostly-minor benefits:

  1. It will verify that the command was successful (in a consistent way)
  2. It will log the output so that you can debug the failure
  3. It will only access %{TEST_PASSWORD} in a secret keyword, so it's not logged
  4. It will take care of calling Get Docker Params for you

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, however, it does not support overriding the --client-network/ip/gateway args.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, that's too bad. In that case I think you'll want to tag your Deploy VCH With No WAN keyword with secret because it's using %{TEST_PASSWORD}.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, ok, thanks.


Get Docker Params ${output} ${false}

Set Environment Variable VIC-ADMIN %{VCH-IP}:2378
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is handled by Get Docker Params

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct, good find, thanks!

Log ${output}
${rc} ${output}= Run And Return Rc and Output ls -l /tmp/${vmName}/vmware.log
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc and Output ls -l /tmp/${vmName}/tether.debug
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also assert that these log files aren't empty?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, good idea.

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is specific to test 5-26, need to make it abstract.


Static IP Address Create
[Timeout] 110 minutes
Log To Console Starting Static IP Address test...
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update comment to not refer test as this is keyword.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

${out}= Execute Command poweroff -d 0 -f
Close connection

Static IP Address Create
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rename this keyword to something like Create Simple VC Cluster Testbed With Static IP

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Setup VCH With No WAN
Deploy VCH With No WAN

Setup VCH With No WAN
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see this is setting up VC and not VCH, so would rename it to Setup VC With No WAN

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Copy link
Contributor

@mdharamadas1 mdharamadas1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few comments but good test coverage!

*** Test Cases ***
Display HTML
Login And Save Cookies
${rc} ${output}= Run And Return Rc And Output curl -sk %{VIC-ADMIN} -b /tmp/cookies-%{VCH-NAME}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Log ${output} for all of these to assist in troubleshooting

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

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}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Log ${out}

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.


Deploy VCH With No WAN
[Tags] secret
${output}= Run bin/vic-machine-linux create --debug 1 --name=%{VCH-NAME} --target=%{TEST_URL}%{TEST_DATACENTER} --thumbprint=%{TEST_THUMBPRINT} --user=%{TEST_USERNAME} --image-store=%{TEST_DATASTORE} --password=%{TEST_PASSWORD} --force=true --compute-resource=%{TEST_RESOURCE} --no-tlsverify --bridge-network=%{BRIDGE_NETWORK} --management-network=%{PUBLIC_NETWORK} --client-network=%{PUBLIC_NETWORK} --client-network-ip &{static}[ip]/&{static}[netmask] --client-network-gateway 10.0.0.0/8:&{static}[gateway] --public-network dpg-no-wan --public-network-ip 192.168.100.2/24 --public-network-gateway 192.168.100.1 --dns-server 10.170.16.48 --insecure-registry wdc-harbor-ci.eng.vmware.com
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest moving this line to a separate secret keyword like Deploy VCH With No WAN Secret that returns output and remove secret from this one so that we can log the returned create output

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@sgairo
Copy link
Contributor

sgairo commented Apr 23, 2018

[skip ci] needs to be in the the header

@sgairo
Copy link
Contributor

sgairo commented Apr 23, 2018

Also need to add 5-28 to TestCases.md in Group 5

@sgairo
Copy link
Contributor

sgairo commented Apr 23, 2018

In fact , sync up with @mhagen-vmware about #7724 , you might want to change your test number to 5-29

@mhagen-vmware
Copy link
Contributor

No need to worry about my unmerged work, I will rebase and renumber whenever I can get that in

@ghost ghost changed the title Add a nightly test for vicadmin tests on isolated vch [skip ci] Add a nightly test for vicadmin tests on isolated vch Apr 24, 2018
@ghost
Copy link
Author

ghost commented Apr 24, 2018

Passing the affected tests:

[vic-integration-test-on-pr:L12:0s] 5-26-Static-IP-Address
[vic-integration-test-on-pr:L13:0s] 
==============================================================================
[vic-integration-test-on-pr:L16:1875s] Finished Creating Cluster vic-5-26-2060
[vic-integration-test-on-pr:L17:1877s] Create a new static ip address worker...
[vic-integration-test-on-pr:L18:1877s]
[vic-integration-test-on-pr:L19:1877s] Deploying static ip worker: static-worker-720514.194934
[vic-integration-test-on-pr:L20:1990s] Curl a new static ip address from the created worker...
[vic-integration-test-on-pr:L21:1994s] Set environment variables up for GOVC
[vic-integration-test-on-pr:L22:1994s] Deploy VIC to the VC cluster
[vic-integration-test-on-pr:L23:1994s] Test
[vic-integration-test-on-pr:L24:1994s] Starting test...
[vic-integration-test-on-pr:L25:1994s] Test Server is in Nimbus
[vic-integration-test-on-pr:L26:1994s]
[vic-integration-test-on-pr:L27:1994s] TEST_URL=10.170.118.135
[vic-integration-test-on-pr:L28:1994s]
[vic-integration-test-on-pr:L29:1994s] DRONE_MACHINE='local'
[vic-integration-test-on-pr:L30:1994s]
[vic-integration-test-on-pr:L31:1994s] Worker_Date=Tue Apr 24 15:14:13 UTC 2018
[vic-integration-test-on-pr:L32:2004s]
[vic-integration-test-on-pr:L33:2004s] Test_Server_Dates=
[vic-integration-test-on-pr:L34:2004s] Current date and time:  Tue Apr 24 15:14:18 UTC 2018
[vic-integration-test-on-pr:L35:2004s] Current date and time:  Tue Apr 24 15:14:20 UTC 2018
[vic-integration-test-on-pr:L36:2004s] Current date and time:  Tue Apr 24 15:14:23 UTC 2018
[vic-integration-test-on-pr:L37:2004s]
[vic-integration-test-on-pr:L38:2019s]
[vic-integration-test-on-pr:L39:2019s] Installing VCH to test server...
[vic-integration-test-on-pr:L40:2093s] Installer completed successfully: VCH-0-3958...
[vic-integration-test-on-pr:L41:2182s] | PASS |
[vic-integration-test-on-pr:L42:2182s] ------------------------------------------------------------------------------
[vic-integration-test-on-pr:L43:2182s]   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
[vic-integration-test-on-pr:L44:2182s]                                  Dload  Upload   Total   Spent    Left  Speed
100  551k    0  551k    0     0  50014      0 --:--:--  0:00:11 --:--:-- 23672
[vic-integration-test-on-pr:L46:2228s] 5-26-Static-IP-Address & 5-28-VICAdmin-Isolated.5-26-Static-IP-Add... | PASS |
[vic-integration-test-on-pr:L47:2228s] 1 critical test, 1 passed, 0 failed
[vic-integration-test-on-pr:L48:2228s] 1 test total, 1 passed, 0 failed
[vic-integration-test-on-pr:L11:0s] ==============================================================================
[vic-integration-test-on-pr:L12:0s] 5-28-VICAdmin-Isolated :: Test 5-28 - VICAdmin Isolated
[vic-integration-test-on-pr:L13:0s] ==============================================================================
[vic-integration-test-on-pr:L14:1485s] Finished Creating Cluster vic-5-28-4586
[vic-integration-test-on-pr:L15:1487s] Create a new static ip address worker...
[vic-integration-test-on-pr:L16:1487s]
[vic-integration-test-on-pr:L17:1487s] Deploying static ip worker: static-worker-999411.135056
[vic-integration-test-on-pr:L18:1595s] Curl a new static ip address from the created worker...
[vic-integration-test-on-pr:L19:1598s] Set environment variables up for GOVC
[vic-integration-test-on-pr:L20:1598s] Deploy VIC to the VC cluster
[vic-integration-test-on-pr:L21:1598s] Test Server is in Nimbus
[vic-integration-test-on-pr:L22:1599s]
[vic-integration-test-on-pr:L23:1599s] TEST_URL=10.92.25.81
[vic-integration-test-on-pr:L24:1599s]
[vic-integration-test-on-pr:L25:1599s] DRONE_MACHINE='local'
[vic-integration-test-on-pr:L26:1599s]
[vic-integration-test-on-pr:L27:1599s] Worker_Date=Tue Apr 24 16:10:06 UTC 2018
[vic-integration-test-on-pr:L28:1608s]
[vic-integration-test-on-pr:L29:1608s] Test_Server_Dates=
[vic-integration-test-on-pr:L30:1608s] Current date and time:  Tue Apr 24 16:10:11 UTC 2018
[vic-integration-test-on-pr:L31:1608s] Current date and time:  Tue Apr 24 16:10:13 UTC 2018
[vic-integration-test-on-pr:L32:1608s] Current date and time:  Tue Apr 24 16:10:15 UTC 2018
[vic-integration-test-on-pr:L33:1608s]
[vic-integration-test-on-pr:L34:1610s] Create a vch with a public network on a no-wan portgroup.
[vic-integration-test-on-pr:L35:1695s] Display HTML                                                          | PASS |
[vic-integration-test-on-pr:L36:1695s] ------------------------------------------------------------------------------
[vic-integration-test-on-pr:L37:1707s] WAN Status Should Fail                                                | PASS |
[vic-integration-test-on-pr:L38:1707s] ------------------------------------------------------------------------------
[vic-integration-test-on-pr:L39:1717s] Fail To Pull Docker Image                                             | PASS |
[vic-integration-test-on-pr:L40:1717s] ------------------------------------------------------------------------------
[vic-integration-test-on-pr:L41:1718s] Get Portlayer Log                                                     | PASS |
[vic-integration-test-on-pr:L42:1718s] ------------------------------------------------------------------------------
[vic-integration-test-on-pr:L43:1719s] Get VCH-Init Log                                                      | PASS |
[vic-integration-test-on-pr:L44:1719s] ------------------------------------------------------------------------------
[vic-integration-test-on-pr:L45:1720s] Get Docker Personality Log                                            | PASS |
[vic-integration-test-on-pr:L46:1720s] ------------------------------------------------------------------------------
[vic-integration-test-on-pr:L47:1721s] Get VICAdmin Log                                                      | PASS |
[vic-integration-test-on-pr:L48:1721s] ------------------------------------------------------------------------------
[vic-integration-test-on-pr:L49:1764s] 5-28-VICAdmin-Isolated :: Test 5-28 - VICAdmin Isolated               | PASS |
[vic-integration-test-on-pr:L50:1764s] 7 critical tests, 7 passed, 0 failed
[vic-integration-test-on-pr:L51:1764s] 7 tests total, 7 passed, 0 failed

@ghost ghost changed the title [skip ci] Add a nightly test for vicadmin tests on isolated vch Add a nightly test for vicadmin tests on isolated vch Apr 24, 2018
@ghost ghost changed the title Add a nightly test for vicadmin tests on isolated vch [skip ci] Add a nightly test for vicadmin tests on isolated vch Apr 24, 2018
@ghost ghost changed the title [skip ci] Add a nightly test for vicadmin tests on isolated vch Add a nightly test for vicadmin tests on isolated vch Apr 24, 2018
@ghost ghost merged commit d5135e4 into vmware:master Apr 24, 2018
@ghost ghost deleted the fix/7102-isolated-vch branch April 24, 2018 18:37
zjs pushed a commit to zjs/vic that referenced this pull request Jul 19, 2018
Adds a nightly test that verifies vicadmin functions properly without a 
wan connection. Fixes vmware#7102.

(cherry picked from commit d5135e4)
zjs pushed a commit to zjs/vic that referenced this pull request Jul 27, 2018
…8151)

Adds a nightly test that verifies vicadmin functions properly without a
wan connection. Fixes vmware#7102.

(cherry picked from commit d5135e4)
zjs pushed a commit that referenced this pull request Jul 27, 2018
Adds a nightly test that verifies vicadmin functions properly without a
wan connection. Fixes #7102.

(cherry picked from commit d5135e4)
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants