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 run(): username = get_config.get_config(cert_name) cert = certificate.Cert('ROOTCA') find_cert = cert.check_cert() if find_cert is False: insert = cert.import_cert() if insert is False: report.fail_report('import cert fail', connect_with_cert) return False print('cert already exist') if create_connection() is False: return False warning = logon(username) if warning is not True: test_report('select security to be warning:' + warning + '-------') edit_connection('allow') allow = logon(username) if allow is not True: test_report('select security to be allow:' + allow + '-------') edit_connection('refuse') refuse = logon(username) if refuse is not True: test_report('select security to be refuse:' + refuse + '-------') if cert.delete_cert() is False: test_report('del cert fail,end refuse test without cert test') a = '' with open('./Test_Report/%s.txt' % connect_with_cert, 'r') as file: for line in file.readlines(): a += line report.fail_report(a, connect_with_cert) os.remove('./Test_Report/%s.txt' % connect_with_cert) return if refuse_connect() is False: test_report('not find refuse window after delete cert') a = '' try: with open('./Test_Report/%s.txt' % connect_with_cert, 'r') as file: for line in file.readlines(): a += line report.fail_report(a, connect_with_cert) os.remove('./Test_Report/%s.txt' % connect_with_cert) except: report.pass_report(connect_with_cert)
def run(cert='ROOTCA'): test_name = 'Verify_can_add_certificate' cer = certificate.Cert(cert) find_cert = cer.check_cert() if find_cert is True: delete = cer.delete_cert() if delete is False: report.fail_report('Fail:remove cert fail before execute test', test_name) return False insert = cer.import_cert() if insert is False: report.fail_report('Fail:import cert fail', test_name) return False delete = cer.delete_cert() if delete is False: report.fail_report('Fail:remove cert fail', test_name) return False report.pass_report(test_name) return True
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
def import_cer(): cert = certificate.Cert('ROOTCA') if not cert.check_cert(): cert.import_cert()