Merge copy_status_to_sample script from test_scripts