Fix tests around sudo access