[Smoke tests] Small refactor to config loading.
[Smoke tests] Small refactor to config loading.

Closes: #5337
Approved by: gregnazario

aptos-labs/aptos-core,aptos-labs/aptos-core,libra/libra,aptos-labs/aptos-core,libra/libra,aptos-labs/aptos-core,aptos-labs/aptos-core,libra/libra,libra/libra,aptos-labs/aptos-core,libra/libra,aptos-labs/aptos-core