Kailash Khalasi | cd82f42 | 2018-10-09 09:40:35 -0700 | [diff] [blame] | 1 | --- |
| 2 | # xos tosca e2e test |
| 3 | |
| 4 | - job-template: |
| 5 | id: 'xos-tosca-e2e-test' |
| 6 | name: 'verify_{project}_e2e-test' |
| 7 | |
| 8 | description: | |
| 9 | Created by {id} job-template from ci-management/jjb/xos-tosca-e2e.yaml |
| 10 | |
| 11 | triggers: |
| 12 | - cord-infra-gerrit-trigger-patchset: |
| 13 | gerrit-server-name: '{gerrit-server-name}' |
| 14 | project-regexp: '^{project}$' |
| 15 | branch-regexp: '{branch-regexp}' |
| 16 | dependency-jobs: '{dependency-jobs}' |
| 17 | file-include-regexp: '{all-files-regexp}' |
| 18 | |
| 19 | properties: |
| 20 | - cord-infra-properties: |
| 21 | build-days-to-keep: '{build-days-to-keep}' |
| 22 | artifact-num-to-keep: '{artifact-num-to-keep}' |
| 23 | |
| 24 | wrappers: |
| 25 | - lf-infra-wrappers: |
Kailash Khalasi | 438a0c4 | 2018-10-22 08:58:42 -0700 | [diff] [blame] | 26 | build-timeout: '20' |
Kailash Khalasi | cd82f42 | 2018-10-09 09:40:35 -0700 | [diff] [blame] | 27 | jenkins-ssh-credential: '{jenkins-ssh-credential}' |
| 28 | |
| 29 | scm: |
| 30 | - cord-infra-gerrit-repo-scm: |
| 31 | manifest-url: '{gerrit-server-url}/{cord-repo-manifest}' |
| 32 | branch: '$GERRIT_BRANCH' |
| 33 | destination-dir: 'cord' |
| 34 | |
Kailash Khalasi | 4b42e6c | 2018-10-18 13:43:52 -0700 | [diff] [blame] | 35 | node: 'ubuntu16.04-basebuild-4c-8g' |
Kailash Khalasi | cd82f42 | 2018-10-09 09:40:35 -0700 | [diff] [blame] | 36 | project-type: freestyle |
| 37 | concurrent: true |
| 38 | |
| 39 | builders: |
| 40 | - cord-infra-gerrit-repo-patch: |
| 41 | destination-dir: 'cord' |
| 42 | project: '$GERRIT_PROJECT' |
| 43 | change-number: '$GERRIT_CHANGE_NUMBER' |
| 44 | patchset-number: '$GERRIT_PATCHSET_NUMBER' |
| 45 | - shell: | |
| 46 | #!/usr/bin/env bash |
| 47 | set -ex -o pipefail |
| 48 | |
| 49 | export XOS_DIR=$WORKSPACE/cord/orchestration/xos |
| 50 | export TOSCA_DIR=$WORKSPACE/cord/orchestration/xos-tosca |
| 51 | |
Kailash Khalasi | a49577f | 2018-10-18 14:50:00 -0700 | [diff] [blame] | 52 | #install minikube+helm |
| 53 | export MINIKUBE_WANTUPDATENOTIFICATION=false |
| 54 | export MINIKUBE_WANTREPORTERRORPROMPT=false |
| 55 | export CHANGE_MINIKUBE_NONE_USER=true |
| 56 | export MINIKUBE_HOME=$HOME |
| 57 | mkdir -p $HOME/.kube || true |
| 58 | touch $HOME/.kube/config |
| 59 | export KUBECONFIG=$HOME/.kube/config |
| 60 | sudo -E /usr/bin/minikube start --vm-driver=none |
| 61 | sleep 300 |
Kailash Khalasi | cd82f42 | 2018-10-09 09:40:35 -0700 | [diff] [blame] | 62 | |
Kailash Khalasi | a49577f | 2018-10-18 14:50:00 -0700 | [diff] [blame] | 63 | helm init |
| 64 | sleep 60 |
| 65 | helm repo add incubator https://kubernetes-charts-incubator.storage.googleapis.com/ |
Kailash Khalasi | cd82f42 | 2018-10-09 09:40:35 -0700 | [diff] [blame] | 66 | |
Kailash Khalasi | a49577f | 2018-10-18 14:50:00 -0700 | [diff] [blame] | 67 | # build tosca container |
| 68 | cd $TOSCA_DIR |
| 69 | make build |
Kailash Khalasi | cd82f42 | 2018-10-09 09:40:35 -0700 | [diff] [blame] | 70 | |
Kailash Khalasi | a49577f | 2018-10-18 14:50:00 -0700 | [diff] [blame] | 71 | #deploy xos core |
| 72 | cd $WORKSPACE/cord/helm-charts |
| 73 | helm dep update xos-core |
| 74 | helm install --set images.xos_tosca.tag=candidate -f examples/imagePullPolicy-IfNotPresent.yaml -n xos-core xos-core |
| 75 | |
| 76 | #wait for xos-core and models to be loaded |
| 77 | 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" |
| 78 | |
| 79 | #test apis |
Kailash Khalasi | 797567d | 2018-10-19 13:46:57 -0700 | [diff] [blame] | 80 | curl -Is -u admin@opencord.org:letmein GET http://127.0.0.1:30001/xosapi/v1/core/sites | grep -q '200 OK' |
| 81 | curl -Is -u wronguser@opencord.org:wrongpass GET http://127.0.0.1:30001/xosapi/v1/core/sites | grep '403 Forbidden' |
| 82 | curl -Is -u admin@opencord.org:letmein GET http://127.0.0.1:30001/xosapi/v1/utility/auth_noop | grep '405 Method Not Allowed' |
| 83 | curl -Is -u wronguser@opencord.org:wrongpass GET http://127.0.0.1:30001/xosapi/v1/utility/auth_noop | grep '405 Method Not Allowed' |
| 84 | curl -Is -u wronguser@opencord.org:wrongpass GET http://127.0.0.1:30001/xosapi/v1/utility/noop | grep '405 Method Not Allowed' |
| 85 | curl -Is GET http://127.0.0.1:30001/xosapi/v1/utility/noop | grep '405 Method Not Allowed' |