Calculate CIDR for test envs rather than assuming

Since we're now using non-/24 this matters :).

Change-Id: I636a96b4514d0ca826f61f1c158800cd4b214401
Merge "Calculate CIDR for test envs rather than assuming"