36 from __future__
import print_function
39 NAME =
'on_shutdown_test'
52 super(TestOnShutdown, self).
__init__(*args)
56 print(rospy.get_caller_id(),
"I heard %s"%data.data)
58 if "I'm dead" in data.data:
62 rospy.Subscriber(
"chatter", String, self.
callback)
63 rospy.init_node(NAME, anonymous=
True)
64 timeout_t = time.time() + 10.0*1000
65 while not rospy.is_shutdown()
and not self.
success and time.time() < timeout_t:
69 if __name__ ==
'__main__':
70 rostest.rosrun(PKG, NAME, TestOnShutdown, sys.argv)