Fixed tests to properly set slave hostname when using whitelist.

Review: https://reviews.apache.org/r/17969