Refactor ipam tests