Allow network related tests to be skipped if no network is available. Fixes #6710.