summaryrefslogtreecommitdiffstats
path: root/vagrant/tests/_common.sh
diff options
context:
space:
mode:
authorBin Hu <bh526r@att.com>2018-09-18 05:46:41 +0000
committerGerrit Code Review <gerrit@onap.org>2018-09-18 05:46:41 +0000
commitb368dfe25337494060eb8cd85a5becaf7a465643 (patch)
tree80528cd5c7d00d1517f4befbba668981b944684c /vagrant/tests/_common.sh
parentbe88f0d19f136f8c5693d5fe93011936e7249eca (diff)
parentdd0d1336f9bb74390b44460889a684e58ffb74ce (diff)
Merge "Refactor plugin.sh functional test"
Diffstat (limited to 'vagrant/tests/_common.sh')
-rwxr-xr-xvagrant/tests/_common.sh58
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
}
+