Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding teaming-account-access job #45

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
41 changes: 41 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,41 @@

#!/bin/bash

set -e
echo "Copying user cluster kube-config from artifact directory -------------------------"
path=$(pwd)
mkdir ~/.kube
cp .gcp/config ~/.kube/config
echo "Setting up gcloud credentials ----------------------------------------------------"
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"
echo "Updating gitlab job status in e2e-cr --------------------------------------------"
bash utils/pooling jobname:teaming-invite-check
bash utils/e2e-cr jobname:teaming-account-resource-access-check jobphase:Running
echo "Cloning testcase repository -----------------------------------------------------"
git clone https://$username:[email protected]/mayadata-io/oep.git
echo "Running test --------------------------------------------------------------------"
echo "Validate teaming role-change process --------------------------------------------"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its good to have more echo statements & some line spaces

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
echo "Checking test result ------------------------------------------------------------"
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