autotest: Validate netblock strings before parsing

Consolidate all construction paths into a single helper function and
do some limited validation of passed in arguments before attempting to
parse them.  This should get us more meaningful messages when tests
attempt to use invalid netblock strings in logic.

BUG=chromium:433621
TEST=network_BasicProfileProperties still passes.

Change-Id: Ic5887ed72ddd46b6dd14cb97c8e2f9747eea10ab
Reviewed-on: https://chromium-review.googlesource.com/236656
Tested-by: Christopher Wiley <wiley@chromium.org>
Reviewed-by: Peter Qiu <zqiu@chromium.org>
Commit-Queue: Christopher Wiley <wiley@chromium.org>
4 files changed