Hi Coiby,
On Thu, Oct 20, 2022 at 2:41 PM Coiby Xu <coxu(a)redhat.com> wrote:
Hi Tao,
This test can't run on F35, right?
Yes, the test cannot be run on f35. It requires dracut >=057, because
the 80lvmthinpool-monitor is integrated in 057.
Although the vmcore can be dumped, vmcore seems to be invalid,
Found a vmcore dir "/mnt/var/crash/127.0.0.1-2022-10-20-06:20:33":
[ 3.157266] init.sh[748]: __vtop4_x86_64: Can't get a valid pgd.
[ 3.159155] init.sh[748]: readmem: Can't convert a virtual
address(ffffffff9ae1a700) to physical address.
Failed to retrive dmesg from vmcore!
[ 3.163699] init.sh[748]: readmem: type_addr: 0, addr:ffffffff9ae1a700, size:390
[ 3.165721] init.sh[748]: check_release: Can't get the address of system_utsname.
[ 3.174909] init.sh[748]: makedumpfile Failed.
On Sat, Oct 08, 2022 at 03:41:43PM +0800, Tao Liu wrote:
>Signed-off-by: Tao Liu <ltao(a)redhat.com>
>---
> .../lvm2-thinp-kdump/0-local-lvm2-thinp.sh | 59 +++++++++++++++++++
> .../testcases/lvm2-thinp-kdump/lvm.conf | 5 ++
> 2 files changed, 64 insertions(+)
> create mode 100755 tests/scripts/testcases/lvm2-thinp-kdump/0-local-lvm2-thinp.sh
> create mode 100644 tests/scripts/testcases/lvm2-thinp-kdump/lvm.conf
>
>diff --git a/tests/scripts/testcases/lvm2-thinp-kdump/0-local-lvm2-thinp.sh
b/tests/scripts/testcases/lvm2-thinp-kdump/0-local-lvm2-thinp.sh
>new file mode 100755
>index 0000000..c4ebded
>--- /dev/null
>+++ b/tests/scripts/testcases/lvm2-thinp-kdump/0-local-lvm2-thinp.sh
>@@ -0,0 +1,59 @@
>+on_build() {
>+ TEST_DIR_PREFIX=/tmp/lvm_test.XXXXXX
>+ # clear TEST_DIRs if any
>+ rm -rf ${TEST_DIR_PREFIX%.*}.*
>+ TEST_IMG="$(mktemp -d $TEST_DIR_PREFIX)/test.img"
>+
>+ img_inst_pkg "lvm2"
>+ img_inst $TESTDIR/scripts/testcases/lvm2-thinp-kdump/lvm.conf /etc/lvm/
>+ dd if=/dev/zero of=$TEST_IMG bs=300M count=1
>+ # The test.img will be /dev/sdb
>+ img_add_qemu_cmd "-hdb $TEST_IMG"
>+}
>+
>+on_test() {
>+ VG=vg00
>+ LV_THINPOOL=thinpool
>+ LV_VOLUME=thinlv
>+ VMCORE_PATH=var/crash
>+
>+ local boot_count=$(get_test_boot_count)
>+
>+ if [ $boot_count -eq 1 ]; then
>+
>+ vgcreate $VG /dev/sdb
>+ # Create a small thinpool which is definitely not enough for
>+ # vmcore, then create a thin volume which is definitely enough
>+ # for vmcore, so we can make sure thinpool should be autoextend
>+ # during runtime.
>+ lvcreate -L 10M -T $VG/$LV_THINPOOL
>+ lvcreate -V 300M -T $VG/$LV_THINPOOL -n $LV_VOLUME
You can see here, the thinpool is too small to hold a vmcore, without
the 80lvmthinpool-monitor module to monitor and autoextend its size,
the vmcore dumping will not be successful.
If you really want to test on f35, you can copy the
80lvmthinpool-monitor to /lib/dracut/modules.d/ of f35. Then the test
can be OK. Or you can change 10M to 400M of $VG/$LV_THINPOOL, and dd
if=/dev/zero of=$TEST_IMG bs=400M count=1, so the size of thinpool is
enough, and 80lvmthinpool-monitor is not a necessary for the case.
Thanks,
Tao Liu
>+ mkfs.ext4 /dev/$VG/$LV_VOLUME
>+ mount /dev/$VG/$LV_VOLUME /mnt
>+ mkdir -p /mnt/$VMCORE_PATH
>+
>+ cat << EOF > /etc/kdump.conf
>+ext4 /dev/$VG/$LV_VOLUME
>+path /$VMCORE_PATH
>+core_collector makedumpfile -l --message-level 7 -d 31
>+EOF
>+ kdumpctl start || test_failed "Failed to start kdump"
>+
>+ sync
>+
>+ echo 1 > /proc/sys/kernel/sysrq
>+ echo c > /proc/sysrq-trigger
>+
>+ elif [ $boot_count -eq 2 ]; then
>+ mount /dev/$VG/$LV_VOLUME /mnt
>+ if has_valid_vmcore_dir /mnt/$VMCORE_PATH; then
>+ test_passed
>+ else
>+ test_failed "Vmcore missing"
>+ fi
>+
>+ shutdown -h 0
>+ else
>+ test_failed "Unexpected reboot"
>+ fi
>+}
>diff --git a/tests/scripts/testcases/lvm2-thinp-kdump/lvm.conf
b/tests/scripts/testcases/lvm2-thinp-kdump/lvm.conf
>new file mode 100644
>index 0000000..4d81fbd
>--- /dev/null
>+++ b/tests/scripts/testcases/lvm2-thinp-kdump/lvm.conf
>@@ -0,0 +1,5 @@
>+activation {
>+ thin_pool_autoextend_threshold = 70
>+ thin_pool_autoextend_percent = 20
>+ monitoring = 1
>+}
>\ No newline at end of file
>--
>2.33.1
>
--
Best regards,
Coiby