Merge "SEBA-292 adding e2e xos-tosca verify tests"
diff --git a/jjb/verify/xos-tosca.yaml b/jjb/verify/xos-tosca.yaml
index fd1fd0f..1eaeeab 100644
--- a/jjb/verify/xos-tosca.yaml
+++ b/jjb/verify/xos-tosca.yaml
@@ -22,3 +22,5 @@
           pipeline_script: 'all-xos-api-test-helm.groovy'
       - 'xos-tosca-unit-test':
           dependency-jobs: 'verify_xos-tosca_sonarqube'
+      - 'xos-tosca-e2e-test':
+          dependency-jobs: 'verify_xos-tosca_sonarqube'
diff --git a/jjb/xos-tosca-e2e.yaml b/jjb/xos-tosca-e2e.yaml
new file mode 100644
index 0000000..ef66e1c
--- /dev/null
+++ b/jjb/xos-tosca-e2e.yaml
@@ -0,0 +1,71 @@
+---
+# xos tosca e2e test
+
+- job-template:
+    id: 'xos-tosca-e2e-test'
+    name: 'verify_{project}_e2e-test'
+
+    description: |
+      Created by {id} job-template from ci-management/jjb/xos-tosca-e2e.yaml
+
+    triggers:
+      - cord-infra-gerrit-trigger-patchset:
+          gerrit-server-name: '{gerrit-server-name}'
+          project-regexp: '^{project}$'
+          branch-regexp: '{branch-regexp}'
+          dependency-jobs: '{dependency-jobs}'
+          file-include-regexp: '{all-files-regexp}'
+
+    properties:
+      - cord-infra-properties:
+          build-days-to-keep: '{build-days-to-keep}'
+          artifact-num-to-keep: '{artifact-num-to-keep}'
+
+    wrappers:
+      - lf-infra-wrappers:
+          build-timeout: '{build-timeout}'
+          jenkins-ssh-credential: '{jenkins-ssh-credential}'
+
+    scm:
+      - cord-infra-gerrit-repo-scm:
+          manifest-url: '{gerrit-server-url}/{cord-repo-manifest}'
+          branch: '$GERRIT_BRANCH'
+          destination-dir: 'cord'
+
+    node: '{build-node}'
+    project-type: freestyle
+    concurrent: true
+
+    builders:
+      - cord-infra-gerrit-repo-patch:
+          destination-dir: 'cord'
+          project: '$GERRIT_PROJECT'
+          change-number: '$GERRIT_CHANGE_NUMBER'
+          patchset-number: '$GERRIT_PATCHSET_NUMBER'
+      - shell: |
+          #!/usr/bin/env bash
+          set -ex -o pipefail
+
+          export XOS_DIR=$WORKSPACE/cord/orchestration/xos
+          export TOSCA_DIR=$WORKSPACE/cord/orchestration/xos-tosca
+
+          # build tosca container
+          cd $TOSCA_DIR
+          make build
+
+          #deploy xos core
+          cd $WORKSPACE/cord/helm-charts
+          helm dep update xos-core
+          helm install --set images.xos_tosca.tag=candidate -f examples/imagePullPolicy-IfNotPresent.yaml -n xos-core xos-core
+
+          #wait for xos-core and models to be loaded
+          timeout 300 bash -c "until http -a admin@opencord.org:letmein GET http://127.0.0.1:30001/xosapi/v1/core/sites |jq '.items[0].name'|grep -q mysite; do echo 'Waiting for API To be up'; sleep 10; done"
+
+          #test apis
+          http -a admin@opencord.org:letmein GET http://127.0.0.1:30001/xosapi/v1/core/sites | grep '200 OK'
+          http -a wronguser@opencord.org:wrongpass GET http://127.0.0.1:30001/xosapi/v1/core/sites | grep '403 Forbidden'
+          http -a admin@opencord.org:letmein GET http://127.0.0.1:30001/xosapi/v1/utility/auth_noop | grep '405 Method Not Allowed'
+          http -a wronguser@opencord.org:wrongpass GET http://127.0.0.1:30001/xosapi/v1/utility/auth_noop | grep '405 Method Not Allowed'
+          http -a wronguser@opencord.org:wrongpass GET http://127.0.0.1:30001/xosapi/v1/utility/noop | grep '405 Method Not Allowed'
+          http GET http://127.0.0.1:30001/xosapi/v1/utility/noop | grep '405 Method Not Allowed'
+