blob: dff9bea47289882e5e63642f48808e30dd1d1ba0 [file] [log] [blame]
Kailash Khalasicd82f422018-10-09 09:40:35 -07001---
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 Khalasi438a0c42018-10-22 08:58:42 -070026 build-timeout: '20'
Kailash Khalasicd82f422018-10-09 09:40:35 -070027 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 Khalasi4b42e6c2018-10-18 13:43:52 -070035 node: 'ubuntu16.04-basebuild-4c-8g'
Kailash Khalasicd82f422018-10-09 09:40:35 -070036 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 Khalasia49577f2018-10-18 14:50:00 -070052 #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 Khalasicd82f422018-10-09 09:40:35 -070062
Kailash Khalasia49577f2018-10-18 14:50:00 -070063 helm init
64 sleep 60
65 helm repo add incubator https://kubernetes-charts-incubator.storage.googleapis.com/
Kailash Khalasicd82f422018-10-09 09:40:35 -070066
Kailash Khalasia49577f2018-10-18 14:50:00 -070067 # build tosca container
68 cd $TOSCA_DIR
69 make build
Kailash Khalasicd82f422018-10-09 09:40:35 -070070
Kailash Khalasia49577f2018-10-18 14:50:00 -070071 #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 Khalasi797567d2018-10-19 13:46:57 -070080 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'