Zack Williams | ae8b48b | 2019-04-16 15:00:37 -0700 | [diff] [blame] | 1 | --- |
| 2 | # xos auth test |
| 3 | |
| 4 | - job-template: |
| 5 | id: 'xos-auth-test' |
| 6 | name: 'verify_{project}_auth-test' |
| 7 | |
| 8 | description: | |
| 9 | Created by {id} job-template from ci-management/jjb/xos-auth.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: '20' |
| 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 | |
Joey Armstrong | c5194c4 | 2024-07-23 15:31:18 -0400 | [diff] [blame] | 35 | # node: 'ubuntu18.04-basebuild-4c-8g' |
Joey Armstrong | 6fb53fb | 2024-08-27 16:44:29 -0400 | [diff] [blame] | 36 | node: 'ubuntu18.04-basebuild-8c-15g' |
Zack Williams | ae8b48b | 2019-04-16 15:00:37 -0700 | [diff] [blame] | 37 | project-type: freestyle |
| 38 | concurrent: true |
| 39 | |
| 40 | builders: |
Zack Williams | be54231 | 2022-06-23 21:51:32 -0700 | [diff] [blame] | 41 | - onf-infra-gerrit-repo-patch: |
| 42 | basedir: 'cord' |
Zack Williams | ae8b48b | 2019-04-16 15:00:37 -0700 | [diff] [blame] | 43 | project: '$GERRIT_PROJECT' |
| 44 | change-number: '$GERRIT_CHANGE_NUMBER' |
| 45 | patchset-number: '$GERRIT_PATCHSET_NUMBER' |
| 46 | - shell: | |
| 47 | #!/usr/bin/env bash |
| 48 | set -ex -o pipefail |
| 49 | |
| 50 | export XOS_DIR=$WORKSPACE/cord/orchestration/xos |
| 51 | export CHAMELEON_DIR=$WORKSPACE/cord/component/chameleon |
| 52 | |
| 53 | #install minikube+helm |
| 54 | export MINIKUBE_WANTUPDATENOTIFICATION=false |
| 55 | export MINIKUBE_WANTREPORTERRORPROMPT=false |
| 56 | export CHANGE_MINIKUBE_NONE_USER=true |
| 57 | export MINIKUBE_HOME=$HOME |
| 58 | mkdir -p $HOME/.kube || true |
| 59 | touch $HOME/.kube/config |
| 60 | export KUBECONFIG=$HOME/.kube/config |
| 61 | sudo -E /usr/bin/minikube start --vm-driver=none |
| 62 | sleep 300 |
| 63 | |
| 64 | helm init |
| 65 | sleep 60 |
| 66 | helm repo add incubator https://kubernetes-charts-incubator.storage.googleapis.com/ |
| 67 | |
| 68 | # build chameleon container |
| 69 | cd $CHAMELEON_DIR |
| 70 | make DOCKER_REPOSITORY=xosproject/ docker-build |
| 71 | |
| 72 | #deploy xos core |
| 73 | cd $WORKSPACE/cord/helm-charts |
| 74 | helm dep update xos-core |
| 75 | helm install --set images.xos_chameleon.tag=candidate -f examples/imagePullPolicy-IfNotPresent.yaml -n xos-core xos-core |
| 76 | |
| 77 | #wait for xos-core and models to be loaded |
| 78 | 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" |
| 79 | |
| 80 | #test apis |
| 81 | curl -Is -u admin@opencord.org:letmein GET http://127.0.0.1:30001/xosapi/v1/core/sites | grep -q '200 OK' |
| 82 | curl -Is -u wronguser@opencord.org:wrongpass GET http://127.0.0.1:30001/xosapi/v1/core/sites | grep '403 Forbidden' |
| 83 | curl -Is -u admin@opencord.org:letmein 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/auth_noop | grep '405 Method Not Allowed' |
| 85 | curl -Is -u wronguser@opencord.org:wrongpass GET http://127.0.0.1:30001/xosapi/v1/utility/noop | grep '405 Method Not Allowed' |
| 86 | curl -Is GET http://127.0.0.1:30001/xosapi/v1/utility/noop | grep '405 Method Not Allowed' |
Joey Armstrong | af679da | 2023-01-31 14:22:41 -0500 | [diff] [blame] | 87 | |
| 88 | # [EOF] |