Skip to content
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

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open

Rework usb-hid-and-msc-support #351

wants to merge 5 commits into from

Conversation

m-iwanicki
Copy link
Contributor

No description provided.

@m-iwanicki m-iwanicki self-assigned this Jul 3, 2024
@m-iwanicki m-iwanicki marked this pull request as ready for review July 4, 2024 14:51
@m-iwanicki m-iwanicki linked an issue Jul 4, 2024 that may be closed by this pull request
@@ -63,6 +63,7 @@ ${DEVICE_AUDIO1_WIN}= ${EMPTY}
${WIFI_CARD_UBUNTU}= ${EMPTY}
${USB_MODEL}= ${EMPTY}
${USB_DEVICE}= ${EMPTY}
@{ATTACHED_USB}= ${EMPTY}
Copy link
Contributor

Choose a reason for hiding this comment

The 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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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.
In this case this line from usb-detect.robot would always fail for all protectli except vp2410 and vp2420.

Do we even need this variable? in raptor-cs_talos2.robot config there is comment:
# Temporary parameter - we are not able to use the Hardware matrix
If this problem was fixed then we could just get rid of it as it was only used in usb-detect.robot

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we have:

  • USB_KEYBOARD_DETECTION_SUPPORT
  • DEVICE_USB_KEYBOARD
  • HAS_KEYBOARD

Isn't it too much for nearly the same meaning?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if those global variables have documentation anywhere.
From what I can understand *_SUPPORT variable means that it's possible to test this on this platform as a whole not that this particular platform has keyboard attached.
This test checks that ${DEVICE_USB_KEYBOARD} is in output of lsusb but if this variable is empty test succeeds everytime so doesn't really test anything.
HAS_KEYBOARD is combination of DEVICE_USB_KEYBOARD and PiKVM (I'm assuming if PiKVM is connected then it should always detect it as keyboard?)

This PR mostly fixes reported issues and one I encountered during tests so I didn't make bigger changes

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fair enough, thanks for explaining

${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
Copy link
Contributor

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.

Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

USB001.003 USB devices detected by OS (Windows 10) test FAIL
3 participants