[PATCH v2 10/40] test: Create pre/post-run functions