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

tests/kola: adding the external kola test for luks + multipath case #3124

Open
wants to merge 1 commit into
base: testing-devel
Choose a base branch
from

Conversation

Poorna-Gottimukkula1
Copy link

@Poorna-Gottimukkula1 Poorna-Gottimukkula1 commented Aug 27, 2024

Adding the external kola test for luks + multipath validation
ref: https://issues.redhat.com/browse/OCPBUGS-13123
coreos/fedora-coreos-tracker#1728

@Poorna-Gottimukkula1 Poorna-Gottimukkula1 changed the title tests/kola:: Adding the external kola test for luks + multipath case tests/kola: adding the external kola test for luks + multipath case Aug 27, 2024
@Poorna-Gottimukkula1 Poorna-Gottimukkula1 force-pushed the add-luks-multipath-ext-test branch 2 times, most recently from a305f0c to 178e930 Compare August 28, 2024 09:37
@jlebon
Copy link
Member

jlebon commented Aug 28, 2024

CI is hitting:

boot mounted not by UUID

We need to update the logic here to instead be something like (pseudo-code):

if we have rd.multipath=default karg; then
  verify that boot.mount's What is /dev/disk/by-label/dm-mpath-boot
else if ... (same logic as before)
fi

Copy link
Member

@jlebon jlebon left a comment

Choose a reason for hiding this comment

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

Since the original bug was against PowerPC, can you verify that it also passes there?

Comment on lines 33 to 44
if grep -q "rd.multipath=default" /proc/cmdline; then
if ! systemctl cat boot.mount | grep -q "What=/dev/disk/by-label/dm-mpath-boot"; then
systemctl cat boot.mount
fatal "boot is not mounted by /dev/disk/by-label/dm-mpath-boot"
fi
ok "boot mounted from /dev/disk/by-label/dm-mpath-boot"
else
if ! systemctl cat boot.mount | grep -q "What=/dev/disk/by-uuid"; then
systemctl cat boot.mount
fatal "boot is not mounted by UUID as expected"
fi
ok "boot mounted by UUID"
Copy link
Member

Choose a reason for hiding this comment

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

Looks like a good candidate to dedupe. E.g. something like

if grep ...; then
  expected_what=/dev/disk/by-label/dm-mpath-boot
else
  expected_what=/dev/disk/by-uuid
fi
if ! systemctl cat ...

Choose a reason for hiding this comment

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

Updated the changes as per the above suggestion.

@Poorna-Gottimukkula1
Copy link
Author

Since the original bug was against PowerPC, can you verify that it also passes there?

Yes, I have tested it on PowerPC and it got passed.

