adding new random port mechanism for tests

Branch: ops-1184