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 iscsi+multipath test; add some improvements to test strategy #3789

Merged
merged 12 commits into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 23 additions & 11 deletions mantle/cmd/kola/resources/iscsi_butane_setup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ storage:
After=local-fs.target network-online.target nss-lookup.target dev-disk-by\x2did-virtio\x2dtarget.device
Wants=network-online.target
OnFailure=emergency.target
OnFailureJobMode=isolate
[Container]
Image=quay.io/coreos-assembler/targetcli:latest
ContainerName=targetd
Expand All @@ -46,33 +47,41 @@ storage:
# FIXME: use RestartMode=direct instead in the systemd unit but we need systemd v254
while ! targetcli ls; do sleep 1; done
targetcli /backstores/block create name=coreos dev=/dev/disk/by-id/virtio-target
targetcli iscsi/ create iqn.2023-10.coreos.target.vm:coreos
targetcli iscsi/iqn.2023-10.coreos.target.vm:coreos/tpg1/luns create /backstores/block/coreos
targetcli iscsi/iqn.2023-10.coreos.target.vm:coreos/tpg1/ set attribute authentication=0 demo_mode_write_protect=0 generate_node_acls=1 cache_dynamic_acls=1
targetcli iscsi/ create iqn.2024-05.com.coreos:0
targetcli iscsi/ create iqn.2024-05.com.coreos:1
targetcli iscsi/iqn.2024-05.com.coreos:0/tpg1/luns create /backstores/block/coreos
targetcli iscsi/iqn.2024-05.com.coreos:1/tpg1/luns create /backstores/block/coreos
targetcli iscsi/iqn.2024-05.com.coreos:0/tpg1/ set attribute authentication=0 demo_mode_write_protect=0 generate_node_acls=1 cache_dynamic_acls=1
targetcli iscsi/iqn.2024-05.com.coreos:1/tpg1/ set attribute authentication=0 demo_mode_write_protect=0 generate_node_acls=1 cache_dynamic_acls=1
"
# Will return 0 if the discovery yield a valid portal
iscsiadm -m discovery -p 127.0.0.1 -t st | grep iqn.2023-10.coreos.target.vm:coreos
iscsiadm --mode discovery --type sendtargets --portal 127.0.0.1 | \
grep iqn.2024-05.com.coreos
- path: /var/boot.ipxe
mode: 0644
contents:
inline: |
#!ipxe
set initiator-iqn iqn.2023-11.coreos.diskless:testsetup
sanboot iscsi:10.0.2.15::::iqn.2023-10.coreos.target.vm:coreos
# set some random uuid as the initiator iqn. we can use
# a random value here because we don't have ACL's enabled,
# but we do need to provide it because otherwise this will
# fail pointing to https://ipxe.org/1c0d6502
set initiator-iqn iqn.68cc69b9-1b54-4ff1-9d61-eedb570da8fd
sanboot iscsi:10.0.2.15::::iqn.2024-05.com.coreos:0 \
iscsi:10.0.2.15::::iqn.2024-05.com.coreos:1
- path: /usr/local/bin/install-coreos-iscsi
mode: 0755
contents:
inline: |
#!/bin/bash
set -euxo
set -euxo pipefail
# Mount the iscsi target
iscsiadm -m discovery -t st -p 127.0.0.1
iscsiadm -m node -T iqn.2023-10.coreos.target.vm:coreos -l
iscsiadm --mode discovery --type sendtargets --portal 127.0.0.1 --login
# Give a bit of time to udev to create the persistent names paths
sleep 2
# Install coreos
coreos-installer install \
/dev/disk/by-path/ip-127.0.0.1\:3260-iscsi-iqn.2023-10.coreos.target.vm\:coreos-lun-0 \
/dev/disk/by-path/ip-127.0.0.1\:3260-iscsi-iqn.2024-05.com.coreos\:0-lun-0 \
COREOS_INSTALLER_KARGS \
--console ttyS0,115200n8 \
-i /var/nested-ign.json
Expand All @@ -87,6 +96,7 @@ storage:
Wants=network-online.target install-coreos-to-iscsi-target.service
Requires=install-coreos-to-iscsi-target.service
OnFailure=emergency.target
OnFailureJobMode=isolate
[Container]
Image=quay.io/coreos-assembler/coreos-assembler
ContainerName=iscsiboot
Expand Down Expand Up @@ -115,7 +125,7 @@ storage:
"systemd": {
"units": [
{
"contents": "[Unit]\nDescription=iSCSI Boot Signal Completion\nAfter=multi-user.target\nOnFailureJobMode=isolate\n[Service]\nType=oneshot\nRemainAfterExit=yes\nExecStart=/bin/sh -c '/usr/bin/echo \"iscsi-boot-ok\" \u003e/dev/virtio-ports/testisocompletion \u0026\u0026 systemctl poweroff'\n[Install]\nRequiredBy=multi-user.target\n",
"contents": "[Unit]\nDescription=iSCSI Boot Signal Completion\nAfter=multi-user.target\nOnFailure=emergency.target\nOnFailureJobMode=isolate\n[Service]\nType=oneshot\nRemainAfterExit=yes\nExecStart=/bin/sh -c '/usr/bin/echo \"iscsi-boot-ok\" \u003e/dev/virtio-ports/testisocompletion \u0026\u0026 systemctl poweroff'\n[Install]\nRequiredBy=multi-user.target\n",
"enabled": true,
"name": "successful-boot-signal.service"
}
Expand All @@ -133,6 +143,7 @@ systemd:
After=targetd.service
ConditionFirstBoot=true
OnFailure=emergency.target
OnFailureJobMode=isolate
[Service]
Type=oneshot
RemainAfterExit=yes
Expand All @@ -148,6 +159,7 @@ systemd:
Requires=setup-targetcli.service
After=setup-targetcli.service
OnFailure=emergency.target
OnFailureJobMode=isolate
[Service]
Type=oneshot
RemainAfterExit=yes
Expand Down
24 changes: 15 additions & 9 deletions mantle/cmd/kola/testiso.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ var (
"iso-offline-install.bios",
"iso-offline-install.mpath.bios",
"iso-offline-install-fromram.4k.uefi",
"iso-offline-install-iscsi.ibft.bios",
"iso-offline-install-iscsi.ibft.uefi",
dustymabe marked this conversation as resolved.
Show resolved Hide resolved
"iso-offline-install-iscsi.ibft-with-mpath.bios",
"iso-offline-install-iscsi.manual.bios",
"miniso-install.bios",
"miniso-install.nm.bios",
Expand All @@ -113,8 +114,9 @@ var (
"miniso-install.nm.s390fw",
"miniso-install.4k.nm.s390fw",
// FIXME https://github.com/coreos/fedora-coreos-tracker/issues/1657
//"iso-offline-install-iscsi.ibft.bios",
//"iso-offline-install-iscsi.manual.bios",
//"iso-offline-install-iscsi.ibft.s390fw,
//"iso-offline-install-iscsi.ibft-with-mpath.s390fw",
//"iso-offline-install-iscsi.manual.s390fw",
}
tests_ppc64le = []string{
"iso-live-login.ppcfw",
Expand All @@ -128,8 +130,9 @@ var (
"pxe-online-install.ppcfw",
"pxe-offline-install.4k.ppcfw",
// FIXME https://github.com/coreos/fedora-coreos-tracker/issues/1657
//"iso-offline-install-iscsi.ibft.bios",
//"iso-offline-install-iscsi.manual.bios",
//"iso-offline-install-iscsi.ibft.ppcfw",
//"iso-offline-install-iscsi.ibft-with-mpath.ppcfw",
//"iso-offline-install-iscsi.manual.ppcfw",
}
tests_aarch64 = []string{
"iso-live-login.uefi",
Expand All @@ -146,8 +149,9 @@ var (
"pxe-online-install.uefi",
"pxe-online-install.4k.uefi",
// FIXME https://github.com/coreos/fedora-coreos-tracker/issues/1657
//"iso-offline-install-iscsi.ibft.bios",
//"iso-offline-install-iscsi.manual.bios",
//"iso-offline-install-iscsi.ibft.uefi",
//"iso-offline-install-iscsi.ibft-with-mpath.uefi",
//"iso-offline-install-iscsi.manual.uefi",
}
)

Expand Down Expand Up @@ -616,9 +620,11 @@ func runTestIso(cmd *cobra.Command, args []string) (err error) {
var butane_config string
switch components[1] {
case "ibft":
butane_config = strings.ReplaceAll(iscsi_butane_config, "COREOS_INSTALLER_KARGS", "--append-karg rd.iscsi.firmware=1 --append-karg ip=ibft")
butane_config = strings.ReplaceAll(iscsi_butane_config, "COREOS_INSTALLER_KARGS", "--append-karg rd.iscsi.firmware=1")
case "manual":
butane_config = strings.ReplaceAll(iscsi_butane_config, "COREOS_INSTALLER_KARGS", "--append-karg rd.iscsi.initiator=iqn.2023-11.coreos.diskless:testsetup --append-karg netroot=iscsi:10.0.2.15::::iqn.2023-10.coreos.target.vm:coreos")
butane_config = strings.ReplaceAll(iscsi_butane_config, "COREOS_INSTALLER_KARGS", "--append-karg netroot=iscsi:10.0.2.15::::iqn.2024-05.com.coreos:0")
case "ibft-with-mpath":
butane_config = strings.ReplaceAll(iscsi_butane_config, "COREOS_INSTALLER_KARGS", "--append-karg rd.iscsi.firmware=1 --append-karg rd.multipath=default --append-karg root=/dev/disk/by-label/dm-mpath-root")
Copy link
Member

Choose a reason for hiding this comment

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

Interesting. This normally should also require --append-karg rw as per https://github.com/openshift/os/blob/master/docs/faq.md#q-does-rhcos-support-multipath-on-the-primary-disk. Wonder why it's not required here.

Copy link
Member Author

Choose a reason for hiding this comment

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

In my original testing I always added rw but then when I got here I was challenging every kernel argument and testing without them and it still passed the test. I went back and removed it in my original setup and it wasn't needed there either from what I could tell.

Copy link
Member Author

Choose a reason for hiding this comment

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

followup in #3797

default:
plog.Fatalf("Unknown test name:%s", test)
}
Expand Down
13 changes: 12 additions & 1 deletion mantle/platform/qemu.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,8 @@ func (inst *QemuInstance) Destroy() {
os.Remove(inst.qmpSocketPath) //nolint // Ignore Errors
}
if inst.journalPipe != nil {
plog.Debugf("Sleep 1 to allow for more journal messages to get flushed")
time.Sleep(1 * time.Second)
inst.journalPipe.Close()
inst.journalPipe = nil
}
Expand Down Expand Up @@ -1629,12 +1631,21 @@ func (builder *QemuBuilder) VirtioJournal(config *conf.Conf, queryArguments stri
var streamJournalUnit = fmt.Sprintf(`[Unit]
Requires=dev-virtio\\x2dports-mantlejournal.device
IgnoreOnIsolate=true
# DefaultDependencies=false so that Requires=sysinit.target
# won't be added to this unit, which would cause it to get
# taken down when isolating to emergency.target
DefaultDependencies=no
After=systemd.journal.service
# After systemd-journal-flush because otherwise the journalctl -f
# below will stop when the journal is flushed. Not sure if this is
# a bug or intended behavior.
After=systemd-journal-flush.service
[Service]
Type=simple
StandardOutput=file:/dev/virtio-ports/mantlejournal
# Wrap in /bin/bash to hack around SELinux
# https://bugzilla.redhat.com/show_bug.cgi?id=1942198
ExecStart=/usr/bin/bash -c "journalctl -q -b -f -o json --no-tail %s"
ExecStart=/usr/bin/bash -c "journalctl -q -b -f --no-tail %s"
[Install]
RequiredBy=basic.target
`, queryArguments)
Expand Down
Loading