Sep 02 09:22:37 qemu0 kola-runext-test.sh[4044]: + reboot
-- Boot b4d12cf821e64eb6a0f4eedc164611f4 --
Sep 02 09:23:23 qemu0 kola-runext-test.sh[1695]: + . /var/opt/kola/extdata/commonlib.sh
Sep 02 09:23:23 qemu0 kola-runext-test.sh[1695]: ++ IFS=' '
Sep 02 09:23:23 qemu0 kola-runext-test.sh[1695]: ++ read -r -a cmdline
Sep 02 09:23:23 qemu0 kola-runext-test.sh[1696]: ++ findmnt -nvr /sysroot -o SOURCE
Sep 02 09:23:23 qemu0 kola-runext-test.sh[1695]: + srcdev=/dev/mapper/myluksdev
Sep 02 09:23:23 qemu0 kola-runext-test.sh[1695]: + parent_device=/dev/mapper/mpatha
Sep 02 09:23:23 qemu0 kola-runext-test.sh[1697]: + lsblk -pno NAME /dev/mapper/mpatha
Sep 02 09:23:23 qemu0 kola-runext-test.sh[1698]: + grep -qw /dev/mapper/myluksdev
Sep 02 09:23:23 qemu0 kola-runext-test.sh[1695]: + ok '/dev/mapper/myluksdev device is part of the parent /dev/mapper/mpatha device'
Sep 02 09:23:23 qemu0 kola-runext-test.sh[1695]: + echo ok '/dev/mapper/myluksdev device is part of the parent /dev/mapper/mpatha device'
Sep 02 09:23:23 qemu0 kola-runext-test.sh[1695]: ok /dev/mapper/myluksdev device is part of the parent /dev/mapper/mpatha device
Sep 02 09:23:23 qemu0 kola-runext-test.sh[1695]: + . /var/opt/kola/extdata/luks-test.sh
Sep 02 09:23:23 qemu0 kola-runext-test.sh[1695]: ++ . /var/opt/kola/extdata/commonlib.sh
Sep 02 09:23:23 qemu0 kola-runext-test.sh[1695]: +++ IFS=' '
Sep 02 09:23:23 qemu0 kola-runext-test.sh[1695]: +++ read -r -a cmdline
Sep 02 09:23:23 qemu0 kola-runext-test.sh[1699]: +++ findmnt -nvr /sysroot -o SOURCE
Sep 02 09:23:23 qemu0 kola-runext-test.sh[1695]: ++ srcdev=/dev/mapper/myluksdev
Sep 02 09:23:23 qemu0 kola-runext-test.sh[1695]: ++ [[ /dev/mapper/myluksdev == /dev/mapper/myluksdev ]]
Sep 02 09:23:23 qemu0 kola-runext-test.sh[1700]: +++ lsblk -o TYPE /dev/mapper/myluksdev --noheadings
Sep 02 09:23:23 qemu0 kola-runext-test.sh[1695]: ++ blktype=crypt
Sep 02 09:23:23 qemu0 kola-runext-test.sh[1695]: ++ [[ crypt == crypt ]]
Sep 02 09:23:23 qemu0 kola-runext-test.sh[1701]: +++ findmnt -nvr /sysroot -o FSTYPE
Sep 02 09:23:23 qemu0 kola-runext-test.sh[1695]: ++ fstype=xfs
Sep 02 09:23:23 qemu0 kola-runext-test.sh[1695]: ++ [[ xfs == xfs ]]
Sep 02 09:23:23 qemu0 kola-runext-test.sh[1695]: ++ ok 'source is XFS on LUKS device'
Sep 02 09:23:23 qemu0 kola-runext-test.sh[1695]: ++ echo ok 'source is XFS on LUKS device'
Sep 02 09:23:23 qemu0 kola-runext-test.sh[1695]: ok source is XFS on LUKS device
Sep 02 09:23:23 qemu0 kola-runext-test.sh[1702]: +++ findmnt /sysroot -no OPTIONS
Sep 02 09:23:23 qemu0 kola-runext-test.sh[1695]: ++ rootflags=ro,relatime,seclabel,attr2,inode64,logbufs=8,logbsize=32k,prjquota
Sep 02 09:23:23 qemu0 kola-runext-test.sh[1695]: ++ grep prjquota
Sep 02 09:23:23 qemu0 kola-runext-test.sh[1703]: ro,relatime,seclabel,attr2,inode64,logbufs=8,logbsize=32k,prjquota
Sep 02 09:23:23 qemu0 kola-runext-test.sh[1695]: ++ ok 'root mounted with prjquota'
Sep 02 09:23:23 qemu0 kola-runext-test.sh[1695]: ++ echo ok 'root mounted with prjquota'
Sep 02 09:23:23 qemu0 kola-runext-test.sh[1695]: ok root mounted with prjquota
Sep 02 09:23:23 qemu0 kola-runext-test.sh[1704]: +++ dmsetup table myluksdev
Sep 02 09:23:23 qemu0 kola-runext-test.sh[1695]: ++ table='0 20137985 crypt aes-xts-plain64 :64:logon:cryptsetup:0680a9c4-9392-4038-a76d-7c932e386fa3-d0 0 253:4 32768 2 allow_discards no_read_workqueue'
Sep 02 09:23:23 qemu0 kola-runext-test.sh[1695]: ++ grep -q allow_discards
Sep 02 09:23:23 qemu0 kola-runext-test.sh[1695]: ++ grep -q no_read_workqueue
Sep 02 09:23:23 qemu0 kola-runext-test.sh[1695]: ++ ok 'discard and custom option enabled for root LUKS'
Sep 02 09:23:23 qemu0 kola-runext-test.sh[1695]: ++ echo ok 'discard and custom option enabled for root LUKS'
Sep 02 09:23:23 qemu0 kola-runext-test.sh[1695]: ok discard and custom option enabled for root LUKS
Sep 02 09:23:23 qemu0 kola-runext-test.sh[1695]: ++ grep -q rd.multipath=default /proc/cmdline
Sep 02 09:23:23 qemu0 kola-runext-test.sh[1695]: ++ expected_what=/dev/disk/by-label/dm-mpath-boot
Sep 02 09:23:23 qemu0 kola-runext-test.sh[1708]: ++ systemctl cat boot.mount
Sep 02 09:23:23 qemu0 kola-runext-test.sh[1709]: ++ grep -q What=/dev/disk/by-label/dm-mpath-boot
Sep 02 09:23:23 qemu0 kola-runext-test.sh[1695]: ++ ok 'boot mounted by /dev/disk/by-label/dm-mpath-boot'
Sep 02 09:23:23 qemu0 kola-runext-test.sh[1695]: ++ echo ok 'boot mounted by /dev/disk/by-label/dm-mpath-boot'
Sep 02 09:23:23 qemu0 kola-runext-test.sh[1695]: ok boot mounted by /dev/disk/by-label/dm-mpath-boot
Sep 02 09:23:23 qemu0 kola-runext-test.sh[1695]: ++ case "${AUTOPKGTEST_REBOOT_MARK:-}" in
Sep 02 09:23:23 qemu0 kola-runext-test.sh[1695]: ++ grep root=UUID= /proc/cmdline
Sep 02 09:23:23 qemu0 kola-runext-test.sh[1710]: BOOT_IMAGE=(ieee1275/disk,gpt3)/boot/ostree/fedora-coreos-65304876925e9d232cf5dd7e696261f5d426a40b51c81eb51816e2e1da15295d/vmlinuz-6.10.6-200.fc40.ppc64le rw mitigations=auto,nosmt ostree=/ostree/boot.1/fedora-coreos/65304876925e9d232cf5dd7e696261f5d426a40b51c81eb51816e2e1da15295d/0 ignition.platform.id=qemu console=hvc0 console=tty0 rd.multipath=default rd.luks.name=0680a9c4-9392-4038-a76d-7c932e386fa3=myluksdev root=UUID=9236cc89-0efd-46fe-9978-8ca6aff0f203 rw rootflags=prjquota boot=UUID=adadd9db-e857-487b-8a76-65c537af3c99
Sep 02 09:23:23 qemu0 kola-runext-test.sh[1695]: ++ grep rd.luks.name= /proc/cmdline
Sep 02 09:23:23 qemu0 kola-runext-test.sh[1711]: BOOT_IMAGE=(ieee1275/disk,gpt3)/boot/ostree/fedora-coreos-65304876925e9d232cf5dd7e696261f5d426a40b51c81eb51816e2e1da15295d/vmlinuz-6.10.6-200.fc40.ppc64le rw mitigations=auto,nosmt ostree=/ostree/boot.1/fedora-coreos/65304876925e9d232cf5dd7e696261f5d426a40b51c81eb51816e2e1da15295d/0 ignition.platform.id=qemu console=hvc0 console=tty0 rd.multipath=default rd.luks.name=0680a9c4-9392-4038-a76d-7c932e386fa3=myluksdev root=UUID=9236cc89-0efd-46fe-9978-8ca6aff0f203 rw rootflags=prjquota boot=UUID=adadd9db-e857-487b-8a76-65c537af3c99
Sep 02 09:23:23 qemu0 kola-runext-test.sh[1695]: ++ ok 'found root kargs'
Sep 02 09:23:23 qemu0 kola-runext-test.sh[1695]: ++ echo ok 'found root kargs'
Sep 02 09:23:23 qemu0 kola-runext-test.sh[1695]: ok found root kargs
Sep 02 09:23:23 qemu0 kola-runext-test.sh[1695]: ++ grep boot=UUID= /proc/cmdline
Sep 02 09:23:23 qemu0 kola-runext-test.sh[1712]: BOOT_IMAGE=(ieee1275/disk,gpt3)/boot/ostree/fedora-coreos-65304876925e9d232cf5dd7e696261f5d426a40b51c81eb51816e2e1da15295d/vmlinuz-6.10.6-200.fc40.ppc64le rw mitigations=auto,nosmt ostree=/ostree/boot.1/fedora-coreos/65304876925e9d232cf5dd7e696261f5d426a40b51c81eb51816e2e1da15295d/0 ignition.platform.id=qemu console=hvc0 console=tty0 rd.multipath=default rd.luks.name=0680a9c4-9392-4038-a76d-7c932e386fa3=myluksdev root=UUID=9236cc89-0efd-46fe-9978-8ca6aff0f203 rw rootflags=prjquota boot=UUID=adadd9db-e857-487b-8a76-65c537af3c99
Sep 02 09:23:23 qemu0 kola-runext-test.sh[1695]: ++ ok 'found boot karg'
Sep 02 09:23:23 qemu0 kola-runext-test.sh[1695]: ++ echo ok 'found boot karg'
Sep 02 09:23:23 qemu0 kola-runext-test.sh[1695]: ok found boot karg

