[PATCH v2 03/44] test: Add functions to init and uninit the test state