Skip to content

CSHARP-4399: Remove use of activate_venv.sh and utils.sh. #983

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

Merged
merged 2 commits into from
Dec 8, 2022
Merged
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
75 changes: 49 additions & 26 deletions evergreen/evergreen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -446,11 +446,12 @@ functions:
type: test
params:
silent: true
shell: "bash"
working_dir: mongo-csharp-driver
script: |
${PREPARE_SHELL}
cd ${DRIVERS_TOOLS}/.evergreen/auth_aws
. ./activate_venv.sh
. ./activate-authawsvenv.sh
mongo aws_e2e_regular_aws.js
- command: shell.exec
type: test
Expand All @@ -470,12 +471,13 @@ functions:
type: test
params:
silent: true
shell: "bash"
working_dir: mongo-csharp-driver
script: |
${PREPARE_SHELL}
# The aws_e2e_assume_role script requires python3 with boto3.
cd ${DRIVERS_TOOLS}/.evergreen/auth_aws
. ./activate_venv.sh
. ./activate-authawsvenv.sh
mongo aws_e2e_assume_role.js
- command: shell.exec
type: test
Expand All @@ -501,6 +503,7 @@ functions:
type: test
params:
silent: true
shell: "bash"
working_dir: mongo-csharp-driver
script: |
${PREPARE_SHELL}
Expand All @@ -509,7 +512,7 @@ functions:
exit 0
fi
cd ${DRIVERS_TOOLS}/.evergreen/auth_aws
. ./activate_venv.sh
. ./activate-authawsvenv.sh
mongo aws_e2e_ec2.js
- command: shell.exec
type: test
Expand All @@ -532,6 +535,7 @@ functions:
type: test
params:
silent: true
shell: "bash"
working_dir: mongo-csharp-driver
script: |
${PREPARE_SHELL}
Expand All @@ -540,7 +544,7 @@ functions:
exit 0
fi
cd ${DRIVERS_TOOLS}/.evergreen/auth_aws
. ./activate_venv.sh
. ./activate-authawsvenv.sh
echo "Project Directory: $PROJECT_DIRECTORY"
# SRC_DIRECTORY is workaround since EG_TOOLS expects "src" folder as a root
SRC_DIRECTORY=$(dirname $PROJECT_DIRECTORY)/src
Expand All @@ -560,6 +564,7 @@ functions:
- command: shell.exec
type: test
params:
shell: "bash"
working_dir: mongo-csharp-driver
script: |
${PREPARE_SHELL}
Expand All @@ -568,7 +573,7 @@ functions:
exit 0
fi
cd ${DRIVERS_TOOLS}/.evergreen/auth_aws
. ./activate_venv.sh
. ./activate-authawsvenv.sh
mongo aws_e2e_web_identity.js
- command: shell.exec
type: test
Expand Down Expand Up @@ -708,10 +713,12 @@ functions:
- command: shell.exec
params:
background: true
shell: "bash"
script: |
set -o xtrace
cd ${DRIVERS_TOOLS}/.evergreen/ocsp
nohup ./venv/Scripts/python ocsp_mock.py \
. ./activate-ocspvenv.sh
nohup python ocsp_mock.py \
--ca_file ${OCSP_ALGORITHM}/ca.pem \
--ocsp_responder_cert ${OCSP_ALGORITHM}/ca.crt \
--ocsp_responder_key ${OCSP_ALGORITHM}/ca.key \
Expand All @@ -727,10 +734,12 @@ functions:
- command: shell.exec
params:
background: true
shell: "bash"
script: |
set -o xtrace
cd ${DRIVERS_TOOLS}/.evergreen/ocsp
nohup ./venv/Scripts/python ocsp_mock.py \
. ./activate-ocspvenv.sh
nohup python ocsp_mock.py \
--ca_file ${OCSP_ALGORITHM}/ca.pem \
--ocsp_responder_cert ${OCSP_ALGORITHM}/ocsp-responder.crt \
--ocsp_responder_key ${OCSP_ALGORITHM}/ocsp-responder.key \
Expand All @@ -746,10 +755,12 @@ functions:
- command: shell.exec
params:
background: true
shell: "bash"
script: |
set -o xtrace
cd ${DRIVERS_TOOLS}/.evergreen/ocsp
nohup ./venv/Scripts/python.exe ocsp_mock.py \
. ./activate-ocspvenv.sh
nohup python ocsp_mock.py \
--ca_file ${OCSP_ALGORITHM}/ca.pem \
--ocsp_responder_cert ${OCSP_ALGORITHM}/ca.crt \
--ocsp_responder_key ${OCSP_ALGORITHM}/ca.key \
Expand All @@ -767,10 +778,12 @@ functions:
- command: shell.exec
params:
background: true
shell: "bash"
script: |
set -o xtrace
cd ${DRIVERS_TOOLS}/.evergreen/ocsp
nohup ./venv/Scripts/python.exe ocsp_mock.py \
. ./activate-ocspvenv.sh
nohup python ocsp_mock.py \
--ca_file ${OCSP_ALGORITHM}/ca.pem \
--ocsp_responder_cert ${OCSP_ALGORITHM}/ocsp-responder.crt \
--ocsp_responder_key ${OCSP_ALGORITHM}/ocsp-responder.key \
Expand Down Expand Up @@ -848,83 +861,93 @@ functions:
start-kms-mock-servers:
- command: shell.exec
params:
shell: "bash"
script: |
${PREPARE_SHELL}
cd ${DRIVERS_TOOLS}/.evergreen/csfle
. ./activate_venv.sh
. ./activate-kmstlsvenv.sh
- command: shell.exec
params:
background: true
shell: "bash"
script: |
#expired client cert
PYTHON=$(Venv="${DRIVERS_TOOLS}/.evergreen/csfle/kmstlsvenv" OS=${OS} ${PROJECT_DIRECTORY}/evergreen/get-python-path.sh);
cd ${DRIVERS_TOOLS}/.evergreen/csfle
$PYTHON -u kms_http_server.py -v --ca_file ../x509gen/ca.pem --cert_file ../x509gen/expired.pem --port 8000
. ./activate-kmstlsvenv.sh
python -u kms_http_server.py -v --ca_file ../x509gen/ca.pem --cert_file ../x509gen/expired.pem --port 8000
- command: shell.exec
params:
background: true
shell: "bash"
script: |
#wrong-host client cert
PYTHON=$(Venv="${DRIVERS_TOOLS}/.evergreen/csfle/kmstlsvenv" OS=${OS} ${PROJECT_DIRECTORY}/evergreen/get-python-path.sh);
cd ${DRIVERS_TOOLS}/.evergreen/csfle
$PYTHON -u kms_http_server.py -v --ca_file ../x509gen/ca.pem --cert_file ../x509gen/wrong-host.pem --port 8001
. ./activate-kmstlsvenv.sh
python -u kms_http_server.py -v --ca_file ../x509gen/ca.pem --cert_file ../x509gen/wrong-host.pem --port 8001
- command: shell.exec
params:
background: true
shell: "bash"
script: |
#server.pem client cert
PYTHON=$(Venv="${DRIVERS_TOOLS}/.evergreen/csfle/kmstlsvenv" OS=${OS} ${PROJECT_DIRECTORY}/evergreen/get-python-path.sh);
cd ${DRIVERS_TOOLS}/.evergreen/csfle
$PYTHON -u kms_http_server.py -v --ca_file ../x509gen/ca.pem --cert_file ../x509gen/server.pem --port 8002 --require_client_cert
. ./activate-kmstlsvenv.sh
python -u kms_http_server.py -v --ca_file ../x509gen/ca.pem --cert_file ../x509gen/server.pem --port 8002 --require_client_cert

