Skip to content

Commit 899af22

Browse files
chore(CI): Build test vectors from source (#724)
1 parent 8a9d97b commit 899af22

24 files changed

+67
-4
lines changed

codebuild/py311/awses_local_mpl.yml

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ phases:
2121
python: 3.11
2222
build:
2323
commands:
24+
# Build Python MPL TestVector runner from source
25+
- sh test_vector_handlers/scripts/install_mpl_test_vector_runner.sh
2426
- pip install "tox < 4.0"
2527
- cd test_vector_handlers
2628
- tox

codebuild/py311/decrypt_dafny_esdk_vectors_keyrings.yml

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ phases:
2222
python: 3.11
2323
pre_build:
2424
commands:
25+
# Build Python MPL TestVector runner from source
26+
- sh test_vector_handlers/scripts/install_mpl_test_vector_runner.sh
2527
# Fetch test vectors from Dafny ESDK's most recent run
2628
# (Assuming the first result is most recent; seems to be correct...)
2729
- |

codebuild/py311/decrypt_golden_manifest_with_keyrings.yml

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ phases:
1818
python: 3.11
1919
pre_build:
2020
commands:
21+
# Build Python MPL TestVector runner from source
22+
- sh test_vector_handlers/scripts/install_mpl_test_vector_runner.sh
2123
# Download "golden manifest"
2224
- curl -L -o python-2.3.0.zip https://github.com/awslabs/aws-encryption-sdk-test-vectors/raw/master/vectors/awses-decrypt/python-2.3.0.zip
2325
- unzip python-2.3.0.zip -d python-2.3.0

codebuild/py311/decrypt_golden_manifest_with_masterkey.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: 0.2
22

33
env:
44
variables:
5-
TOXENV: "py311-full_decrypt-mpl"
5+
TOXENV: "py311-full_decrypt"
66
AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID: >-
77
arn:aws:kms:us-west-2:658956600833:key/b35311ef1-d8dc-4780-9f5a-55776cbb2f7f
88
AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID_2: >-

codebuild/py311/decrypt_keyrings_with_keyrings.yml

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ phases:
1818
python: 3.11
1919
pre_build:
2020
commands:
21+
# Build Python MPL TestVector runner from source
22+
- sh test_vector_handlers/scripts/install_mpl_test_vector_runner.sh
2123
# Download previously generated vectors
2224
- aws s3 cp s3://generated-vectors-artifacts-bucket/$CODEBUILD_RESOLVED_SOURCE_VERSION/311_keyrings.zip 311_keyrings.zip
2325
- unzip 311_keyrings.zip

codebuild/py311/decrypt_masterkey_with_keyrings.yml

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ phases:
1818
python: 3.11
1919
pre_build:
2020
commands:
21+
# Build Python MPL TestVector runner from source
22+
- sh test_vector_handlers/scripts/install_mpl_test_vector_runner.sh
2123
# Download previously generated vectors
2224
- aws s3 cp s3://generated-vectors-artifacts-bucket/$CODEBUILD_RESOLVED_SOURCE_VERSION/311_masterkey.zip 311_masterkey.zip
2325
- unzip 311_masterkey.zip

codebuild/py311/decrypt_net_401_vectors_keyrings.yml

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ phases:
1919
python: 3.11
2020
pre_build:
2121
commands:
22+
# Build Python MPL TestVector runner from source
23+
- sh test_vector_handlers/scripts/install_mpl_test_vector_runner.sh
2224
# Fetch ESDK .NET v4.0.1 Test Vectors
2325
- VECTOR_ZIP=$CODEBUILD_SRC_DIR/v4-Net-4.0.1.zip
2426
- VECTORS_URL=https://github.com/aws/aws-encryption-sdk-dafny/raw/mainline/AwsEncryptionSDK/runtimes/net/TestVectorsNative/TestVectors/resources/v4-Net-4.0.1.zip

codebuild/py311/encrypt_keyrings.yml

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ phases:
1818
python: 3.11
1919
build:
2020
commands:
21+
# Build Python MPL TestVector runner from source
22+
- sh test_vector_handlers/scripts/install_mpl_test_vector_runner.sh
2123
- pip install "tox < 4.0"
2224
- cd test_vector_handlers
2325
- |

codebuild/py311/generate_decrypt_vectors_keyrings.yml

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ phases:
1818
python: 3.11
1919
build:
2020
commands:
21+
# Build Python MPL TestVector runner from source
22+
- sh test_vector_handlers/scripts/install_mpl_test_vector_runner.sh
2123
- pip install "tox < 4.0"
2224
- cd test_vector_handlers
2325
- |

codebuild/py312/awses_local_mpl.yml

+2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ phases:
2323
python: 3.12
2424
build:
2525
commands:
26+
# Build Python MPL TestVector runner from source
27+
- sh test_vector_handlers/scripts/install_mpl_test_vector_runner.sh
2628
- cd /root/.pyenv/plugins/python-build/../.. && git pull && cd -
2729
- pyenv install --skip-existing 3.12.0
2830
- pyenv local 3.12.0

codebuild/py312/decrypt_dafny_esdk_vectors_keyrings.yml

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ phases:
2222
python: 3.12
2323
pre_build:
2424
commands:
25+
# Build Python MPL TestVector runner from source
26+
- sh test_vector_handlers/scripts/install_mpl_test_vector_runner.sh
2527
# Fetch test vectors from Dafny ESDK's most recent run
2628
# (Assuming the first result is most recent; seems to be correct...)
2729
- |

codebuild/py312/decrypt_golden_manifest_with_keyrings.yml

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ phases:
1818
python: 3.12
1919
pre_build:
2020
commands:
21+
# Build Python MPL TestVector runner from source
22+
- sh test_vector_handlers/scripts/install_mpl_test_vector_runner.sh
2123
# Download "golden manifest"
2224
- curl -L -o python-2.3.0.zip https://github.com/awslabs/aws-encryption-sdk-test-vectors/raw/master/vectors/awses-decrypt/python-2.3.0.zip
2325
- unzip python-2.3.0.zip -d python-2.3.0

codebuild/py312/decrypt_golden_manifest_with_masterkey.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: 0.2
22

33
env:
44
variables:
5-
TOXENV: "py312-full_decrypt-mpl"
5+
TOXENV: "py312-full_decrypt"
66
AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID: >-
77
arn:aws:kms:us-west-2:658956600833:key/b35311ef1-d8dc-4780-9f5a-55776cbb2f7f
88
AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID_2: >-

codebuild/py312/decrypt_hkeyring_with_keyrings.yml

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ phases:
1818
python: 3.12
1919
pre_build:
2020
commands:
21+
# Build Python MPL TestVector runner from source
22+
- sh test_vector_handlers/scripts/install_mpl_test_vector_runner.sh
2123
# Download previously generated vectors
2224
# This manifest has coverage for both HKeyring and required encryption context CMM
2325
- aws s3 cp s3://generated-vectors-artifacts-bucket/$CODEBUILD_RESOLVED_SOURCE_VERSION/312_hkeyring_reccmm_manifest.zip 312_hkeyring_reccmm_manifest.zip

codebuild/py312/decrypt_hkeyring_with_masterkey.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: 0.2
22

33
env:
44
variables:
5-
TOXENV: "py312-full_decrypt-mpl"
5+
TOXENV: "py312-full_decrypt"
66
AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID: >-
77
arn:aws:kms:us-west-2:658956600833:key/b35311ef1-d8dc-4780-9f5a-55776cbb2f7f
88
AWS_ENCRYPTION_SDK_PYTHON_INTEGRATION_TEST_AWS_KMS_KEY_ID_2: >-

codebuild/py312/decrypt_keyrings_with_keyrings.yml

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ phases:
1818
python: 3.12
1919
pre_build:
2020
commands:
21+
# Build Python MPL TestVector runner from source
22+
- sh test_vector_handlers/scripts/install_mpl_test_vector_runner.sh
2123
# Download previously generated vectors
2224
- aws s3 cp s3://generated-vectors-artifacts-bucket/$CODEBUILD_RESOLVED_SOURCE_VERSION/312_keyrings.zip 312_keyrings.zip
2325
- unzip 312_keyrings.zip

codebuild/py312/decrypt_masterkey_with_keyrings.yml

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ phases:
1818
python: 3.12
1919
pre_build:
2020
commands:
21+
# Build Python MPL TestVector runner from source
22+
- sh test_vector_handlers/scripts/install_mpl_test_vector_runner.sh
2123
# Download previously generated vectors
2224
- aws s3 cp s3://generated-vectors-artifacts-bucket/$CODEBUILD_RESOLVED_SOURCE_VERSION/312_masterkey.zip 312_masterkey.zip
2325
- unzip 312_masterkey.zip

codebuild/py312/decrypt_net_401_vectors_keyrings.yml

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ phases:
1919
python: 3.12
2020
pre_build:
2121
commands:
22+
# Build Python MPL TestVector runner from source
23+
- sh test_vector_handlers/scripts/install_mpl_test_vector_runner.sh
2224
# Fetch ESDK .NET v4.0.1 Test Vectors
2325
- VECTOR_ZIP=$CODEBUILD_SRC_DIR/v4-Net-4.0.1.zip
2426
- VECTORS_URL=https://github.com/aws/aws-encryption-sdk-dafny/raw/mainline/AwsEncryptionSDK/runtimes/net/TestVectorsNative/TestVectors/resources/v4-Net-4.0.1.zip

codebuild/py312/encrypt_keyrings.yml

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ phases:
1818
python: 3.12
1919
build:
2020
commands:
21+
# Build Python MPL TestVector runner from source
22+
- sh test_vector_handlers/scripts/install_mpl_test_vector_runner.sh
2123
- pip install "tox < 4.0"
2224
- cd test_vector_handlers
2325
- |

codebuild/py312/generate_decrypt_vectors_keyrings.yml

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ phases:
1818
python: 3.12
1919
build:
2020
commands:
21+
# Build Python MPL TestVector runner from source
22+
- sh test_vector_handlers/scripts/install_mpl_test_vector_runner.sh
2123
- pip install "tox < 4.0"
2224
- cd test_vector_handlers
2325
- |

codebuild/py312/generate_hkeyring_decrypt_vectors.yml

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ phases:
1818
python: 3.12
1919
build:
2020
commands:
21+
# Build Python MPL TestVector runner from source
22+
- sh test_vector_handlers/scripts/install_mpl_test_vector_runner.sh
2123
- pip install "tox < 4.0"
2224
- cd test_vector_handlers/test/aws-crypto-tools-test-vector-framework
2325
# Checkout WIP branch with manifest containing HKeyring and required EC CMM test cases
+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
aws-cryptography-internal-mpl-testvectors @ git+https://github.com/aws/aws-cryptographic-material-providers-library.git@python-main-with-dafny-code#subdirectory=TestVectorsAwsCryptographicMaterialProviders/runtimes/python
1+
aws-cryptographic-material-providers==1.7.4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Builds the Python MPL TestVector runner from source.
2+
# This package is used by the ESDK-Python test vectors for testing with the MPL.
3+
4+
# This script is intended to be used by ESDK-Python's integration tests.
5+
# You may need or want to make local changes to get this work on your machine.
6+
7+
# Change to the directory of the script
8+
cd "$(dirname "$0")"
9+
10+
# Get MPL version specified in requirements.txt
11+
export mplVersion=$(grep 'aws-cryptographic-material-providers==' ../requirements_mpl.txt | sed -E 's/.*==(.+)/\1/')
12+
13+
# Clone MPL repo to get test vectors runner source code and the Dafny version to use
14+
git clone --branch v$mplVersion --recurse-submodules https://github.com/aws/aws-cryptographic-material-providers-library.git
15+
16+
# Download Dafny to build the test vector runner; get Dafny version from ESDK's project.properties file
17+
export dafnyVersion=$(grep '^dafnyVersion=' aws-cryptographic-material-providers-library/project.properties | cut -d '=' -f 2)
18+
curl https://github.com/dafny-lang/dafny/releases/download/v$dafnyVersion/dafny-$dafnyVersion-x64-ubuntu-20.04.zip -L -o dafny.zip
19+
unzip -qq dafny.zip && rm dafny.zip
20+
export PATH="$PWD/dafny:$PATH"
21+
22+
# Build MPL test vector runner from source
23+
cd aws-cryptographic-material-providers-library/TestVectorsAwsCryptographicMaterialProviders/
24+
make transpile_python

test_vector_handlers/tox.ini

+3
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ deps =
5151
-rtest/requirements.txt
5252
# Install the MPL requirements if the `-mpl` suffix is present
5353
mpl: -rrequirements_mpl.txt
54+
# This is the filepath used in ESDK-Python's integration tests.
55+
# You may need to change this to run this project locally.
56+
mpl: scripts/aws-cryptographic-material-providers-library/TestVectorsAwsCryptographicMaterialProviders/runtimes/python
5457
..
5558
commands =
5659
awses_local: {[testenv:base-command]commands}

0 commit comments

Comments
 (0)