[PATCH 37/42] test: Improve handling of sending commands