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 *
|
||||
|
||||
def check_connection():
|
||||
if not is_connected():
|
||||
# Raise to cause NS in try_and_print()
|
||||
raise Exception
|
||||
if not is_connected():
|
||||
# Raise to cause NS in try_and_print()
|
||||
raise Exception
|
||||
|
||||
if __name__ == '__main__':
|
||||
try:
|
||||
# Prep
|
||||
clear_screen()
|
||||
print_standard('Hardware Diagnostics: Network\n')
|
||||
try:
|
||||
# Prep
|
||||
clear_screen()
|
||||
print_standard('Hardware Diagnostics: Network\n')
|
||||
|
||||
# Connect
|
||||
print_standard('Initializing...')
|
||||
connect_to_network()
|
||||
# Connect
|
||||
print_standard('Initializing...')
|
||||
connect_to_network()
|
||||
|
||||
# Tests
|
||||
try_and_print(
|
||||
message='Network connection:', function=check_connection, cs='OK')
|
||||
show_valid_addresses()
|
||||
try_and_print(message='Internet connection:', function=ping,
|
||||
addr='8.8.8.8', cs='OK')
|
||||
try_and_print(message='DNS Resolution:', function=ping, cs='OK')
|
||||
try_and_print(message='Speedtest:', function=speedtest,
|
||||
print_return=True)
|
||||
|
||||
# Done
|
||||
print_standard('\nDone.')
|
||||
#pause("Press Enter to exit...")
|
||||
exit_script()
|
||||
except SystemExit:
|
||||
pass
|
||||
except:
|
||||
major_exception()
|
||||
# Tests
|
||||
try_and_print(
|
||||
message='Network connection:', function=check_connection, cs='OK')
|
||||
show_valid_addresses()
|
||||
try_and_print(message='Internet connection:', function=ping,
|
||||
addr='8.8.8.8', cs='OK')
|
||||
try_and_print(message='DNS Resolution:', function=ping, cs='OK')
|
||||
try_and_print(message='Speedtest:', function=speedtest,
|
||||
print_return=True)
|
||||
|
||||
# Done
|
||||
print_standard('\nDone.')
|
||||
#pause("Press Enter to exit...")
|
||||
exit_script()
|
||||
except SystemExit:
|
||||
pass
|
||||
except:
|
||||
major_exception()
|
||||
|
||||
# vim: sts=2 sw=2 ts=2
|
||||
|
|
|
|||
Loading…
Reference in a new issue