move test earlier to avoid unneeded ssh