-
-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rework usb-hid-and-msc-support #351
base: develop
Are you sure you want to change the base?
Changes from all commits
13294b4
2ca1ee1
f735b93
319a3e5
2e687af
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,7 @@ Resource ../keys.robot | |
# Required teardown keywords: | ||
# Log Out And Close Connection - elementary teardown keyword for all tests. | ||
Suite Setup Run Keyword | ||
... Prepare Test Suite | ||
... Prepare USB HID Test Suite | ||
Suite Teardown Run Keyword | ||
... Log Out And Close Connection | ||
|
||
|
@@ -28,7 +28,7 @@ USB001.001 USB devices detected in FW | |
[Documentation] Check whether USB devices are detected in Tianocore | ||
... (edk2). | ||
Skip If not ${USB_DISKS_DETECTION_SUPPORT} USB001.001 not supported | ||
Upload And Mount DTS Flash Iso | ||
Skip If not ${HAS_USB_STORAGE} USB001.001 not supported | ||
Power On | ||
${boot_menu}= Enter Boot Menu Tianocore And Return Construction | ||
Check That USB Devices Are Detected ${boot_menu} | ||
|
@@ -44,8 +44,8 @@ USB001.002 USB devices detected by OS (Ubuntu) | |
Switch To Root User | ||
Detect Or Install Package usbutils | ||
${out}= Execute Command In Terminal lsusb -v | grep bInterfaceClass | ||
Should Contain ${out} Human Interface Device | ||
Should Contain ${out} Mass Storage | ||
IF ${HAS_KEYBOARD} Should Contain ${out} Human Interface Device | ||
IF ${HAS_USB_STORAGE} Should Contain ${out} Mass Storage | ||
Exit From Root User | ||
|
||
USB001.003 USB devices detected by OS (Windows) | ||
|
@@ -55,28 +55,28 @@ USB001.003 USB devices detected by OS (Windows) | |
Skip If not ${TESTS_IN_WINDOWS_SUPPORT} USB001.003 not supported | ||
Power On | ||
Login To Windows | ||
${out}= Execute Command In Terminal Get-PnpDevice -PresentOnly | Where-Object { $_.InstanceId -match '^USB' } | ||
Should Contain ${out} HIDClass | ||
Should Contain ${out} DiskDrive | ||
${out}= Execute Command In Terminal | ||
... Get-PnpDevice -PresentOnly | Where-Object { $_.InstanceId -match '^USB' } | ||
IF ${HAS_KEYBOARD} Should Contain ${out} HIDClass | ||
IF ${HAS_USB_STORAGE} Should Contain ${out} DiskDrive | ||
|
||
USB002.001 USB keyboard detected in FW | ||
[Documentation] Check whether the external USB keyboard is detected | ||
... correctly by the firmware and all basic keys work | ||
... according to their labels. | ||
[Tags] minimal-regression | ||
Skip If not ${HAS_KEYBOARD} USB002.001 not supported | ||
Power On | ||
Enter UEFI Shell | ||
${out}= Execute UEFI Shell Command devices | ||
Should Contain ${out} Usb Keyboard | ||
|
||
USB002.002 USB keyboard in OS (Ubuntu) | ||
[Documentation] Check whether the external USB keyboard is detected | ||
... correctly by the Linux OS and all basic keys work | ||
... according to their labels. | ||
IF not ${USB_KEYBOARD_DETECTION_SUPPORT} | ||
SKIP USB002.002 not supported | ||
END | ||
IF not ${TESTS_IN_UBUNTU_SUPPORT} SKIP USB002.002 not supported | ||
... correctly by the Linux OS. | ||
Skip If not ${USB_KEYBOARD_DETECTION_SUPPORT} USB002.002 not supported | ||
Skip If "${DEVICE_USB_KEYBOARD}" == "${EMPTY}" USB002.002 not supported | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So we have:
Isn't it too much for nearly the same meaning? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure if those global variables have documentation anywhere. This PR mostly fixes reported issues and one I encountered during tests so I didn't make bigger changes There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fair enough, thanks for explaining |
||
Skip If not ${TESTS_IN_UBUNTU_SUPPORT} USB002.002 not supported | ||
Power On | ||
Boot System Or From Connected Disk ubuntu | ||
Login To Linux | ||
|
@@ -87,10 +87,9 @@ USB002.002 USB keyboard in OS (Ubuntu) | |
USB002.003 USB keyboard in OS (Windows) | ||
[Documentation] Check whether the external USB keyboard is detected | ||
... correctly by the Windows OS. | ||
IF not ${USB_KEYBOARD_DETECTION_SUPPORT} | ||
SKIP USB002.003 not supported | ||
END | ||
IF not ${TESTS_IN_WINDOWS_SUPPORT} SKIP USB002.003 not supported | ||
Skip If not ${USB_KEYBOARD_DETECTION_SUPPORT} USB002.003 not supported | ||
Skip If not ${HAS_KEYBOARD} USB002.003 not supported | ||
Skip If not ${TESTS_IN_WINDOWS_SUPPORT} USB002.003 not supported | ||
Power On | ||
Login To Windows | ||
${out}= Execute Command In Terminal Get-CimInstance win32_KEYBOARD | ||
|
@@ -100,8 +99,9 @@ USB002.003 USB keyboard in OS (Windows) | |
USB003.001 Upload 1GB file on USB storage (Ubuntu) | ||
[Documentation] Check whether the 1GB file can be transferred from the | ||
... operating system to the USB storage. | ||
IF not ${UPLOAD_ON_USB_SUPPORT} SKIP USB003.001 not supported | ||
IF not ${TESTS_IN_UBUNTU_SUPPORT} SKIP USB003.001 not supported | ||
Skip If not ${UPLOAD_ON_USB_SUPPORT} USB003.001 not supported | ||
Skip If not ${HAS_USB_STORAGE} USB003.001 not supported | ||
Skip If not ${TESTS_IN_UBUNTU_SUPPORT} USB003.001 not supported | ||
Power On | ||
Boot System Or From Connected Disk ubuntu | ||
Login To Linux | ||
|
@@ -116,16 +116,43 @@ USB003.001 Upload 1GB file on USB storage (Ubuntu) | |
USB003.002 Upload 1GB file on USB storage (Windows) | ||
[Documentation] Check whether the 1GB file can be transferred from the | ||
... operating system to the USB storage. | ||
IF not ${UPLOAD_ON_USB_SUPPORT} SKIP USB003.002 not supported | ||
IF not ${TESTS_IN_WINDOWS_SUPPORT} SKIP USB003.002 not supported | ||
Skip If not ${UPLOAD_ON_USB_SUPPORT} USB003.002 not supported | ||
Skip If not ${HAS_USB_STORAGE} USB003.002 not supported | ||
Skip If not ${TESTS_IN_WINDOWS_SUPPORT} USB003.002 not supported | ||
Power On | ||
Login To Windows | ||
Generate 1GB File In Windows | ||
# Work only with one attached USB storage | ||
${drive_letter}= Get Drive Letter Of USB | ||
Execute Command In Terminal Copy-Item -Path C:\\Users\\user\\test_file.txt ${drive_letter}: | ||
Execute Command In Terminal | ||
... Copy-Item -Path C:\\Users\\user\\test_file.txt ${drive_letter}: 120 | ||
${hash1}= Get Hash Of File test_file.txt | ||
${hash2}= Get Hash Of File ${drive_letter}:\\test_file.txt | ||
Execute Command In Terminal Remove-Item -Path C:\\Users\\user\\test_file.txt | ||
Execute Command In Terminal Remove-Item -Path ${drive_letter}:\\test_file.txt | ||
Execute Command In Terminal | ||
... Remove-Item -Path ${drive_letter}:\\test_file.txt 120 | ||
Should Be Equal ${hash1} ${hash2} | ||
|
||
|
||
*** Keywords *** | ||
Prepare USB HID Test Suite | ||
[Documentation] Prepare this test suite | ||
Prepare Test Suite | ||
IF "${DEVICE_USB_KEYBOARD}" != "${EMPTY}" or "${DUT_CONNECTION_METHOD}" == "pikvm" | ||
Set Suite Variable $HAS_KEYBOARD ${TRUE} | ||
ELSE | ||
Set Suite Variable $HAS_KEYBOARD ${FALSE} | ||
END | ||
${conf}= Get Current CONFIG ${CONFIG_LIST} | ||
${has_storage}= Evaluate "USB_Storage" in """${conf}""" | ||
IF "${DUT_CONNECTION_METHOD}" == "pikvm" | ||
Upload And Mount DTS Flash Iso | ||
${has_storage}= Set Variable ${TRUE} | ||
END | ||
IF "${ATTACHED_USB}" != "${EMPTY}" or ${has_storage} | ||
Set Suite Variable $HAS_USB_STORAGE ${TRUE} | ||
ELSE | ||
Set Suite Variable $HAS_USB_STORAGE ${FALSE} | ||
END | ||
Skip If not ${HAS_KEYBOARD} and not ${HAS_USB_STORAGE} | ||
... Platform doesn't have USB keyboard or USB storage attached |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,6 +66,7 @@ ${DEVICE_AUDIO1_WIN}= ${EMPTY} | |
${WIFI_CARD_UBUNTU}= ${EMPTY} | ||
${USB_MODEL}= ${EMPTY} | ||
${USB_DEVICE}= ${EMPTY} | ||
@{ATTACHED_USB}= ${EMPTY} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We need to include boot device names in the config for each board? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would say yes, all global variables should probably be in some default state instead of fixing errors that no keyword exists. Do we even need this variable? in |
||
|
||
${FLASHROM_FLAGS}= ${EMPTY} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This still doesn't give reliable results for non-PiKVM platforms.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was/is addressed by @PLangowski in #206 and #310