|
| 1 | +*** Settings *** |
| 2 | +Library Collections |
| 3 | +Library DateTime |
| 4 | +Library Dialogs |
| 5 | +Library OperatingSystem |
| 6 | +Library Process |
| 7 | +Library String |
| 8 | +Library Telnet timeout=20 seconds connection_timeout=120 seconds |
| 9 | +Resource ../variables.robot |
| 10 | +Resource ../keywords.robot |
| 11 | +Resource ../keys.robot |
| 12 | + |
| 13 | +# Log Out And Close Connection - elementary teardown keyword for all tests. |
| 14 | +Suite Setup Run Keywords |
| 15 | +... Prepare Test Suite |
| 16 | +Suite Teardown Run Keywords |
| 17 | +... Log Out And Close Connection |
| 18 | +Test Setup Run Keyword |
| 19 | +... Restore Initial DUT Connection Method |
| 20 | + |
| 21 | +Default Tags semiauto |
| 22 | + |
| 23 | + |
| 24 | +*** Test Cases *** |
| 25 | +OWR001.207 Install operating system on disk (OpenWrt) |
| 26 | + [Documentation] This test installs OpenWrt on NVMe drive using dd program. |
| 27 | + ... DTS is boot via iPXE and OpenWrt image is downloaded using wget. |
| 28 | + ... OPENWRT_IMAGE_FILE - core of file name |
| 29 | + ... OPENWRT_TARGET_DEVICE - target drive to be wiped out using dd (!) |
| 30 | + [Tags] semiauto |
| 31 | + Skip If not ${TESTS_IN_OPENWRT_SUPPORT} OWR001.207 not supported |
| 32 | + Variable Should Exist ${OPENWRT_TARGET_DEVICE} |
| 33 | + Variable Should Exist ${OPENWRT_IMAGE_FILE} |
| 34 | + ${selection}= Get Selection From User |
| 35 | + ... Caution! You are about to install OpenWrt on ${OPENWRT_TARGET_DEVICE} device. Are you sure? |
| 36 | + ... Yes, I'd like to wipe all the data existing on ${OPENWRT_TARGET_DEVICE} device. |
| 37 | + ... No, let's skip OpenWrt installation. |
| 38 | + ${contains_yes}= Run Keyword And Return Status Should Contain ${selection} Yes, I'd like to |
| 39 | + Skip If not(${contains_yes}) OpenWrt installation on ${OPENWRT_TARGET_DEVICE} device skipped. |
| 40 | + Power On |
| 41 | + Make Sure That Network Boot Is Enabled |
| 42 | + Boot Dasharo Tools Suite iPXE |
| 43 | + # Starting SSH server |
| 44 | + Write Bare Into Terminal K |
| 45 | + Read From Terminal Until Press Enter to continue. |
| 46 | + Press Enter |
| 47 | + Enter Shell In DTS |
| 48 | + VAR ${openwrt_image_gz}= ${OPENWRT_IMAGE_FILE} .gz separator=${EMPTY} |
| 49 | + Remove File ${openwrt_image_gz} |
| 50 | + Remove File ${OPENWRT_IMAGE_FILE} |
| 51 | + VAR ${DEVICE_OS_USERNAME}= root scope=TEST |
| 52 | + VAR ${DEVICE_OS_PASSWORD}= ${EMPTY} scope=TEST |
| 53 | + Send File To DUT osfv-test-data/openwrt/${openwrt_image_gz} /${openwrt_image_gz} |
| 54 | + Execute Linux Command gzip -cdk ${openwrt_image_gz} | dd of=/dev/${OPENWRT_TARGET_DEVICE} bs=1M |
| 55 | + Execute Linux Command sync |
| 56 | + Execute Reboot Command |
| 57 | + Boot OpenWrt |
| 58 | + # Disabling DHCP server of OpenWrt |
| 59 | + Execute Command In Terminal /etc/init.d/odhcpd disable |
| 60 | + Execute Command In Terminal /etc/init.d/odhcpd stop |
| 61 | + # Enabling DHCP client for all LAN interfaces |
| 62 | + Execute Command In Terminal uci set network.lan.proto="dhcp" |
| 63 | + Execute Command In Terminal uci commit network |
| 64 | + Execute Command In Terminal service network restart |
| 65 | + |
| 66 | +OWR002.207 Boot operating system from disk (OpenWrt) |
| 67 | + [Documentation] Boot installed OpenWrt from NVMe drive, check identity. |
| 68 | + Skip If not ${TESTS_IN_OPENWRT_SUPPORT} OWR002.207 not supported |
| 69 | + Power On |
| 70 | + Boot OpenWrt |
| 71 | + ${out}= Execute Command In Terminal uname -a |
| 72 | + Should Contain ${out} OpenWrt |
| 73 | + |
| 74 | +OWR003.207 Boot operating system from disk after cold-boot (OpenWrt) |
| 75 | + [Documentation] Boot OpenWrt from hard disk after cold-boot. |
| 76 | + Skip If not ${TESTS_IN_OPENWRT_SUPPORT} OWR003.207 not supported |
| 77 | + Power On |
| 78 | + Boot OpenWrt |
| 79 | + Execute Cold Boot |
| 80 | + ${start_date}= Get Current Date |
| 81 | + Boot OpenWrt |
| 82 | + ${end_date}= Get Current Date |
| 83 | + ${delta_time}= Subtract Date From Date ${end_date} ${start_date} |
| 84 | + Log To Console Cold boot duration in seconds: ${delta_time} |
| 85 | + |
| 86 | +OWR004.207 Boot operating system from disk after warm-boot (OpenWrt) |
| 87 | + [Documentation] Boot OpenWrt from hard disk after warm-boot. |
| 88 | + Skip If not ${TESTS_IN_OPENWRT_SUPPORT} OWR004.207 not supported |
| 89 | + Power On |
| 90 | + Boot OpenWrt |
| 91 | + Download File OpenWrt https://cloud.3mdeb.com/public.php/dav/files/Aqe5Xj24pkoYLwX /bin/rtcwake |
| 92 | + Execute Command In Terminal chmod +x /bin/rtcwake |
| 93 | + Perform Warmboot Using Rtcwake |
| 94 | + ${start_date}= Get Current Date |
| 95 | + Boot OpenWrt |
| 96 | + ${end_date}= Get Current Date |
| 97 | + ${delta_time}= Subtract Date From Date ${end_date} ${start_date} |
| 98 | + Log To Console Warm boot duration in seconds: ${delta_time} |
| 99 | + |
| 100 | +OWR005.207 Boot operating system from disk after reboot (OpenWrt) |
| 101 | + [Documentation] Boot OpenWrt from hard disk after reboot. |
| 102 | + Skip If not ${TESTS_IN_OPENWRT_SUPPORT} OWR005.207 not supported |
| 103 | + Power On |
| 104 | + Boot OpenWrt |
| 105 | + Execute Command In Terminal reboot |
| 106 | + ${start_date}= Get Current Date |
| 107 | + Boot OpenWrt |
| 108 | + ${end_date}= Get Current Date |
| 109 | + ${delta_time}= Subtract Date From Date ${end_date} ${start_date} |
| 110 | + Log To Console Reboot duration in seconds: ${delta_time} |
| 111 | + |
| 112 | +OWR006.207 Scan WiFi networks (OpenWrt) |
| 113 | + [Documentation] Enable WiFi and scan for 3mdeb lab network. |
| 114 | + Skip If not ${TESTS_IN_OPENWRT_SUPPORT} OWR006.207 not supported |
| 115 | + Power On |
| 116 | + Boot OpenWrt |
| 117 | + Enable WiFi OpenWrt |
| 118 | + Scan WiFi For Network OpenWrt ${3_MDEB_WIFI_NETWORK} |
| 119 | + |
| 120 | +OWR007.207 Ethernet controller detection (OpenWrt) |
| 121 | + [Documentation] Check presence of ethernet controller using lspci. |
| 122 | + ... Install pciutils if missing. Controller name defined in OPENWRT_ETHERNET_CONTROLLER. |
| 123 | + Skip If not ${TESTS_IN_OPENWRT_SUPPORT} OWR007.207 not supported |
| 124 | + Variable Should Exist ${OPENWRT_ETHERNET_CONTROLLER} |
| 125 | + Power On |
| 126 | + Boot OpenWrt |
| 127 | + Detect Or Install Package OpenWrt pciutils |
| 128 | + ${lspci_out}= Execute Command In Terminal lspci |
| 129 | + Should Contain ${lspci_out} ${OPENWRT_ETHERNET_CONTROLLER} |
0 commit comments