Skip to content
Draft
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
1 change: 1 addition & 0 deletions schedule/yam/agama.yaml

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think you'd better create a new schedule file for Nvidia test, it seems your module validate_kernel_version only for Nvidia test.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same for other schedule files.

Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ schedule:
- yam/validate/validate_snapshots
- yam/validate/validate_registered_products
- console/validate_repos
- yam/validate/validate_kernel_version
1 change: 1 addition & 0 deletions schedule/yam/agama_immutable.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ schedule:
- yam/validate/validate_packages
- yam/validate/validate_immutable_mountpoints
- yam/validate/validate_package_manager_immutable
- yam/validate/validate_kernel_version
1 change: 1 addition & 0 deletions schedule/yam/agama_unattended.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ schedule:
- yam/validate/validate_hostname
- yam/validate/validate_snapshots
- yam/validate/validate_registered_products
- yam/validate/validate_kernel_version
- console/validate_repos
- shutdown/grub_set_bootargs
- shutdown/cleanup_before_shutdown
Expand Down
1 change: 1 addition & 0 deletions schedule/yam/agama_unattended_immutable.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ schedule:
- yam/validate/validate_packages
- yam/validate/validate_immutable_mountpoints
- yam/validate/validate_package_manager_immutable
- yam/validate/validate_kernel_version
7 changes: 4 additions & 3 deletions test_data/yam/agama_sle_immutable_nvidia.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
kernel_version: 6.12.0-160100.1-nvidia64kb

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

agama_sle_nvidia_immutable.yaml
(From more generic to more specific)

os_release:
NAME: 'SLES'
PRETTY_NAME: 'SUSE Linux Enterprise Server %VERSION%'
Expand All @@ -12,17 +13,17 @@ os_release:
repos:
- name: SLES-NVIDIA-%VERSION%
alias: SUSE_Linux_Enterprise_Server_for_NVIDIA_%VERSION%_%ARCH%:SLES-NVIDIA-%VERSION%
uri: http://openqa.suse.de/assets/repo/SLES-%VERSION%-%ARCH%-Build%BUILD%/
uri: http://openqa.suse.de/assets/repo/SLES-NVIDIA-%VERSION%-%ARCH%-Build%BUILD%

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

you are missing the final / for each uri.

enabled: 'Yes'
filter: name
- name: SLES-NVIDIA-%VERSION%-Debug
alias: SUSE_Linux_Enterprise_Server_for_NVIDIA_%VERSION%_%ARCH%:SLES-NVIDIA-%VERSION%-Debug
uri: http://openqa.suse.de/assets/repo/SLES-%VERSION%-%ARCH%-Debug-Build%BUILD%/
uri: http://openqa.suse.de/assets/repo/SLES-NVIDIA-%VERSION%-%ARCH%-Build%BUILD%
enabled: 'No'
filter: name
- name: SLES-NVIDIA-%VERSION%-Source
alias: SUSE_Linux_Enterprise_Server_for_NVIDIA_%VERSION%_%ARCH%:SLES-NVIDIA-%VERSION%-Source
uri: http://openqa.suse.de/assets/repo/SLES-%VERSION%-%ARCH%-Source-Build%BUILD%/
uri: http://openqa.suse.de/assets/repo/SLES-NVIDIA-%VERSION%-%ARCH%-Build%BUILD%
enabled: 'No'
filter: name
selinux:
Expand Down
7 changes: 4 additions & 3 deletions test_data/yam/agama_sle_nvidia.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
kernel_version: 6.12.0-160100.1-nvidia64kb
os_release:
NAME: 'SLES'
PRETTY_NAME: 'SUSE Linux Enterprise Server %VERSION%'
Expand All @@ -12,17 +13,17 @@ os_release:
repos:
- name: SLES-NVIDIA-%VERSION%
alias: SUSE_Linux_Enterprise_Server_for_NVIDIA_%VERSION%_%ARCH%:SLES-NVIDIA-%VERSION%
uri: http://openqa.suse.de/assets/repo/SLES-%VERSION%-%ARCH%-Build%BUILD%/
uri: http://openqa.suse.de/assets/repo/SLES-NVIDIA-%VERSION%-%ARCH%-Build%BUILD%
enabled: 'Yes'
filter: name
- name: SLES-NVIDIA-%VERSION%-Debug
alias: SUSE_Linux_Enterprise_Server_for_NVIDIA_%VERSION%_%ARCH%:SLES-NVIDIA-%VERSION%-Debug
uri: http://openqa.suse.de/assets/repo/SLES-%VERSION%-%ARCH%-Debug-Build%BUILD%/
uri: http://openqa.suse.de/assets/repo/SLES-NVIDIA-%VERSION%-%ARCH%-Build%BUILD%
enabled: 'No'
filter: name
- name: SLES-NVIDIA-%VERSION%-Source
alias: SUSE_Linux_Enterprise_Server_for_NVIDIA_%VERSION%_%ARCH%:SLES-NVIDIA-%VERSION%-Source
uri: http://openqa.suse.de/assets/repo/SLES-%VERSION%-%ARCH%-Source-Build%BUILD%/
uri: http://openqa.suse.de/assets/repo/SLES-NVIDIA-%VERSION%-%ARCH%-Build%BUILD%
enabled: 'No'
filter: name
selinux:
Expand Down
25 changes: 25 additions & 0 deletions tests/yam/validate/validate_kernel_version.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# SUSE's openQA tests
#
# Copyright 2026 SUSE LLC
# SPDX-License-Identifier: FSFAP

# Summary: Validate the kernel version of the installed system.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Validate the installed system has a NVIDIA-specific kernel.


# Summary: Validate the kernel version of the installed system.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

line6 and line8 are identical, do we really need that? thanks.

# Compare the output of "uname -r" with the kernel version from test data.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we don't use test data in the code. so we can rephrase it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

no need for any comment about specific implementation repeating the command.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

with the kernel version s/from test data/'nvidia64kb'/

# Maintainer: QE Installation and Migration (QE Iam) <none@suse.de>

use Mojo::Base 'consoletest';
use testapi;
use Test::Assert ':assert';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

use 'assert_matches' cause ':assert' will import all assert_* functions.


sub run {
select_console 'root-console';

my $kernel = script_output('uname -r');

assert_matches(qr/^.+-nvidia64kb$/, $kernel,
"Wrong kernel version '. Got '$kernel'");
Comment on lines +19 to +22

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

assert_matches(qr/^.+-nvidia64kb$/, script_output('uname -r'), "The installed system doesn't have a NVIDIA-specific kernel");

}

1;
Loading