Add tests for get_ip
Rewind tmpfile before reading it