Added test_and_set_status method

Change-Id: I130ef92c3ceec1a9edd7cfbb1aecddb37bf8c719