query_sm + test