Updated hw-diags-network
This commit is contained in:
parent
b1786e088c
commit
c7706a115f
1 changed files with 29 additions and 28 deletions
|
|
@ -11,36 +11,37 @@ sys.path.append(os.getcwd())
|
||||||
from functions.network import *
|
from functions.network import *
|
||||||
|
|
||||||
def check_connection():
|
def check_connection():
|
||||||
if not is_connected():
|
if not is_connected():
|
||||||
# Raise to cause NS in try_and_print()
|
# Raise to cause NS in try_and_print()
|
||||||
raise Exception
|
raise Exception
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
try:
|
try:
|
||||||
# Prep
|
# Prep
|
||||||
clear_screen()
|
clear_screen()
|
||||||
print_standard('Hardware Diagnostics: Network\n')
|
print_standard('Hardware Diagnostics: Network\n')
|
||||||
|
|
||||||
# Connect
|
# Connect
|
||||||
print_standard('Initializing...')
|
print_standard('Initializing...')
|
||||||
connect_to_network()
|
connect_to_network()
|
||||||
|
|
||||||
# Tests
|
# Tests
|
||||||
try_and_print(
|
try_and_print(
|
||||||
message='Network connection:', function=check_connection, cs='OK')
|
message='Network connection:', function=check_connection, cs='OK')
|
||||||
show_valid_addresses()
|
show_valid_addresses()
|
||||||
try_and_print(message='Internet connection:', function=ping,
|
try_and_print(message='Internet connection:', function=ping,
|
||||||
addr='8.8.8.8', cs='OK')
|
addr='8.8.8.8', cs='OK')
|
||||||
try_and_print(message='DNS Resolution:', function=ping, cs='OK')
|
try_and_print(message='DNS Resolution:', function=ping, cs='OK')
|
||||||
try_and_print(message='Speedtest:', function=speedtest,
|
try_and_print(message='Speedtest:', function=speedtest,
|
||||||
print_return=True)
|
print_return=True)
|
||||||
|
|
||||||
# Done
|
# Done
|
||||||
print_standard('\nDone.')
|
print_standard('\nDone.')
|
||||||
#pause("Press Enter to exit...")
|
#pause("Press Enter to exit...")
|
||||||
exit_script()
|
exit_script()
|
||||||
except SystemExit:
|
except SystemExit:
|
||||||
pass
|
pass
|
||||||
except:
|
except:
|
||||||
major_exception()
|
major_exception()
|
||||||
|
|
||||||
|
# vim: sts=2 sw=2 ts=2
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue