tests: Add set_state helper function in Client Agent tests.
tests: Let Client Agent client out of sandbox where appropriate.