* 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
5.0 KiB
5.0 KiB
Test 6-05 - Verify vic-machine create validation function
Purpose:
Verify vic-machine create validation functions, this does not include validation for network, datastore, and compute resources
References:
- vic-machine-linux create -h
Environment:
This test requires that a vSphere server is running and available
Test Cases: - suggest resources
Invalid datacenter
- Prepare vCenter environment with multiple datacenters
- Create with --target specifying a datacenter that does not exist
Expected Outcome:
- Output contains message indicating datacenter must be specified
- Output suggests available datacenter values
- Deployment fails
Invalid target path
- Prepare vCenter environment
- Create with --target specifying a datacenter and resource pool
Expected Outcome:
- Output contains message indicating that onlydatacenter must be specified in --target
- Output suggests available datacenter values
- Deployment fails
Create VCH - target thumbprint verification
- Issue the following command:
vic-machine-linux create --thumbprint=NOPE --name=${vch-name} \
--target="%{TEST_USERNAME}:%{TEST_PASSWORD}@%{TEST_URL}" --image-store=ENOENT ${vicmachinetls}
Expected Outcome:
- Output contains message that thumbprint does not match
Resource pools
- Create with wrong compute-resource: not exist resource pool, not existed vc cluster, not existed datacenter.
- Create with wrong compute-resource format
Expected Outcome:
- Verify resource suggestion successfully show available values
- Deployment fails
Networks
- Create with nonexistent bridge network
- Create with nonexistent public network
Expected Outcome:
- Verify resource suggestion successfully show available values
- Deployment fails
Multiple datacenters
- Prepare vCenter environment with multiple datacenters
- Create with --target not specifying a datacenter
Expected Outcome:
- Output contains message indicating datacenter must be specified
- Output suggests available datacenter values
- Deployment fails
Test Cases: - validate license
- Prepare env with different license level
- Verify license validation works for different license
Expected Outcome:
- If license verification passed, deployment succeeds
Test Cases: - firewall
Firewall disabled
- Create with env with firewall disabled
Expected Outcome:
- Warn firewall is not enabled with user-friendly message
- Deployment succeeds
Firewall enabled
- Create with env with firewall enabled, but tether port allowed
Expected Outcome:
- Show firewall check passed
- Deployment succeeds
Firewall misconfigured
- Create env with firewall configured to block tether port
Expected Outcome:
- Show error message that firewall is misconfigured
- Deployment fails
Test Cases: - drs
- Prepare env with drs disabled
- Verify deployment failed for drs disabled with user-friendly error message
Test Cases: - resource accessibility
- Prepare env with datastore not connected to hosts
- Verify deployment failed for host/datastore connectability with user-friendly error message
Test Cases: - networking
vDS contains all hosts in cluster
- Prepare vCenter environment with a vDS that is connected to all hosts in the cluster
- 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:
- Output contains message indicating vDS configuration OK
- Deployment succeeds
- Regression tests pass
vDS does not contain all hosts in cluster
- Prepare vCenter environment with a vDS that is not connected to all hosts in the cluster
- 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>
Expected Outcome:
- Output contains message indicating vDS configuration is incorrect with user-friendly error message
- Deployment fails
Bridge network same as public network
- Create with bridge network the same as public network
Expected Outcome:
- Output contains message indicating invalid network configuration
- Deployment fails
Test Cases: - storage
Default image datastore
- Prepare env with one datastore
- Issue
vic-machine createwithout specifying--image-store - Run regression tests
Expected Outcome:
- Deployment succeeds
- Regression tests pass
Custom image datastore
- Issue the following command:
vic-machine-linux create --name=${vch-name} --target=%{TEST_URL} \
--thumbprint=%{TEST_THUMBPRINT} --user=%{TEST_USERNAME} --password=%{TEST_PASSWORD} \
--image-store=%{TEST_DATASTORE}/long/weird/path ${vicmachinetls}
- Run regression tests
Expected Outcome:
- Deployment succeeds
- Regression tests pass