Skip to content

Commit 199fdc8

Browse files
tgonzalezorlandoarmgowthamsk-arm
authored andcommitted
ci.sh: Add create-keys option to create keys via parsec-tool
When re-running ci.sh to execute tests locally, the ci.sh script may fail with "key already exists" error. * Only create the key via parsec-tool when specified. Signed-off-by: Tomás González <tomasagustin.gonzalezorlando@arm.com>
1 parent 0a5e951 commit 199fdc8

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

.github/actions/ci_script/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ runs:
1919
image-name: "${{ env.TEST_DOCKER_IMAGE }}"
2020
image-path: "/tmp"
2121
- name: Run the container to execute the test script
22-
run: docker run -v $(pwd):/tmp/parsec-openssl-provider -w /tmp/parsec-openssl-provider --env RUST_TOOLCHAIN_VERSION=${{ inputs.rs-version }} -t ${{ env.TEST_DOCKER_IMAGE }} /tmp/parsec-openssl-provider/tests/ci.sh --${{ inputs.ci-flags }}
22+
run: docker run -v $(pwd):/tmp/parsec-openssl-provider -w /tmp/parsec-openssl-provider --env RUST_TOOLCHAIN_VERSION=${{ inputs.rs-version }} -t ${{ env.TEST_DOCKER_IMAGE }} /tmp/parsec-openssl-provider/tests/ci.sh --${{ inputs.ci-flags }} --create-keys
2323
shell: bash

tests/ci.sh

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@ usage () {
99
printf "
1010
Continuous Integration test script
1111
12-
Usage: ./ci.sh --TEST
12+
Usage: ./ci.sh --TEST --OPTION
1313
where TEST can be one of:
1414
--build
1515
--build-and-test
1616
--static-checks
17+
and OPTION one of:
18+
--create-keys
1719
"
1820
}
1921

@@ -44,6 +46,7 @@ rustup update
4446
BUILD="False"
4547
TEST="False"
4648
STATIC_CHECKS="False"
49+
CREATE_KEYS="False"
4750

4851
while [ "$#" -gt 0 ]; do
4952
case "$1" in
@@ -57,6 +60,9 @@ while [ "$#" -gt 0 ]; do
5760
--static-checks )
5861
STATIC_CHECKS="True"
5962
;;
63+
--create-keys )
64+
CREATE_KEYS="True"
65+
;;
6066
*)
6167
error_msg "Unknown argument: $1"
6268
;;
@@ -81,8 +87,9 @@ if [ "$TEST" == "True" ]; then
8187

8288
wait_for_service
8389

84-
parsec-tool create-rsa-key -s -b 2048 -k PARSEC_TEST_KEYNAME
85-
90+
if [ "$CREATE_KEYS" == "True" ]; then
91+
parsec-tool create-rsa-key -s -b 2048 -k PARSEC_TEST_KEYNAME
92+
fi
8693
# Try loading the build parsec provider
8794
PROVIDER_LOAD_RESULT=$(openssl list -providers -provider-path ./target/debug/ -provider libparsec_openssl_provider_shared)
8895
echo $PROVIDER_LOAD_RESULT

0 commit comments

Comments
 (0)