def run():
    log = co.logger()
    testname = "Local_USB_printer_print_test_page"
    pyautogui.hotkey('ctrl', 'alt', 'end')
    co.check_resolution()
    co.check_network_status()
    if not cp.check_printer_by_system(testname):
        return
    if cp.check_printers() > 0:
        cp.clear_previous_printer()
    flag = ad.open_window('printer', "./Test_Data/1920x1200/template_file/printers_localhost.png")
    if flag:
        flag = ad.add_printer()
    else:
        return False
    if flag:
        log.logger.info("Printer added successful.")
        flag = cp.check_printer_added()
    else:
        return False
    if flag:
        ad.print_page()
        flag = ad.delete_printer()
    else:
        return False
    if flag:
        log.logger.info("Printer deleted successful.")
        ad.close_window("./Test_Data/1920x1200/template_file/printers_localhost.png")
        return True
    else:
        return False
def run():
    desktop_list = ['citrix_win10.png']
    module_name = 'XenDesktop_Storefront_win10_USB_key_mapping'
    comfun.check_resolution()
    if not comfun.check_network_status():
        fail_report('Network status is not available', module_name)
        return
    flag = script_general.check_localusb_exist()
    if flag:
        script_general.remove_usb_file()
        script_difference.set_citrix_usbkey_mapping()
    else:
        fail_report('can not find local usb key', module_name)
        return False
    flag = script_difference.login_storefront(desktop_list)
    if flag is not True:
        fail_report(flag, module_name)
        return False
    mapping = script_difference.xen_usbkey_mapping()
    sign_out = script_general.check_succeed_signout()
    if mapping is not True:
        fail_report(mapping, module_name)
        return False
    if sign_out is not True:
        fail_report(sign_out, module_name)
        return False
    flag = script_difference.confirm_usbkeymapping_file()
    if flag is not True:
        fail_report(flag, module_name)
        return False
    else:
        pass_report(module_name)
示例#3
0
def run():
    desktop_list = ['citrix_win10_pnagent.png']
    module_name = 'XenDesktop_PNagent_USB_key_USBR'
    comfun.check_resolution()
    if not comfun.check_network_status():
        fail_report('Network status is not available', module_name)
        return
    flag = script_general.check_localusb_exist()
    if flag:
        script_general.remove_usb_file()
        script_difference.set_citrix_usbkey_usbr()
    else:
        fail_report('can not find local usb key', module_name)
        return False
    flag = script_difference.login_pnagent(desktop_list)
    if flag is not True:
        fail_report(flag, module_name)
        return False
    usbr = script_difference.xen_usbkey_redirection()
    sign_out = script_general.check_succeed_signout()
    if usbr is not True:
        fail_report(usbr, module_name)
        return False
    if sign_out is not True:
        fail_report(sign_out, module_name)
        return False
    flag = script_difference.confirm_usbkeyredirection_file()
    if flag is not True:
        fail_report(flag, module_name)
        return False
    else:
        pass_report(module_name)
def run():
    test_name = 'XenDesktop_Storefront_win10_smartcard'
    desktop_list = ['xd_smartcard_win10.png']
    comfun.check_resolution()
    if not comfun.check_network_status():
        fail_report('Network status is not available', test_name)
        return
    if xd_storefront_smartcard.login_storefront_smartcard(desktop_list):
        result = NormalLogonTest()
        result.record_result(test_name)
        os.popen('pkill -f CitrixApps')
        return False
def run():
    desktop_list = ['citrix_win10.png']
    module_name = 'XenDesktop_Storefront_USB_printer_mapping'
    co.check_resolution()
    if not co.check_network_status():
        fail_report('Network status is not available', module_name)
        return
    if not cp.check_printer_by_system(module_name):
        return
    if cp.check_printers() > 0:
        log.info('clear printer')
        cp.clear_previous_printer()
    flag = ad.open_window(
        'printer',
        "./Test_Data/1920x1200/template_file/printers_localhost.png")
    if flag:
        flag = ad.add_printer()
    else:
        return False
    if flag:
        ad.cancel_print_page()
        # ad.close_window("./Test_Data/1920x1200/template_file/printers_localhost.png")
        log.logger.info("Printer added successful.")
        flag = cp.check_printer_added()
    else:
        return False
    if flag:
        script_difference.set_citrix_usbprinter_mapping()
        flag = script_difference.login_storefront(desktop_list)
    else:
        return
    if flag is not True:
        fail_report(flag, module_name)
        delete_printer()
        close_window(
            "./Test_Data/1920x1200/template_file/printers_localhost.png")
        return False
    mapping = script_difference.usbprinter_mapping()
    sign_out = script_general.check_succeed_signout()
    delete_printer()
    close_window("./Test_Data/1920x1200/template_file/printers_localhost.png")
    if mapping is not True:
        fail_report(mapping, module_name)
        return False
    if sign_out is not True:
        fail_report(sign_out, module_name)
        return False
    else:
        pass_report(module_name)
