Skip to content

Commit

Permalink
tests/kernel-modules-components: test early modules
Browse files Browse the repository at this point in the history
Test that modules from kernel-modules components are available early
after rebooting.
  • Loading branch information
alfonsosanchezbeato authored and Meulengracht committed Nov 25, 2024
1 parent c73c17e commit 93f47bc
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/nested/manual/kernel-modules-components/task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,26 @@ execute: |
remote.exec sudo snap remove pc-kernel+wifi-comp
not remote.exec grep mac80211_hwsim /lib/modules/*/modules.dep
not remote.exec sudo modprobe mac80211_hwsim
# Rule to force module loading on system start (we randomly choose
# the rtc device add event for this)
rule='ACTION==\"add\", SUBSYSTEM==\"rtc\", KERNEL==\"rtc*\", RUN{builtin}+=\"kmod load mac80211_hwsim\"\n'
remote.exec "sudo sh -c 'printf \"$rule\" > /etc/udev/rules.d/70-load-wifi.rules'"
# Install jointly kernel with component
remote.push pc-kernel_*.snap
boot_id=$(tests.nested boot-id)
remote_chg_id=$(remote.exec sudo snap install --no-wait --dangerous pc-kernel_*.snap "$comp_file")
tests.nested wait-for reboot "$boot_id"
remote.exec "snap change $remote_chg_id" | NOMATCH Error
# Check that the module has been loaded by the udev rule
remote.exec ip link show wlan0
# Install again, but force a failure to check revert
boot_id=$(tests.nested boot-id)
remote_chg_id=$(remote.exec sudo snap install --no-wait --dangerous pc-kernel_*.snap "$comp_file")
remote.retry --wait 1 -n 100 'sudo rm /run/mnt/ubuntu-boot/EFI/ubuntu/try-kernel.efi'
tests.nested wait-for reboot "$boot_id"
remote.retry --wait 5 -n 60 "snap change $remote_chg_id | MATCH Error"
# Module is still loaded
remote.exec ip link show wlan0

0 comments on commit 93f47bc

Please sign in to comment.