state machine into test package