def run(server_name='pcoip_server_name', operation='//15.83.240.98/Automation/Linux/scripts/logoff.exe'): test_name = 'VMware_win10_pcoip' cer = certificate.Cert('ROOTCA') find_cert = cer.check_cert() if find_cert is False: insert = cer.import_cert() if insert is False: report.fail_report('import cert fail', test_name) return False print('cert already exist') name, password = '******', 'password' case = thinpro_view.View(server_name, name, password) case.del_connection() case.create_connection() username = case.edit_connection() if username != gc.get_config(name): report.fail_report(username, test_name) return case.start_connection() connect = case.log_on_desktop() if connect is not True: report.fail_report(connect, test_name) return confirm_result = view_ftp.confirm_username(username) if confirm_result is False: case.logon_fail() report.fail_report('not find username.txt', test_name) return
def logon(username): operation = '//15.83.240.98/Automation/Linux/scripts/logoff.exe' case.start_connection() connect = case.log_on_desktop() if connect is not True: return connect confirm_result = view_ftp.confirm_username(username) if confirm_result is False: case.logon_fail() return 'logon fail,not find username.txt'
def run(server_name='blast_server_name'): file_name = 'VMware_win10_USB_key_USBR_blast' local_usb = check_usb() if local_usb is not True: report.fail_report(local_usb, file_name) return False operation = '//15.83.240.98/Automation/Linux/scripts/usbkey_redirection.exe' cer = certificate.Cert('ROOTCA') find_cert = cer.check_cert() if find_cert is False: insert = cer.import_cert() if insert is False: report.fail_report('import cert fail', file_name) return False blast_usbr_log.info('import cert success for %s' % file_name) name, password = '******', 'password' case = thinpro_view.View(server_name, name, password) case.del_connection() case.create_connection() username = case.edit_connection() if username != gc.get_config(name): report.fail_report(username, file_name) return False enable_usbr = edit_connection(case) if enable_usbr is not True: report.fail_report(enable_usbr, file_name) return False case.start_connection() connect = case.log_on_desktop() if connect is not True: report.fail_report(connect, file_name) return False confirm_result = view_ftp.confirm_username(username) if confirm_result is False: case.logon_fail() report.fail_report('not confirm username', file_name) return False
if username != name_in_config: # report.fail_report('edit connection fail', test_name) log_for_vmware_spec.error('%s for user %s.' % (username, name_in_config)) return '%s for user %s.' % (username, name_in_config) # change viewSecurityLevel to "All all connections" in registry # path of vmware in registry: "root/ConnectionType/view/connections" view_common_functions.change_view_sec_allow_all("root/ConnectionType/view/connections") case.start_connection() connect = case.log_on_desktop_spec() if connect is not True: if connect == 'desktop_unavailable': return 'desktop_unavailable' # report.fail_report(connect, test_name) log_for_vmware_spec.error('%s for user %s.' % (connect, name_in_config)) return '%s for user %s.' % (connect, name_in_config) confirm_result = view_ftp.confirm_username(username) if confirm_result is False: case.logon_fail() # report.fail_report('not confirm username', test_name) log_for_vmware_spec.error('not confirm username %s' % name_in_config) return 'not confirm username %s' % name_in_config view_ftp.upload_test(operation) result = view_ftp.confirm_result() if result is False: case.logon_fail() log_for_vmware_spec.error("Not find test result for user %s." % name_in_config) return "Not find test result for user %s." % name_in_config elif result.lower() == 'pass': if case.check_logoff() is True: # report.pass_report(test_name) # Only report failed users return True