|
| 1 | + |
| 2 | +#!/bin/bash |
| 3 | + |
| 4 | +set -e |
| 5 | +echo "Copying user cluster kube-config from artifact directory -------------------------" |
| 6 | +path=$(pwd) |
| 7 | +mkdir ~/.kube |
| 8 | +cp .gcp/config ~/.kube/config |
| 9 | +echo "Setting up gcloud credentials ----------------------------------------------------" |
| 10 | +echo $SDK_TOKEN > key.json |
| 11 | +gcloud auth activate-service-account --key-file=key.json |
| 12 | +gcloud config set project openebs-ci |
| 13 | +export GOOGLE_APPLICATION_CREDENTIALS="$path/key.json" |
| 14 | +echo "Updating gitlab job status in e2e-cr --------------------------------------------" |
| 15 | +bash utils/pooling jobname:teaming-invite-check |
| 16 | +bash utils/e2e-cr jobname:teaming-account-resource-access-check jobphase:Running |
| 17 | +echo "Cloning testcase repository -----------------------------------------------------" |
| 18 | +git clone https://$username: [email protected]/mayadata-io/oep.git |
| 19 | +echo "Running test --------------------------------------------------------------------" |
| 20 | +echo "Validate teaming role-change process --------------------------------------------" |
| 21 | +kubectl create -f oep/litmus/director/account-access/run_litmus_test.yml |
| 22 | +test_name=account-resources-check |
| 23 | +echo $test_name |
| 24 | +litmus_pod=$(kubectl get po -n litmus | grep $test_name | awk {'print $1'} | tail -n 1) |
| 25 | +echo $litmus_pod |
| 26 | +job_status=$(kubectl get po $litmus_pod -n litmus | awk {'print $3'} | tail -n 1) |
| 27 | +while [[ "$job_status" != "Completed" ]] |
| 28 | +do |
| 29 | + job_status=$(kubectl get po $litmus_pod -n litmus | awk {'print $3'} | tail -n 1) |
| 30 | + sleep 6 |
| 31 | +done |
| 32 | +kubectl logs -f $litmus_pod -n litmus |
| 33 | +testResult=$(kubectl get litmusresult ${test_name} --no-headers -o custom-columns=:spec.testStatus.result) |
| 34 | +echo $testResult |
| 35 | +echo "Checking test result ------------------------------------------------------------" |
| 36 | +if [ "$testResult" != Pass ] |
| 37 | +then |
| 38 | + exit 1; |
| 39 | +else |
| 40 | + bash utils/e2e-cr jobname:teaming-account-resource-access-check jobphase:Completed |
| 41 | +fi |
0 commit comments