]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/cephfs: lua to respect missing kernel in yaml 66092/head
authorKyr Shatskyy <kyrylo.shatskyy@clyso.com>
Thu, 30 Oct 2025 11:58:05 +0000 (12:58 +0100)
committerKyr Shatskyy <kyrylo.shatskyy@clyso.com>
Mon, 2 Feb 2026 12:47:45 +0000 (13:47 +0100)
When teuthology-suite is called with '-k none' option, which is valid,
there is no kernel record in job config created.

However at some test cases the lua premerge dies with exception:
  KeyError: 'kernel'
and when branch is not set for '-k none' and kernel client is
overridden:
  KeyError: 'branch'
so teuthology-suite quits unexpectedly without scheduling any jobs.

Fixes: https://tracker.ceph.com/issues/73676
Signed-off-by: Kyr Shatskyy <kyrylo.shatskyy@clyso.com>
qa/cephfs/begin/3-kernel.yaml
qa/cephfs/mount/kclient/overrides/distro/testing/k-testing.yaml

index e94a0d87dc8cefc5bced02541698282935c13c30..90fe1d1c457069f542f340d3f6219b4fca0b11a4 100644 (file)
@@ -2,22 +2,27 @@
 # all nodes (also, the kernel is "distro" when the --kernel option is not set).
 # We don't generally want to use a custom kernel for all tests, so unset it.
 # The k-testing.yaml will set it, if given, for only the client nodes.
+# When the --kernel option is "none" there is no "kernel" dictionary created
+# in the job base config and there is no need to unset anything.
 #
 # Allow overriding this by using a branch ending in "-all".
 
 teuthology:
   postmerge:
     - |
-      local branch = yaml.kernel.branch
-      if branch and not yaml.kernel.branch:find "-all$" then
-        log.debug("removing default kernel specification: %s", yaml.kernel)
-        py_attrgetter(yaml.kernel).pop('branch', nil)
-        py_attrgetter(yaml.kernel).pop('deb', nil)
-        py_attrgetter(yaml.kernel).pop('flavor', nil)
-        py_attrgetter(yaml.kernel).pop('kdb', nil)
-        py_attrgetter(yaml.kernel).pop('koji', nil)
-        py_attrgetter(yaml.kernel).pop('koji_task', nil)
-        py_attrgetter(yaml.kernel).pop('rpm', nil)
-        py_attrgetter(yaml.kernel).pop('sha1', nil)
-        py_attrgetter(yaml.kernel).pop('tag', nil)
+      local kernel = py_attrgetter(yaml).get('kernel')
+      if kernel ~= nil then
+        local branch = py_attrgetter(kernel).get('branch')
+        if branch and not kernel.branch:find "-all$" then
+          log.debug("removing default kernel specification: %s", kernel)
+          py_attrgetter(kernel).pop('branch', nil)
+          py_attrgetter(kernel).pop('deb', nil)
+          py_attrgetter(kernel).pop('flavor', nil)
+          py_attrgetter(kernel).pop('kdb', nil)
+          py_attrgetter(kernel).pop('koji', nil)
+          py_attrgetter(kernel).pop('koji_task', nil)
+          py_attrgetter(kernel).pop('rpm', nil)
+          py_attrgetter(kernel).pop('sha1', nil)
+          py_attrgetter(kernel).pop('tag', nil)
+        end
       end
index 048cd5ce8b9049f3433f95699f5af3450a7aa6a1..8691a1bff6586a5412628a20a449f33bb269a16d 100644 (file)
@@ -2,7 +2,7 @@ teuthology:
   premerge: |
     log.debug("base kernel %s", base_config.kernel)
     local kernel = base_config.kernel
-    if kernel.branch ~= "distro" then
+    if kernel ~= nil and kernel.branch ~= "distro" then
       log.debug("overriding testing kernel with %s", kernel)
       yaml_fragment.kernel.client = kernel
     end