diff options
author | 2018-09-17 04:42:59 -0700 | |
---|---|---|
committer | 2018-09-17 04:42:59 -0700 | |
commit | dd0d1336f9bb74390b44460889a684e58ffb74ce (patch) | |
tree | c0cf8493b9ccfbc2b698c72ab0dfd8a138feed5f /vagrant/tests/_common.sh | |
parent | acfc52396351261756b6d319d7578f2277f2d272 (diff) |
Refactor plugin.sh functional test
There are some instructions located in plugin.sh script which can
be exported to a common place like _common.sh library. This change
moves those instructions.
Change-Id: I44aeaf75ea70aa2148b17bbcb82314ea339d7a00
Signed-off-by: Victor Morales <victor.morales@intel.com>
Issue-ID: MULTICLOUD-301
Diffstat (limited to 'vagrant/tests/_common.sh')
-rwxr-xr-x | vagrant/tests/_common.sh | 58 |
1 files changed, 57 insertions, 1 deletions
diff --git a/vagrant/tests/_common.sh b/vagrant/tests/_common.sh index d1b6315d..fb5d1798 100755 --- a/vagrant/tests/_common.sh +++ b/vagrant/tests/_common.sh @@ -19,6 +19,8 @@ image_name=virtlet.cloud/ubuntu/16.04 multus_deployment_name=multus-deployment virtlet_image=virtlet.cloud/fedora virtlet_deployment_name=virtlet-deployment +plugin_deployment_name=plugin-deployment +plugin_service_name=plugin-service # popule_CSAR_containers_vFW() - This function creates the content of CSAR file # required for vFirewal using only containers @@ -572,5 +574,59 @@ spec: # This memory limit is applied to the libvirt domain definition memory: 160Mi DEPLOYMENT -popd + popd +} + +# populate_CSAR_plugin()- Creates content used for Plugin functional tests +function populate_CSAR_plugin { + local csar_id=$1 + + _checks_args $csar_id + pushd ${CSAR_DIR}/${csar_id} + + cat << META > metadata.yaml +resources: + deployment: + - $plugin_deployment_name.yaml + service: + - service.yaml +META + + cat << DEPLOYMENT > $plugin_deployment_name.yaml +apiVersion: apps/v1 +kind: Deployment +metadata: + name: $plugin_deployment_name +spec: + replicas: 1 + selector: + matchLabels: + app: plugin + template: + metadata: + labels: + app: plugin + spec: + containers: + - name: $plugin_deployment_name + image: "busybox" + command: ["top"] + stdin: true + tty: true +DEPLOYMENT + + cat << SERVICE > service.yaml +apiVersion: v1 +kind: Service +metadata: + name: $plugin_service_name +spec: + ports: + - port: 80 + protocol: TCP + selector: + app: sise +SERVICE + popd } + |