* Add Virtual Kubelet provider for VIC Initial virtual kubelet provider for VMware VIC. This provider currently handles creating and starting of a pod VM via the VIC portlayer and persona server. Image store handling via the VIC persona server. This provider currently requires the feature/wolfpack branch of VIC. * Added pod stop and delete. Also added node capacity. Added the ability to stop and delete pod VMs via VIC. Also retrieve node capacity information from the VCH. * Cleanup and readme file Some file clean up and added a Readme.md markdown file for the VIC provider. * Cleaned up errors, added function comments, moved operation code 1. Cleaned up error handling. Set standard for creating errors. 2. Added method prototype comments for all interface functions. 3. Moved PodCreator, PodStarter, PodStopper, and PodDeleter to a new folder. * Add mocking code and unit tests for podcache, podcreator, and podstarter Used the unit test framework used in VIC to handle assertions in the provider's unit test. Mocking code generated using OSS project mockery, which is compatible with the testify assertion framework. * Vendored packages for the VIC provider Requires feature/wolfpack branch of VIC and a few specific commit sha of projects used within VIC. * Implementation of POD Stopper and Deleter unit tests (#4) * Updated files for initial PR
8.2 KiB
8.2 KiB
Test 6-04 - Verify vic-machine create basic function
Purpose:
Verify vic-machine create basic connection variables, certificates, timeout, and all arguments after appliance-iso
References:
- vic-machine-linux create -h
Environment:
This test requires that a vSphere server is running and available
DNS Servers
Create VCH - supply DNS server
- Create VCH while supplying the
--dns-serveroption twice with values1.1.1.1and2.2.2.2 - Enable SSH on the VCH using the
vic-machine debugcommand - SSH into the VCH run
cat /etc/resolv.conf
Expected Outcome
- The top two lines of the output from
cat /etc/resolv.confshould contain1.1.1.1and2.2.2.2in that order.
Image size
Create VCH - custom base disk
- Issue the following command:
vic-machine-linux create --name=${vch-name} --target=%{TEST_URL} --thumbprint=%{TEST_THUMBPRINT} --user=%{TEST_USERNAME} --bridge-network=%{BRIDGE_NETWORK} --public-network=%{PUBLIC_NETWORK} --image-store=%{TEST_DATASTORE} --password=%{TEST_PASSWORD} --base-image-size=6GB ${vicmachinetls}
Expected Outcome
- VCH is deployed successfully
- Container has correct disk size
- Regression tests pass
Connection
Create VCH - URL without user and password
- Create with vSphere URL in --target parameter, without --user and --password
Expected Outcome
- Command should fail for no user password available
Create VCH - URL without password
- Create with vSphere URL in --target parameter and --user provided, but without --password
Expected Outcome
- Command should promote interactive password input
Create VCH - target URL
- Create with vSphere URL and user password encoded in the same --target parameter
vic-machine-linux create --name=<VCH_NAME> --target="<TEST_USERNAME>:<TEST_PASSWORD>@<TEST_URL>" \
--image-store=<TEST_DATASTORE>
- Run regression tests
Create VCH - operations user
- Create with an operations user (the same as the administrative user used for deployment in this case)
vic-machine-linux create --ops-user="<TEST_USERNAME>" --ops-password="<TEST_PASSWORD>"
- Run regression tests
Expected Outcome
- Deployment succeed
- Regression test pass
Create VCH - specified datacenter
- Prepare test env with multiple DC exists
- Create with vSphere URL with correct DC appended as /DC1
Expected Outcome
- Verify deployed successfully
- Verify VCH is in correct DC through govc
vic-machine create Parameters
Create VCH - defaults
- Issue the following command:
vic-machine create --name=<VCH_NAME> --target=<TEST_URL> \
--user=<TEST_USERNAME> --image-store=<TEST_DATASTORE> --password=<TEST_PASSWORD> \
--bridge-network=<NETWORK> --compute-resource=<TEST_RESOURCE>
- Run regression tests
Expected Outcome
- Deployment succeed
- Regression test pass
Create VCH - full params
- Issue the following command:
vic-machine-linux create --name=<VCH_NAME> --target=<TEST_URL> \
--user=<TEST_USERNAME> --image-store=<TEST_DATASTORE> \
--appliance-iso=bin/appliance.iso --bootstrap-iso=bin/bootstrap.iso \
--password=<TEST_PASSWORD> --force=true --bridge-network=network \
--compute-resource=<TEST_RESOURCE> --timeout <TEST_TIMEOUT> \
--volume-store=<TEST_DATASTORE>/test:default
- Run regression tests
Expected Outcome
- Deployment succeed
- Regression test pass
Create VCH - using environment variables
- Issue the following command:
vic-machine-linux create --name=<VCH_NAME> --image-store=<TEST_DATASTORE> \
--appliance-iso=bin/appliance.iso --bootstrap-iso=bin/bootstrap.iso \
--force=true --bridge-network=network --public-network=%{PUBLIC_NETWORK} \
--compute-resource=<TEST_RESOURCE> --timeout <TEST_TIMEOUT> \
--volume-store=<TEST_DATASTORE>/test:default
- Run regression tests
Expected Outcome
- Deployment succeed
- Regression test pass
Create VCH - custom image store directory
- Issue the following command:
vic-machine-linux create --name=${vch-name} --target=%{TEST_URL} \
--thumbprint=%{TEST_THUMBPRINT} --user=%{TEST_USERNAME} \
--image-store %{TEST_DATASTORE}/vic-machine-test-images \
--appliance-iso=bin/appliance.iso --bootstrap-iso=bin/bootstrap.iso \
--password=%{TEST_PASSWORD} --force=true --bridge-network=%{BRIDGE_NETWORK} \
--public-network=%{PUBLIC_NETWORK} --compute-resource=%{TEST_RESOURCE} \
--timeout %{TEST_TIMEOUT} ${vicmachinetls}
- Run regression tests
Expected Outcome
- Deployment succeeds
- Regression tests pass
Create VCH - long VCH name
- Provide long name to create VCH, e.g. 100 characters
Expected Outcome
- Command failed for name is too long
Create VCH - Existing VCH name
- Create with same name with existing VCH
Expected Outcome
- Command failed for VCH is found
Create VCH - Existing VM name
- Create with existing VM name
- Run regression tests
Expected Outcome
- Deployment succeeds
- Regression tests pass
Create VCH - Existing RP on ESX
- Create resource pool on ESX
- Create VCH with the same (already existing) name
Expected Outcome
- Deployment succeeds
- Regression tests pass
Image files
Create VCH - wrong ISOs
- Provide wrong iso files
Expected Outcome
- Command failed for no iso files found
Creation log file
Creation log file uploaded to datastore
- Issue the following commands:
vic-machine create --name=<VCH_NAME> --target=<TEST_URL> \
--user=<TEST_USERNAME> --image-store=<TEST_DATASTORE> --password=<TEST_PASSWORD> \
--bridge-network=<NETWORK> --compute-resource=<TEST_RESOURCE>
- Verified that the creation log file prefixed by
vic-machine-createis uploaded to datastore folder - Verified that the creation log file is complete
Expected Outcome
- Deployment succeeds
- The creation log file is uploaded to datastore folder
- The creation log file is complete
Timeout
Basic timeout
- Specify short timeout to 2s
Expected Outcome
- Command fail for timeout error #1557
Short time creation
Stop VCH creation immediately
=============================
- Interrupt creation process after 2s,
- Delete the VCH
Expected Outcome
- Delete should succeed
Appliance size
Basic VCH resource config
- Specify appliance size to 4cpu, 4096MB
Expected Outcome
- Deployed successfully
- Appliance VM size is set correctly in vsphere
- Regression test pass
Invalid VCH resource config
- Specify appliance size to 1cpu, 256MB
Expected Outcome
- Deployment failed for no enought resource
- Should have user-friendly error message
Use resource pool
- --use-rp=true
Expected Outcome
- Deployed successfully
- VCH is created under resource pool against VC
- Regression test pass
CPU reservation shares invalid
- Specify VCH CPU size to reservation: 4, limit: 8, shares: wrong
Expected Outcome
- Deployment failed for wrong shares format
CPU reservation invalid
- Specify VCH CPU size to reservation: 4, limit: 2, shares: normal
Expected Outcome
- Deployment failed for user-friendly error message
CPU reservation valid
- Specify VCH CPU size to reservation: 4, limit: 8, shares: high
Expected Outcome
- Deployed successfully
- Check rp resource settings are correct through govc
- Integration test passed
Memory reservation shares invalid
- Specify VCH Memory size to reservation: 4096, limit: 8192, shares: wrong
Expected Outcome
- Deployment failed for wrong shares format
Memory reservation invalid 1
- Specify VCH Memory size to reservation: 4096, limit: 2048, shares: normal
Expected Outcome
- Deployment failed for user-friendly error message
Memory reservation invalid 2
- Specify VCH Memory size to reservation: 256, limit: 256, shares: high
Expected Outcome
- Deployment failed with user-friendly error message
Memory reservation invalid 3
- Specify VCH Memory size to reservation: 200, limit: 200, shares: high
Expected Outcome
- Deployment failed with user-friendly error message
Memory reservation valid
- Specify VCH Memory size to reservation: 4096, limit: 8192, shares: high
Expected Outcome
- Deployed successfully
- Check rp resource settings are correct through govc
- Integration test passed