From b5891141d886f742b5ee0b9caf58ebba3db5a297 Mon Sep 17 00:00:00 2001 From: "Julian M. Kunkel" Date: Sun, 22 Nov 2020 11:43:42 +0000 Subject: [PATCH] Move checks before inititalization. Add simple validation for S3. --- src/aiori-S3-libs3.c | 10 ++++++++++ src/md-workbench.c | 7 +++---- src/mdtest.c | 8 ++++---- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/src/aiori-S3-libs3.c b/src/aiori-S3-libs3.c index c8e29c2..668f6a6 100644 --- a/src/aiori-S3-libs3.c +++ b/src/aiori-S3-libs3.c @@ -451,6 +451,16 @@ static IOR_offset_t S3_GetFileSize(aiori_mod_opt_t * options, char *testFileName static int S3_check_params(aiori_mod_opt_t * options){ + s3_options_t * o = (s3_options_t*) options; + if(o->access_key == NULL){ + o->access_key = ""; + } + if(o->secret_key == NULL){ + o->secret_key = ""; + } + if(o->host == NULL){ + WARN("The S3 hostname should be specified"); + } return 0; } diff --git a/src/md-workbench.c b/src/md-workbench.c index 34dfa01..869b4fd 100644 --- a/src/md-workbench.c +++ b/src/md-workbench.c @@ -890,16 +890,15 @@ mdworkbench_results_t* md_workbench_run(int argc, char ** argv, MPI_Comm world_c exit(1); } - if (o.backend->initialize){ - o.backend->initialize(o.backend_options); - } if(o.backend->xfer_hints){ o.backend->xfer_hints(& o.hints); } if(o.backend->check_params){ o.backend->check_params(o.backend_options); } - + if (o.backend->initialize){ + o.backend->initialize(o.backend_options); + } int current_index = 0; diff --git a/src/mdtest.c b/src/mdtest.c index 6efd852..98c43d0 100644 --- a/src/mdtest.c +++ b/src/mdtest.c @@ -1981,16 +1981,16 @@ mdtest_results_t * mdtest_run(int argc, char **argv, MPI_Comm world_com, FILE * MPI_Comm_rank(testComm, &rank); MPI_Comm_size(testComm, &size); - if (backend->initialize){ - backend->initialize(backend_options); - } if(backend->xfer_hints){ backend->xfer_hints(& hints); } if(backend->check_params){ backend->check_params(backend_options); } - + if (backend->initialize){ + backend->initialize(backend_options); + } + pid = getpid(); uid = getuid();