(args)
| 149 | |
| 150 | |
| 151 | def check_network(args): |
| 152 | print("----------Network Test----------") |
| 153 | if args.timeout > 0: |
| 154 | print("Setting timeout: {}".format(args.timeout)) |
| 155 | socket.setdefaulttimeout(10) |
| 156 | for region in args.region.strip().split(","): |
| 157 | r = region.strip().lower() |
| 158 | if not r: |
| 159 | continue |
| 160 | if r in REGIONAL_URLS: |
| 161 | URLS.update(REGIONAL_URLS[r]) |
| 162 | else: |
| 163 | import warnings |
| 164 | |
| 165 | warnings.warn("Region {} do not need specific test, please refer to global sites.".format(r), stacklevel=2) |
| 166 | for name, url in URLS.items(): |
| 167 | test_connection(name, url, args.timeout) |
| 168 | |
| 169 | |
| 170 | def check_environment(): |
no test coverage detected