* 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.1 KiB
5.1 KiB
Test 6-13 - Verify vic-machine create TLS function
Purpose:
Verify vic-machine create certificates
References:
- vic-machine-linux create -h
Environment:
This test requires that a vSphere server is running and available
TLS Auth
Create VCH - defaults with --no-tls
- 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} --no-tls --force=true \
--bridge-network=%{BRIDGE_NETWORK} --public-network=%{PUBLIC_NETWORK} \
--compute-resource=%{TEST_RESOURCE} --timeout %{TEST_TIMEOUT} \
--volume-store=%{TEST_DATASTORE}/test:${vol}
- Run regression tests
Expected Outcome
- Deployment succeeds
- Regression tests pass
Create VCH - use custom --tls-cert-path
- Issue the following command:
vic-machine-linux create\
${vicmachinetls}\
--name=%{VCH-NAME}\
--target="%{TEST_USERNAME}:%{TEST_PASSWORD}@%{TEST_URL}"\
--thumbprint=%{TEST_THUMBPRINT}\
--image-store=%{TEST_DATASTORE}\
--bridge-network=%{BRIDGE_NETWORK}\
--public-network=%{PUBLIC_NETWORK}\
--tls-cert-path=${EXECDIR}/foo-bar-certs/
Expected Outcome
- Certs are generated and stored in
foo-bar-cert - Environment file in
foo-bar-certs/${VCH-NAME}contains correctDOCKER_CERT_PATHvariable definition
Create VCH - force accept target thumbprint
- Issue the following command:
vic-machine-linux create --name=${vch-name} --target="%{TEST_USERNAME}:%{TEST_PASSWORD}@%{TEST_URL}" \
--force --image-store=%{TEST_DATASTORE} --bridge-network=%{BRIDGE_NETWORK} \
--public-network=%{PUBLIC_NETWORK} ${vicmachinetls}
- Run regression tests
Expected Outcome
- Deployment succeed
- Regression test pass
Create VCH - Specified keys
- Generate key/cert files
- Specify key, cert files during creation
Expected Outcome
- Command should succeed,
- Docker is accessed through tls connection, and the key/cert previous generated can be used to access docker
- Regression test pass
Create VCH - Server certificate with multiple blocks
- Generate key/cert files with server-cert.pem containing a block other than CERTIFICATE as the first PEM block
- Specify key, cert files during creation
Expected Outcome
- vic-machine warns about failure to load x509 leaf
- Deployment succeeds
Create VCH - Invalid keys
- Specify key, cert files with mal-format files
Expected Outcome
- Command fail for wrong key/cert file
Create VCH - Reuse keys
- Create VCH
- Destroy VCH
- Create VCH using keys and certificates from previous deployment
Expected Outcome
- Deployment succeeds
Create VCH - Server cert with untrusted CA
- Generate CA and wildcard server cert for DOMAIN
- Issue the following command to create the VCH with server cert and key
bin/vic-machine-linux create --name=%{VCH-NAME} --target="%{TEST_USERNAME}:%{TEST_PASSWORD}@%{TEST_URL}" --thumbprint=%{TEST_THUMBPRINT} --tls-server-key "bundle/*.${domain}.key.pem" --tls-server-cert "bundle/*.${domain}.cert.pem" --image-store=%{TEST_DATASTORE} --bridge-network=%{BRIDGE_NETWORK} --public-network=%{PUBLIC_NETWORK} ${vicmachinetls} --debug 1
Expected Outcome
- Client authentication is done with vic-machine generated CA
- Certificate does not validate
- Provided certificate is presented on vic-admin interface
Create VCH - Server cert with trusted CA
- Generate CA and wildcard server cert for DOMAIN
- Add root certificate to the system root CA store
- Issue the following command to create the VCH with a static IP, specified hostname, server cert, and key
bin/vic-machine-linux create --name=%{VCH-NAME} --target="%{TEST_USERNAME}:%{TEST_PASSWORD}@%{TEST_URL}" --thumbprint=%{TEST_THUMBPRINT} --tls-server-key "bundle/*.${domain}.key.pem" --tls-server-cert "bundle/*.${domain}.cert.pem" --image-store=%{TEST_DATASTORE} --bridge-network=%{BRIDGE_NETWORK} --public-network=%{PUBLIC_NETWORK} ${vicmachinetls} --debug 1
Expected Outcome
- Client authentication is done with vic-machine generated CA
- Certificate validates
- Deployment succeeds
- Provided certificate is presented on vic-admin interface
Create VCH - Server cert with intermediate CA
- Generate root CA, intermediate CA, and wildcard server cert for DOMAIN
- Add root certificate to the system root CA store
- Issue the following command to create the VCH with a static IP, specified hostname, server cert chain including intermediate CA cert, and server key
bin/vic-machine-linux create --name=%{VCH-NAME} --target="%{TEST_USERNAME}:%{TEST_PASSWORD}@%{TEST_URL}" --thumbprint=%{TEST_THUMBPRINT} --tls-server-key "bundle/*.${domain}.key.pem" --tls-server-cert "bundle/*.${domain}.cert.pem" --image-store=%{TEST_DATASTORE} --bridge-network=%{BRIDGE_NETWORK} --public-network=%{PUBLIC_NETWORK} ${vicmachinetls} --debug 1
Expected Outcome
- Client authentication is done with vic-machine generated CA
- Certificate validates
- Deployment succeeds
- Provided certificate is presented on vic-admin interface