[PATCH v2 30/43] test: Create a common function to get the config