Refactor edns subnet test to make it reusable