Merge "Add new test cases to make sure the device is in the right state" into pi-dev