Skip to content

e2e TestNoReboot fails on RHEL10: GetSSHPaths missing EL10 handling #6204

Description

@sarthakpurohit

Summary

The TestNoReboot e2e test is persistently failing across multiple CI jobs on RHEL10/CentOS10 clusters because GetSSHPaths() in test/helpers/utils.go does not handle EL10.

Failing Jobs

  • pull-ci-openshift-machine-config-operator-main-e2e-gcp-op-single-node
  • pull-ci-openshift-machine-config-operator-main-e2e-gcp-op-part1
  • pull-ci-openshift-machine-config-operator-main-e2e-gcp-op-part2
  • pull-ci-openshift-machine-config-operator-main-e2e-gcp-op-ocl-part1
  • pull-ci-openshift-machine-config-operator-main-e2e-gcp-op-ocl-part2

Root Cause

GetSSHPaths() in test/helpers/utils.go:783 checks for IsEL9(), IsSCOS(), and IsFCOS() to return the new SSH key path (/home/core/.ssh/authorized_keys.d/ignition), but does not check for IsEL10():

func GetSSHPaths(os osrelease.OperatingSystem) SSHPaths {
    if os.IsEL9() || os.IsSCOS() || os.IsFCOS() {
        return SSHPaths{
            Expected:    constants.RHCOS9SSHKeyPath,
            NotExpected: constants.RHCOS8SSHKeyPath,
        }
    }
    // Falls through to RHCOS8 path for EL10, which is wrong
    return SSHPaths{
        Expected:    constants.RHCOS8SSHKeyPath,
        NotExpected: constants.RHCOS9SSHKeyPath,
    }
}

On RHEL10, IsEL9() returns false, so the function falls through to the default case and returns the legacy path /home/core/.ssh/authorized_keys. However, RHEL10 uses the new path /home/core/.ssh/authorized_keys.d/ignition.

Error Output

Error: expected to find file /rootfs/home/core/.ssh/authorized_keys on node, got:
stat: cannot statx '/rootfs/home/core/.ssh/authorized_keys': No such file or directory

Error: expected not to find file /rootfs/home/core/.ssh/authorized_keys.d/ignition on node, got:
File: /rootfs/home/core/.ssh/authorized_keys.d/ignition (file exists)

Suggested Fix

Add IsEL10() to the condition in GetSSHPaths():

if os.IsEL9() || os.IsEL10() || os.IsSCOS() || os.IsFCOS() {

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions