Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
Signed-off-by: Bruno Vavala <bruno.vavala@intel.com>
  • Loading branch information
bvavala committed Mar 28, 2024
1 parent 69985ae commit c927a58
Show file tree
Hide file tree
Showing 18 changed files with 13 additions and 149 deletions.
2 changes: 1 addition & 1 deletion bin/lib/common_service.sh
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ service_start() {
${F_LOGLEVEL} 2> $EFILE > $OFILE &
echo $! > ${F_LOGDIR}/${IDENTITY}.pid
else
${F_SERVICE_CMD} --identity ${IDENTITY} --config ${IDENTITY}.toml enclave.toml --config-dir ${F_CONFDIR} \
${F_SERVICE_CMD} --identity ${IDENTITY} --config ${IDENTITY}.toml --config-dir ${F_CONFDIR} \
${F_LEDGERURL} ${F_LOGLEVEL} 2> $EFILE > $OFILE &
echo $! > ${F_LOGDIR}/${IDENTITY}.pid
fi
Expand Down
2 changes: 1 addition & 1 deletion build/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ ${PDO_SGX_KEY_ROOT}/enclave_code_sign.pem :
# First value is the number of eservices, then pservices, then
# sservices, 5 of each is the default
SERVICES_COUNT ?= 5 5 5
SERVICES_CONF_TEMPLATES = $(addprefix $(SCRIPTDIR)/template/, eservice.toml pservice.toml enclave.toml)
SERVICES_CONF_TEMPLATES = $(addprefix $(SCRIPTDIR)/template/, eservice.toml pservice.toml)
SERVICES_CONF_TARGET = $(DSTDIR)/opt/pdo/.services_configured

$(SERVICES_CONF_TARGET) : $(PYTHON_DIR) $(SERVICE_CONF_TEMPLATES)
Expand Down
4 changes: 2 additions & 2 deletions build/cmake/Test.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ SET(PDO_TEST_CONTRACT
--logfile ${TEST_LOG_FILE})

# NOTE: we override the default configuration here because clients
# do not have the full configuration files (eservice1.toml and
# enclave.toml) and when running with services these are not required.
# do not have the full configuration file (eservice1.toml) and
# when running with services these are not required.
SET(PDO_TEST_CONTRACT_WITH_SERVICES
${PDO_TEST_CONTRACT}
--ledger ${TEST_LEDGER}
Expand Down
30 changes: 0 additions & 30 deletions build/template/enclave.toml

This file was deleted.

2 changes: 0 additions & 2 deletions docker/tools/run_services_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ export NO_PROXY=$PDO_HOSTNAME,$PDO_LEDGER_ADDRESS,$NO_PROXY
# -----------------------------------------------------------------
yell copy sgx keys
# -----------------------------------------------------------------
# this collateral *must* be copied before configuring the services
# as it will be included in the service/enclave toml files
[ -z "$(ls -A ${XFER_DIR}/services/keys/sgx/)" ] ||\
cp ${XFER_DIR}/services/keys/sgx/* ${PDO_SGX_KEY_ROOT}
# refresh the environment variables (necessary for SGX-related ones)
Expand Down
2 changes: 0 additions & 2 deletions docker/tools/start_services.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@ export NO_PROXY=$PDO_HOSTNAME,$PDO_LEDGER_ADDRESS,$NO_PROXY
# -----------------------------------------------------------------
yell copy sgx keys
# -----------------------------------------------------------------
# this collateral *must* be copied before configuring the services
# as it will be included in the service/enclave toml files
[ -z "$(ls -A ${XFER_DIR}/services/keys/sgx/)" ] ||\
cp ${XFER_DIR}/services/keys/sgx/* ${PDO_SGX_KEY_ROOT}
# refresh the environment variables (necessary for SGX-related ones)
Expand Down
4 changes: 0 additions & 4 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ configuration file:
| `sservice` | state storage service associated with an enclave service | [`sservice.toml`](../build/opt/pdo/templates/sservice.toml) |
| `pdo-shell` | the PDO client shell for creating contracts and invoking methods | [`pcontract.toml`](../build/opt/pdo/templates/pcontract.toml) |

For simplicity in installation, the file `enclave.toml` in the
`${PDO_HOME}/etc` directory contains the configuration for the accessing
the Intel Attestation Service.

In addition, most provided `pdo-shell` scripts use the service
configuration information found in
[`${PDO_HOME}/etc/site.psh`](../build/opt/pdo/templates/site.psh).
Expand Down
4 changes: 1 addition & 3 deletions eservice/bin/register-with-ledger.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ ETCDIR=${DSTDIR}/opt/pdo/etc/

ESERVICE_IDENTITY=eservice1
ESERVICE_TOML=${ESERVICE_IDENTITY}.toml
ENCLAVE_TOML=enclave.toml

SGX_KEY_ROOT=${PDO_SGX_KEY_ROOT:-${SRCDIR}/build/keys/sgx_mode_${SGX_MODE,,}}

Expand Down Expand Up @@ -50,14 +49,13 @@ function DeriveIasPublicKey {

function Store {
try test -e ${ETCDIR}/${ESERVICE_TOML}
try test -e ${ETCDIR}/${ENCLAVE_TOML}
yell Download IAS certificates and Compute the enclave information
try eservice-enclave-info \
--save ${eservice_enclave_info_file} \
--loglevel warn \
--logfile __screen__ \
--identity ${ESERVICE_IDENTITY} \
--config ${ESERVICE_TOML} ${ENCLAVE_TOML} \
--config ${ESERVICE_TOML} \
--config-dir ${ETCDIR}
yell Enclave info are ready
}
Expand Down
91 changes: 0 additions & 91 deletions eservice/etc/sample_eservice.toml

This file was deleted.

2 changes: 1 addition & 1 deletion eservice/pdo/eservice/pdo_enclave.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def initialize_with_configuration(config) :
enclave.SetLogger(logger)

# Ensure that the required keys are in the configuration
valid_keys = set(['ias_url'])
valid_keys = set(['ias_url', 'SgxKeyRoot'])
found_keys = set(config.keys())

missing_keys = valid_keys.difference(found_keys)
Expand Down
2 changes: 1 addition & 1 deletion eservice/pdo/eservice/scripts/EServiceCLI.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ def Main() :
config_map = pconfig.build_configuration_map()

# parse out the configuration file first
conffiles = [ 'eservice.toml', 'enclave.toml' ]
conffiles = [ 'eservice.toml' ]
confpaths = [ ".", "./etc", config_map['etc'] ]

parser = argparse.ArgumentParser()
Expand Down
2 changes: 1 addition & 1 deletion eservice/pdo/eservice/scripts/EServiceEnclaveInfoCLI.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def Main() :
config_map = pconfig.build_configuration_map()

# parse out the configuration file first
conffiles = [ 'eservice.toml', 'enclave.toml' ]
conffiles = [ 'eservice.toml' ]
confpaths = [ ".", "./etc", config_map['etc'] ]

parser = argparse.ArgumentParser()
Expand Down
4 changes: 1 addition & 3 deletions eservice/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@
'bin/es-start.sh', 'bin/es-stop.sh', 'bin/es-status.sh',
]),
(dat_dir, []),
(etc_dir, [
'etc/sample_eservice.toml',
]),
(etc_dir, []),
(log_dir, []),
(key_dir, []),
('lib', [ os.path.join(script_dir, 'deps/bin/libpdo-enclave.signed.so')])
Expand Down
2 changes: 1 addition & 1 deletion eservice/tests/test-secrets.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def ErrorShutdown() :
# -----------------------------------------------------------------
# -----------------------------------------------------------------
config_map = pconfig.build_configuration_map()
conffiles = [ 'pcontract.toml', 'enclave.toml', 'eservice1.toml' ]
conffiles = [ 'pcontract.toml', 'eservice1.toml' ]
confpaths = [ ".", "./etc", config_map['etc'] ]

import argparse
Expand Down
2 changes: 1 addition & 1 deletion pservice/pdo/pservice/pdo_enclave.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def initialize_with_configuration(config) :
enclave._SetLogger(logger)

# Ensure that the required keys are in the configuration
valid_keys = set(['ias_url'])
valid_keys = set(['ias_url', 'SgxKeyRoot'])
found_keys = set(config.keys())

missing_keys = valid_keys.difference(found_keys)
Expand Down
3 changes: 0 additions & 3 deletions python/pdo/scripts/ConfigureCLI.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,6 @@ def configure_services() :
for n in range(1, options.count[2]+1) :
expand_service(options, 'pservice', 'ProvisioningService', n)

# Generate enclave configuration file
expand_helper(options, 'enclave.toml')

filename = os.path.join(options.output_directory, 'etc', 'site.toml')
with open(filename, 'w') as outfile:
toml.dump(site_information, outfile)
Expand Down
2 changes: 1 addition & 1 deletion python/pdo/test/contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ def Main() :
config_map = pconfig.build_configuration_map()

# parse out the configuration file first
conffiles = [ 'pcontract.toml', 'enclave.toml', 'eservice1.toml' ]
conffiles = [ 'pcontract.toml', 'eservice1.toml' ]
confpaths = [ ".", "./etc", config_map['etc'] ]

parser = argparse.ArgumentParser()
Expand Down
2 changes: 1 addition & 1 deletion python/pdo/test/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ def Main() :
config_map = pconfig.build_configuration_map()

# parse out the configuration file first
conffiles = [ 'pcontract.toml', 'enclave.toml', 'eservice1.toml' ]
conffiles = [ 'pcontract.toml', 'eservice1.toml' ]
confpaths = [ ".", "./etc", config_map['etc'] ]

parser = argparse.ArgumentParser()
Expand Down

0 comments on commit c927a58

Please sign in to comment.