[PATCH v5 07/20] test: Create a common function to get the config