blob: ef66e1cb11bf0223ff95196b0886ab42e8e7d5f1 [file] [log] [blame]
---
# 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'