def run():
    module_name = 'XenDesktop_Storefront_connect_to_win10'
    desktop_list = ['citrix_win10.png']
    comfun.check_resolution()
    if not comfun.check_network_status():
        fail_report('Network status is not available', module_name)
        return
    flag = script_difference.login_storefront(desktop_list)
    if flag is not True:
        fail_report(flag, module_name)
        return False
    flag = script_difference.logoff()
    if flag is not True:
        fail_report(flag, module_name)
        return False
    else:
        pass_report(module_name)
示例#7
0
def run():
    test_case_name = "Connect_Cisco_VPN"
    # Read VPN configuration from yaml -- To be optimized
    vpn_cisco_gw = wired_common.get_config("./Test_Data/WiredNetwork/", "wired_configuration.yml", "vpn_cisco_gw")
    vpn_cisco_gn = wired_common.get_config("./Test_Data/WiredNetwork/", "wired_configuration.yml", "vpn_cisco_gn")
    vpn_cisco_gp = wired_common.get_config("./Test_Data/WiredNetwork/", "wired_configuration.yml", "vpn_cisco_gp")
    vpn_cisco_un = wired_common.get_config("./Test_Data/WiredNetwork/", "wired_configuration.yml", "vpn_cisco_un")
    vpn_cisco_up = wired_common.get_config("./Test_Data/WiredNetwork/", "wired_configuration.yml", "vpn_cisco_up")
    target_type = wired_common.get_config("./Test_Data/WiredNetwork/", "wired_configuration.yml", "target_type")
    vpn_auto_start = wired_common.get_config("./Test_Data/WiredNetwork/", "wired_configuration.yml", "vpn_auto_start")
    vpn_destination = wired_common.get_config("./Test_Data/WiredNetwork/", "wired_configuration.yml", "vpn_destination")
    # Check current network status.
    if common_function.check_network_status() is False:
        common_function.fail_report("Failed to check network status.", test_case_name)
        return
    # Set VPN as Cisco.
    if wired_vpn.set_vpn_as_cisco(target_type, vpn_cisco_gw, vpn_cisco_gn, vpn_cisco_gp, vpn_cisco_un, vpn_cisco_up) \
            is not True:
        common_function.fail_report("Failed to set vpn settings as cisco", test_case_name)
        return
    # Wait some while for vpn settings taking effect
    time.sleep(60)
    # Check vpn settings
    if wired_vpn.check_cisco_settings(target_type, vpn_auto_start, vpn_cisco_gw, vpn_cisco_gn, vpn_cisco_un) is False:
        common_function.fail_report("Fail to check cisco settings.", test_case_name)
        return
    # Ping
    if wired_common.destination_ping_check("VPN", vpn_destination) is False:
        common_function.fail_report("Fail to ping destination.", test_case_name)
        return
    # Disable Cisco VPN setings to restore the testing environment
    vpn_info_reg = wired_vpn.get_value_from_reg()
    if vpn_info_reg is not False:
        wired_vpn.disable_cisco_vpn(vpn_info_reg[3], vpn_info_reg[0])
    # else:
    #     return
    # Print pass report
    common_function.pass_report(test_case_name)
