-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DLPX-87572 sdb: want live kernel tests to find kernel regressions early
= Problem With our switch to the new v5.15 kernel a subset of SDB commands broke without us realizing until we actually needed them. Our regression dumps helps us to ensure we don't introduce regressions for older kernels when developing new features but they can't help us in detecting changes in the upstream kernel or ZFS that break our commands. = This Patch This patch attempts to provide a rudimentary mechanism for catching regression introduced by the upstream Ubuntu kernels by running a few basic SDB commands in a Github action that's run nightly and for every PR. Specifically this patch makes it so we have such a test for each Ubuntu LTS kernel starting from 20.04 (currently the `ubuntu-latest` Github runner tag points to 22.04 so we'd test that twice but in the future that tag will point to 24.04, etc...). We also change for all the available Python versions for each Ubuntu version to further ensure SDB's compatibility with future Python versions. = Misc Notes In order to use SDB in the Github runner I had to introduce an extra script that downloads the kernel's debug info. See the `install-live-kernel-dbg.sh` script for more info. I also made sure to decouple the apt-install of the python-dev files to its own shell script too as different Ubuntu versions ship with different Python versions. See `install-python-dev.sh` for more info. = Potential Future Items In the future we may want to detect whenever our ZFS commands are not getting out of date. `test_live_kernel.sh` has a way of detecting whether the ZFS module is installed and running a few ZFS commands on the live kernel. The idea is that we can either introduce Github Actions like the upstream openzfs that install our kernel module to the runner and run the commands there OR we can create a BlackBox test that clones the repo and runs this script.
- Loading branch information
Showing
5 changed files
with
192 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash -eux | ||
|
||
# uname -a | ||
# uname -r | ||
# cat /etc/apt/sources.list | ||
# | ||
# sudo apt-get clean | ||
# sudo apt-get update | ||
# echo "deb http://ddebs.ubuntu.com $(lsb_release -cs) main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list.d/ddebs.list | ||
# echo "deb http://ddebs.ubuntu.com $(lsb_release -cs)-updates main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list.d/ddebs.list | ||
# echo "deb http://ddebs.ubuntu.com $(lsb_release -cs)-proposed main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list.d/ddebs.list | ||
# | ||
# sudo apt install ubuntu-dbgsym-keyring | ||
# | ||
# sudo apt-get clean | ||
# sudo apt-get update | ||
# | ||
# sudo apt-get install -y linux-image-$(uname -r)-dbgsym | ||
|
||
kvers=$(uname -r) | ||
ddeb_file=$(curl http://ddebs.ubuntu.com/pool/main/l/linux-azure/ | \ | ||
grep -Eo ">linux-image-(unsigned-)?$kvers(.*)amd64\.ddeb" | \ | ||
cut -c2-) | ||
|
||
wget http://ddebs.ubuntu.com/pool/main/l/linux-azure/$ddeb_file | ||
sudo dpkg -i $ddeb_file | ||
rm $ddeb_file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash -eux | ||
|
||
sudo apt update | ||
sudo apt install python3.$(python3 --version | cut -d . -f 2)-dev | ||
|
||
# | ||
# Debug statements | ||
# | ||
echo $(which python3) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
#!/bin/bash -eu | ||
|
||
scmds=( | ||
# Test `stacks` | ||
"stacks" | ||
|
||
# Test `stacka` | ||
"stacka" | ||
|
||
# Test `dmesg` | ||
"dmesg" | ||
|
||
# Test `lxlist` | ||
"addr modules | lxlist module list | member name" | ||
|
||
# Test `slabs` and `percpu` | ||
"slabs | filter \"obj.name == 'kmalloc-8'\" | member cpu_slab | percpu 0 1" | ||
|
||
# Test `pid` | ||
"pid 1" | ||
|
||
# Test `find_task` | ||
"find_task 1 2" | ||
|
||
# Test `threads` | ||
"threads" | ||
|
||
# Test `walk` and `slub_cache` walker | ||
"slabs | filter \"obj.name == 'TCP'\" | walk" | ||
|
||
# Test `rbtree` walker | ||
"addr vmap_area_root | rbtree vmap_area rb_node" | ||
|
||
# Test `fget` | ||
"find_task 1 | fget 1 4" | ||
) | ||
|
||
for ((i = 0; i < ${#scmds[@]}; i++)); do | ||
sudo /usr/local/bin/sdb -e "${scmds[$i]}" | ||
done | ||
|
||
zfs_scmds=( | ||
# Test `arc` | ||
"arc" | ||
|
||
# Test `zfs_dbgmsg` | ||
"zfs_dbgmsg" | ||
|
||
# Test `zio` | ||
"zio" | ||
|
||
# Test `spa` | ||
"spa -vmH" | ||
|
||
# Test `vdev` and `metaslab` | ||
"spa | vdev | metaslab" | ||
|
||
# Test `vdev` and `metaslab` and `range_tree` | ||
"spa | vdev | metaslab | head 1 | member ms_allocatable | range_tree" | ||
|
||
# Test `dbuf` | ||
"dbuf" | ||
|
||
# Test `dbuf` and `blkptr` | ||
"dbuf | head 1 | member db_blkptr | blkptr" | ||
|
||
# Test `spa` and `zhist` | ||
"spa | member spa_normal_class.mc_histogram | zhist" | ||
|
||
# Test `avl` | ||
"address spa_namespace_avl | avl" | ||
|
||
# Test `spl_kmem_caches` | ||
"spl_kmem_caches" | ||
) | ||
|
||
if $(lsmod | grep -q zfs); then | ||
echo "Detected ZFS kernel module... testing ZFS commands:" | ||
for ((i = 0; i < ${#zfs_scmds[@]}; i++)); do | ||
sudo /usr/local/bin/sdb -e "${zfs_scmds[$i]}" | ||
done | ||
else | ||
echo "Can't find ZFS kernel module... skipping ZFS commands" | ||
fi |