fixed hostname retrieval in test scripts