示例#8
0
def run():
    test_case_name = "Dynamic_IP_Mode"
    # Check current network status
    if common_function.check_network_status() is False:
        common_function.fail_report("Check current network status failed.",
                                    test_case_name)
        return
    # If vpn is set, disable it.
    if wired_common.disable_vpn() is False:
        common_function.fail_report("Disable vpn failed.", test_case_name)
        return
    # Check the network method, if it is Automatic, return the ip address. If it is Static, change the network to \
    # Auto then get the ip.
    if wired_dhcp_ip.check_method_for_auto('Wired') is False:
        common_function.fail_report("Check method for auto failed.",
                                    test_case_name)
        return
    # Check the format of ip, all the four address should be in [0, 255].
    if wired_dhcp_ip.check_ip() is False:
        common_function.fail_report("Check ip failed.", test_case_name)
        return
    # Check current network status in case of changing network to Automatic from Static.
    if common_function.check_network_status() is False:
        common_function.fail_report(
            "Check network status is failed after checking method.",
            test_case_name)
        return
    # Check the network setting result.
    if wired_common.setting_check_for("Automatic") is False:
        common_function.fail_report("Setting check for Automatic failed.",
                                    test_case_name)
        return
    # Ping the destination.
    if wired_common.destination_ping_check("Normal", "15.83.240.98") is False:
        common_function.fail_report(
            "Destination ping failed after network setting for preparation.",
            test_case_name)
        return
    # Enable left click menu for wired icon from registry.
    wired_common.enable_left_click_nt()
    # Stop network from the wired tray icon at desktop
    if wired_common.stop_network() is False:
        common_function.fail_report("Stop network failed.", test_case_name)
        return
    # Start network from the wired tray icon at desktop.
    if wired_common.start_network() is False:
        common_function.fail_report("Start network failed.", test_case_name)
    # Check the format of ip after regaining the dynamic IP, all the four address should be in [0, 255].
    if wired_dhcp_ip.check_ip() is False:
        common_function.fail_report("Check ip failed after starting network.",
                                    test_case_name)
        return
    # Ping the destination after stopping then starting network.
    if wired_common.destination_ping_check("Normal", "15.83.240.98") is False:
        common_function.fail_report(
            "Destination ping failed after stopping then starting network.",
            test_case_name)
        return
    # Restart network from the wired tray icon at desktop
    if wired_common.restart_network() is False:
        common_function.fail_report("Restarting network fails.",
                                    test_case_name)
        return
    # Check the network setting result after restarting network.
    wired_common.setting_check_for("Automatic")
    # Check the format of ip after restarting network then get the ip, all the four address should be in [0, 255].
    if wired_dhcp_ip.check_ip() is False:
        common_function.fail_report(
            "Check ip failed after restarting network.", test_case_name)
        return
    # Ping the destination after restarting network.
    if wired_common.destination_ping_check("Normal", "15.83.240.98") is False:
        common_function.fail_report(
            "Destination ping failed after restarting network.",
            test_case_name)
        return
    # Restore the registry settings for network left click menu
    wired_common.disable_left_click_nt()
    # Print pass report
    common_function.pass_report(test_case_name)
示例#9
0
def run():
    test_case_name = "Static_IP_Mode_works"
    # Check current network status
    if common_function.check_network_status() is False:
        common_function.fail_report("Check current network status failed.", test_case_name)
        return
    # If vpn is set, disable it.
    if wired_common.disable_vpn() is False:
        common_function.fail_report("Disable vpn failed.", test_case_name)
        return
    # Check the network method, if it is Automatic, change the network to static and return the ip.
    ip = wired_static_ip.check_method_for_static("Wired")
    if ip is False:
        common_function.fail_report("Check method for static failed.", test_case_name)
        return
    time.sleep(5)
    # Check the network setting result. If checking for Static, it compares the runtime ip, registry ip and \
    # transferring ip.
    if wired_common.setting_check_for("Static", ip[0], ip[1], ip[2]) is False:
        common_function.fail_report("Setting check for static is failed.", test_case_name)
        return
    # Check current network status
    if common_function.check_network_status() is False:
        common_function.fail_report("Check network status failed after network setting.", test_case_name)
        return
    # Ping the default gateway.
    if wired_common.destination_ping_check("Normal", ip[2]) is False:
        common_function.fail_report("Ping default gateway failed.", test_case_name)
        return
    # Enable left click menu for wired icon from registry.
    wired_common.enable_left_click_nt()
    # Stop network from the wired tray icon at desktop
    if wired_common.stop_network() is False:
        common_function.fail_report("Stop Network failed.", test_case_name)
        return
    # Start network from the wired tray icon at desktop.
    if wired_common.start_network() is False:
        common_function.fail_report("Start network failed.", test_case_name)
        return
    time.sleep(5)
    # Check the network setting result after stopping then starting network.
    if wired_common.setting_check_for("Static", ip[0], ip[1], ip[2]) is False:
        common_function.fail_report("Setting check for static is failed after stopping then starting network.",
                                    test_case_name)
        return
    # Ping the default gateway after stopping and restarting network.
    if wired_common.destination_ping_check("Normal", ip[2]) is False:
        common_function.fail_report("Ping default gateway failed after stopping then starting network.", test_case_name)
        return
    # Restart network.
    if wired_common.restart_network() is False:
        common_function.fail_report("Restart network failed.", test_case_name)
    time.sleep(5)
    # Check the network setting result after restarting network.
    if wired_common.setting_check_for("Static", ip[0], ip[1], ip[2]) is False:
        common_function.fail_report("Setting check for static is failed after restarting network.",
                                    test_case_name)
        return
    # Ping the default gateway after restarting network.
    if wired_common.destination_ping_check("Normal", ip[2]) is False:
        common_function.fail_report("Ping default gateway failed after restarting network.", test_case_name)
        return
    # Restore to Auto network.
    wired_common.set_method_as("Automatic")
    # Restore the registry settings for network left click menu
    wired_common.disable_left_click_nt()
    # Print pass result
    common_function.pass_report(test_case_name)