start-kms-mock-kmip-server:
- command: shell.exec
params:
shell: "bash"
script: |
${PREPARE_SHELL}
cd ${DRIVERS_TOOLS}/.evergreen/csfle
. ./activate_venv.sh
. ./activate-kmstlsvenv.sh
- command: shell.exec
params:
shell: "bash"
background: true
script: |
PYTHON=$(Venv="${DRIVERS_TOOLS}/.evergreen/csfle/kmstlsvenv" OS=${OS} ${PROJECT_DIRECTORY}/evergreen/get-python-path.sh);
cd ${DRIVERS_TOOLS}/.evergreen/csfle
$PYTHON -u kms_kmip_server.py
. ./activate-kmstlsvenv.sh
python -u kms_kmip_server.py

start-kms-mock-gcp-server:
- command: shell.exec
params:
shell: "bash"
script: |
${PREPARE_SHELL}
cd ${DRIVERS_TOOLS}/.evergreen/csfle
. ./activate_venv.sh
. ./activate-kmstlsvenv.sh
- command: shell.exec
params:
background: true
shell: "bash"
script: |
PYTHON=$(Venv="${DRIVERS_TOOLS}/.evergreen/csfle/kmstlsvenv" OS=${OS} ${PROJECT_DIRECTORY}/evergreen/get-python-path.sh);
cd ${DRIVERS_TOOLS}/.evergreen/csfle/gcpkms
$PYTHON -m pip install PyJWT
. ./activate-kmstlsvenv.sh
python -m pip install PyJWT
mkdir ${DRIVERS_TOOLS}/tmp
echo '${GOOGLE_APPLICATION_CREDENTIALS_CONTENT}' > ${DRIVERS_TOOLS}/tmp/testgcpkms_key_file.json
export GOOGLE_APPLICATION_CREDENTIALS=${DRIVERS_TOOLS}/tmp/testgcpkms_key_file.json
$PYTHON -u mock_server.py
python -u mock_server.py

start-kms-mock-azure-imds-server:
- command: shell.exec
params:
shell: "bash"
script: |
${PREPARE_SHELL}
cd ${DRIVERS_TOOLS}/.evergreen/csfle
. ./activate_venv.sh
. ./activate-kmstlsvenv.sh
- command: shell.exec
params:
background: true
shell: "bash"
script: |
PYTHON=$(Venv="${DRIVERS_TOOLS}/.evergreen/csfle/kmstlsvenv" OS=${OS} ${PROJECT_DIRECTORY}/evergreen/get-python-path.sh);
cd ${DRIVERS_TOOLS}/.evergreen/csfle
$PYTHON bottle.py fake_azure:imds
. ./activate-kmstlsvenv.sh
python bottle.py fake_azure:imds

cleanup:
- command: shell.exec
Expand Down
29 changes: 0 additions & 29 deletions evergreen/get-python-path.sh

This file was deleted.