improve devices connection methods in tests

No match.