[PATCH v7 3/8] test: Create a common function to get the config