blob: f414f442df5f94680ac98ec4b5d2b785030d245f [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:
26 build-timeout: '{build-timeout}'
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 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
52 # build tosca container
53 cd $TOSCA_DIR
54 make build
55
56 #deploy xos core
57 cd $WORKSPACE/cord/helm-charts
58 helm dep update xos-core
59 helm install --set images.xos_tosca.tag=candidate -f examples/imagePullPolicy-IfNotPresent.yaml -n xos-core xos-core
60
61 #wait for xos-core and models to be loaded
62 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"
63
64 #test apis
65 http -a admin@opencord.org:letmein GET http://127.0.0.1:30001/xosapi/v1/core/sites | grep '200 OK'
66 http -a wronguser@opencord.org:wrongpass GET http://127.0.0.1:30001/xosapi/v1/core/sites | grep '403 Forbidden'
67 http -a admin@opencord.org:letmein GET http://127.0.0.1:30001/xosapi/v1/utility/auth_noop | grep '405 Method Not Allowed'
68 http -a wronguser@opencord.org:wrongpass GET http://127.0.0.1:30001/xosapi/v1/utility/auth_noop | grep '405 Method Not Allowed'
69 http -a wronguser@opencord.org:wrongpass GET http://127.0.0.1:30001/xosapi/v1/utility/noop | grep '405 Method Not Allowed'
70 http GET http://127.0.0.1:30001/xosapi/v1/utility/noop | grep '405 Method Not Allowed'
71