jlebon
jlebon previously approved these changes Sep 3, 2024
Copy link
Member

@jlebon jlebon left a comment

Choose a reason for hiding this comment

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

Minor comment, but LGTM as is too.
Thanks for working on this!

## kola:
## # This test reprovisions the rootfs.
## tags: "reprovision"
## # This uses additionalDisks, which is QEMU only
Copy link
Member

Choose a reason for hiding this comment

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

This comment is incorrect. It's more like:

Suggested change
## # This uses additionalDisks, which is QEMU only
## # This uses appendKernelArgs and multipath, which is QEMU only

Choose a reason for hiding this comment

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

Yes, updated it.

Signed-off-by: Poorna Gottimukkula <Poorna.Gottimukkula1@ibm.com>
Copy link
Member

@jlebon jlebon left a comment

Choose a reason for hiding this comment

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

LGTM!

Just one final sanity-check: did you test this on both RHCOS and FCOS?

@Poorna-Gottimukkula1
Copy link
Author

Poorna-Gottimukkula1 commented Sep 4, 2024

Just one final sanity-check: did you test this on both RHCOS and FCOS?

I tested this only on FCOS as the RHCOS having issues in boot(found multiple parent devices for crypt device /dev/dm-0), its seems the coreos-installer fix did not landed in RHCOS.

Shell i build the RHCOS image with custom coreos-installer and try this out.?

@jlebon
Copy link
Member

jlebon commented Sep 4, 2024

Just one final sanity-check: did you test this on both RHCOS and FCOS?

I tested this only on FCOS as the RHCOS having issues in boot(found multiple parent devices for crypt device /dev/dm-0), its seems the coreos-installer fix did not landed in RHCOS.

Ahh indeed. We're still on v0.21.0 there for some reason. Will inquire about that.

@jlebon jlebon added the hold label Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants