Skip to content

Commit

Permalink
adding teaming-account-access job
Browse files Browse the repository at this point in the history
Signed-off-by: harshita-sharma011 <[email protected]>
  • Loading branch information
harshita-sharma011 committed Feb 20, 2020
1 parent 9229d6d commit a3276ec
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 1 deletion.
9 changes: 9 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,15 @@ teaming-invite-check:
- chmod 755 ./stages/7-teaming-check/teaming-invite-check
- ./stages/7-teaming-check/teaming-invite-check

teaming-account-resource-access-check:
image: harshshekhar15/gitlab-job:v1
stage: TEAMING-CHECK
dependencies:
- cluster-setup-check
script:
- chmod 755 ./stages/7-teaming-check/teaming-account-resource-access-check
- ./stages/7-teaming-check/teaming-account-resource-access-check

teaming-change-role-check:
image: harshshekhar15/gitlab-job:v1
stage: TEAMING-CHECK
Expand Down
44 changes: 44 additions & 0 deletions stages/7-teaming-check/teaming-account-resource-access-check
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@

#!/bin/bash

set -e

path=$(pwd)
mkdir ~/.kube
cp .gcp/config ~/.kube/config

echo $SDK_TOKEN > key.json
gcloud auth activate-service-account --key-file=key.json
gcloud config set project openebs-ci
export GOOGLE_APPLICATION_CREDENTIALS="$path/key.json"

bash utils/pooling jobname:teaming-invite-check
bash utils/e2e-cr jobname:teaming-account-resource-access-check jobphase:Running

git clone https://$username:[email protected]/mayadata-io/oep.git

######################
## Running test ##
######################

echo "Validate teaming role-change process --------------------------------------------"
kubectl create -f oep/litmus/director/account-access/run_litmus_test.yml
test_name=account-resources-check
echo $test_name
litmus_pod=$(kubectl get po -n litmus | grep $test_name | awk {'print $1'} | tail -n 1)
echo $litmus_pod
job_status=$(kubectl get po $litmus_pod -n litmus | awk {'print $3'} | tail -n 1)
while [[ "$job_status" != "Completed" ]]
do
job_status=$(kubectl get po $litmus_pod -n litmus | awk {'print $3'} | tail -n 1)
sleep 6
done
kubectl logs -f $litmus_pod -n litmus
testResult=$(kubectl get litmusresult ${test_name} --no-headers -o custom-columns=:spec.testStatus.result)
echo $testResult
if [ "$testResult" != Pass ]
then
exit 1;
else
bash utils/e2e-cr jobname:teaming-account-resource-access-check jobphase:Completed
fi
2 changes: 1 addition & 1 deletion stages/7-teaming-check/teaming-change-role-check
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ gcloud auth activate-service-account --key-file=key.json
gcloud config set project openebs-ci
export GOOGLE_APPLICATION_CREDENTIALS="$path/key.json"

bash utils/pooling jobname:teaming-invite-check
bash utils/pooling jobname:teaming-account-resource-access-check
bash utils/e2e-cr jobname:teaming-change-role-check jobphase:Running

git clone https://$username:[email protected]/mayadata-io/oep.git
Expand Down
1 change: 1 addition & 0 deletions stages/7-teaming-check/teaming-invite-check
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ kubectl apply -f utils/e2e-crd.yml

bash utils/e2e-cr jobname:teaming-invite-check jobphase:Waiting
bash utils/e2e-cr jobname:teaming-invite-check jobphase:Running
bash utils/e2e-cr jobname:teaming-account-resource-access-check jobphase:Waiting
bash utils/e2e-cr jobname:teaming-change-role-check jobphase:Waiting
bash utils/e2e-cr jobname:teaming-change-role-negative-check jobphase:Waiting

Expand Down

0 comments on commit a3276ec

Please sign in to comment.