Skip to content

Commit

Permalink
ci: separate and extend keymanager tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pro-wh committed Feb 26, 2019
1 parent a95bc5b commit e9730f6
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 11 deletions.
10 changes: 10 additions & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,16 @@ steps:
###############
# E2E test jobs
###############
- label: Dummy key manager tests
timeout_in_minutes: 5
command:
- .buildkite/scripts/download_e2e_test_artifacts.sh
- .buildkite/scripts/test_dummy_keymanager.sh
agents:
buildkite_agent_size: large
plugins:
<<: *docker_plugin_configuration

- label: E2E tests (%n)
parallelism: 4
timeout_in_minutes: 20
Expand Down
51 changes: 51 additions & 0 deletions .buildkite/scripts/test_dummy_keymanager.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/bin/bash

############################################################
# This script tests the Ekiden dummy key manager.
#
# Usage:
# test_dummy_keymanager.sh [-w <workdir>]
############################################################

# Defaults.
WORKDIR=$(pwd)

#########################
# Process test arguments.
#########################
while getopts 'f:t:' arg
do
case ${arg} in
w) WORKDIR=${OPTARG};;
*)
echo "Usage: $0 [-w <workdir>]"
exit 1
esac
done

# Helpful tips on writing build scripts:
# https://buildkite.com/docs/pipelines/writing-build-scripts
set -euxo pipefail

source .buildkite/scripts/common.sh
source .buildkite/scripts/common_e2e.sh
source .buildkite/rust/common.sh

# Test the key manager node.
test_keymanager() {
sleep 3

${WORKDIR}/target/debug/ekiden-keymanager-test-client \
--mrenclave $(cat ${WORKDIR}/target/enclave/ekiden-keymanager-trusted.mrenclave) \
--tls-certificate ${WORKDIR}/tests/keymanager/km.pem
}

# Test minimal configuration.
run_keymanager_node
test_keymanager
cleanup

# Test with provided internal keys.
run_keymanager_node --internal-keys "${WORKDIR}/tests/keymanager/internal-keys.cbor"
test_keymanager
cleanup
12 changes: 1 addition & 11 deletions .buildkite/scripts/test_e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,6 @@ scenario_discrepancy() {
set_epoch 1
}

# Test the key manager node.
test_keymanager() {
sleep 3

${WORKDIR}/target/debug/ekiden-keymanager-test-client \
--mrenclave $(cat ${WORKDIR}/target/enclave/ekiden-keymanager-trusted.mrenclave) \
--tls-certificate ${WORKDIR}/tests/keymanager/km.pem
}

# Assert that the logger works.
assert_logger_works() {
assert_basic_success
Expand Down Expand Up @@ -123,8 +114,7 @@ test_suite() {
name="e2e-${backend_name}-basic-db-encryption" \
backend_runner=$backend_runner \
runtime=test-db-encryption \
client=test-db-encryption \
post_km_hook=test_keymanager
client=test-db-encryption

# Enclave logger test.
run_test \
Expand Down
Binary file added tests/keymanager/internal-keys.cbor
Binary file not shown.

0 comments on commit e9730f6

Please sign in to comment.