Refactor jenkins agent tests