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

Add some basic usb tests for ethernet and mass storage #18460

Merged
merged 7 commits into from
Apr 29, 2024

Conversation

frankenmichl
Copy link
Member

@frankenmichl frankenmichl commented Jan 16, 2024

We have some USB devices physically plugged into a baremetal machine. This adds some basic smoke tests for both mass storage and Ethernet connected via USB.

@frankenmichl frankenmichl added the WIP Work in progress label Jan 16, 2024
@frankenmichl frankenmichl force-pushed the add_usb_tests branch 12 times, most recently from 63445ac to 53bf2fe Compare January 31, 2024 09:02
tests/kernel/usb_drive.pm Outdated Show resolved Hide resolved
tests/kernel/usb_drive.pm Outdated Show resolved Hide resolved
@frankenmichl frankenmichl force-pushed the add_usb_tests branch 9 times, most recently from 12d3a69 to 0d30a57 Compare February 2, 2024 14:13
@frankenmichl frankenmichl force-pushed the add_usb_tests branch 3 times, most recently from 1202972 to f407a92 Compare February 12, 2024 10:15
@czerw
Copy link
Contributor

czerw commented Feb 14, 2024

Latest verification run was looping for couple of hours. I had to cancel the job, it was blocking maintenance jobs. https://openqa.suse.de/tests/13503758#step/usb_nic/1

@frankenmichl frankenmichl force-pushed the add_usb_tests branch 2 times, most recently from 3e4c252 to 2d0429a Compare February 20, 2024 10:43
@frankenmichl frankenmichl force-pushed the add_usb_tests branch 3 times, most recently from 0393494 to c0db7f1 Compare April 19, 2024 06:01
@frankenmichl
Copy link
Member Author

New Verification run: https://openqa.suse.de/tests/14068259
Everything seems to be fine now

@czerw
Copy link
Contributor

czerw commented Apr 19, 2024

New Verification run: https://openqa.suse.de/tests/14068259 Everything seems to be fine now

Its using ipv6 for some reason, but I don't see it as an issue.

@mdoucha
Copy link
Contributor

mdoucha commented Apr 19, 2024

Its using ipv6 for some reason, but I don't see it as an issue.

That's a local link address though, the USB NIC might not have been configured through DHCP at all. Could you also add ip addr show dev $interface and check that the output contains a line with scope global? If not, DHCP configuration failed.

@frankenmichl frankenmichl force-pushed the add_usb_tests branch 3 times, most recently from fed1358 to 6f78209 Compare April 19, 2024 13:48
We assume the system has a network interface connected via USB, and will
bring it up, configure it and do a simple ping test to a host.

USB_ETH_PING_PEER the host to ping, defaults to openqa.oqa.prg2.suse.org
@frankenmichl frankenmichl force-pushed the add_usb_tests branch 3 times, most recently from 1883def to ef078d6 Compare April 23, 2024 12:09
@frankenmichl
Copy link
Member Author

https://openqa.suse.de/tests/14123184 adds some information on IP address and error checking

Copy link
Contributor

@mdoucha mdoucha left a comment

Choose a reason for hiding this comment

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

I'd like to see another verification run on a worker machine without the expected USB devices to simulate broken usbcore. Otherwise LGTM.


# sync, unmount and flush slab and page cache
assert_script_run 'sync';
assert_script_run "umount $mountpoint";
Copy link
Contributor

Choose a reason for hiding this comment

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

It might be better to drop the sync because it should be done automatically by umount.

my $usb_net_devs = script_output('readlink /sys/class/net/* | grep usb', proceed_on_failure => 1);
die "no USB network interfaces found" unless $usb_net_devs ne "";

my $interface = script_output "basename $usb_net_devs";
Copy link
Contributor

Choose a reason for hiding this comment

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

my $interface = $usb_net_devs =~ s#^.*/##r;

Also adding head -n1 to the script_output() pipeline would be a good idea in case there are multiple USB devices.

Michael Moese and others added 6 commits April 25, 2024 10:50
Assuming a single usb mass storage device is connected to the machine,
randomly create a small file, write it to the device, remount it and
compare MD5 sums.
Module breaks shutdown on the the bare metal system with gnome
installed. This module is useful for qemu backends only, which is not
our case.
Sometimes, it takes a lot of time to setup network interface. Timeout
for interface setup was increased. There was also added debug option
to display more details. There is no need for loop before ping,
network is already setup when is ifup done. Ping peer was changed to
gateway to fully validate network functionality.
- Check for USB network interfaces before doing anything else
- try pinging each neighbour of interface instead of the default gateway

Co-authored-by: Martin Doucha <[email protected]>
@frankenmichl
Copy link
Member Author

frankenmichl commented Apr 25, 2024

New VRs: https://openqa.suse.de/tests/14145292 and without connected USB devices: https://openqa.suse.de/tests/14145722

@mdoucha
Copy link
Contributor

mdoucha commented Apr 25, 2024

New VRs: https://openqa.suse.de/tests/14145292 and without connected USB devices: https://openqa.suse.de/tests/14145722

One of the VRs seems to be misconfigured:
https://openqa.suse.de/tests/14145722#step/prepare_profile/1

@frankenmichl
Copy link
Member Author

That's why I did not ping you yet

@frankenmichl
Copy link
Member Author

https://openqa.suse.de/tests/14155003 is the VR with no devices connected

@mdoucha
Copy link
Contributor

mdoucha commented Apr 26, 2024

Great. I'll give everyone else time to look at this again until Monday afternoon and then merge it.

@mdoucha mdoucha merged commit 8902bac into os-autoinst:master Apr 29, 2024
10 checks passed
@frankenmichl frankenmichl deleted the add_usb_tests branch July 17, 2024 11:10
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.

5 participants