Commit 8e189089 authored by Yunhua Koglin's avatar Yunhua Koglin
Browse files

test aws cicd

parent facc3c00
......@@ -22,6 +22,11 @@ variables:
AZURE_DOCKER_SUBDIR: build/Dockerfile
AZURE_TEST_SUBDIR: tests/integration
AZURE_TEST_TYPE: python
AWS_SERVICE: wellbore-ddms
AWS_ENVIRONMENT: dev
AWS_BUILD_SUBDIR: provider/os-wellbore-ddms-aws/build-aws
AWS_TEST_SUBDIR: tests/aws-test
include:
- project: "osdu/platform/ci-cd-pipelines"
......@@ -43,6 +48,9 @@ include:
file: 'cloud-providers/ibm-wellbore.yml'
- local: "/devops/azure/azure-wellbore.yml"
- project: 'osdu/platform/ci-cd-pipelines'
file: 'cloud-providers/aws.yml'
# --------------------------------------------------------------------------------
containerize:
......
import os;
import boto3;
import jwt;
def get_id_token():
client = boto3.client('cognito-idp', region_name=os.environ["AWS_REGION"])
userAuth = client.initiate_auth(
ClientId= os.environ['AWS_COGNITO_CLIENT_ID'],
AuthFlow= os.environ['AWS_COGNITO_AUTH_FLOW'],
AuthParameters= {
"USERNAME": os.environ['AWS_COGNITO_AUTH_PARAMS_USER'],
"PASSWORD": os.environ['AWS_COGNITO_AUTH_PARAMS_PASSWORD']
})
print(userAuth['AuthenticationResult']['AccessToken'])
def get_invalid_token():
#generate a dummy jwt
return jwt.encode({'some': 'payload'}, 'secret', algorithm='HS256').decode("utf-8")
if __name__ == '__main__':
get_id_token()
echo "**********Current Dir ***********************"
echo $(pwd)
echo $(ls)
echo "*********Am I at tests dir???**********"
cd ../../../
echo $(pwd)
echo $(ls)
pip install virtualenv
virtualenv venv
source venv/bin/activate
pip install --upgrade pip
pip install wheel pytest pytest-cov
pip install -r requirements.txt
pip install -r requirements_dev.txt
svc_url=$WELLBORE_DDMS_URL
tenant='opendes'
acl_domain='testing.com'
legal_tag='opendes-sdmstestlegaltag'
svctoken=$(python tests/aws-test/build-aws/aws_jwt_client.py)
cd tests/integration
python gen_postman_env.py --token $svctoken --base_url $svc_url --cloud_provider "aws" --acl_domain $acl_domain --legal_tag $legal_tag --data_partition $tenant
pytest ./functional --environment="./generated/postman_environment.json" --filter-tag=basic
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment