Skip to content

Fix device.interface in template-filter (BugFix)#2071

Merged
Hook25 merged 2 commits intomainfrom
fix-misuse-template-filter
Aug 29, 2025
Merged

Fix device.interface in template-filter (BugFix)#2071
Hook25 merged 2 commits intomainfrom
fix-misuse-template-filter

Conversation

@rickwu666666
Copy link
Copy Markdown
Contributor

@rickwu666666 rickwu666666 commented Aug 8, 2025

Description

We are facing issue of generating template job if interface of netwrok device is UNKNOWN. And root cause is the job id: info/sriov-check_{interface} misuse the template-filter of device.interface != " ", since device.interface will be UNKNOWN instead of empty string

Undeclared exception DependencyDuplicateError raised from use_job_result
Traceback (most recent call last):
  File "/snap/checkbox-baytown/22/checkbox-runtime/bin/checkbox-cli", line 8, in <module>
    sys.exit(main())
  File "/snap/checkbox-baytown/22/checkbox-runtime/lib/python3.10/site-packages/checkbox_ng/launcher/checkbox_cli.py", line 183, in main
    return subcmd.invoked(ctx)
  File "/snap/checkbox-baytown/22/checkbox-runtime/lib/python3.10/site-packages/checkbox_ng/launcher/subcommands.py", line 1156, in invoked
    self._run_jobs(self.sa.get_dynamic_todo_list())
  File "/snap/checkbox-baytown/22/checkbox-runtime/lib/python3.10/site-packages/checkbox_ng/launcher/stages.py", line 394, in _run_jobs
    self.sa.use_job_result(job_id, result)
  File "/snap/checkbox-baytown/22/checkbox-runtime/lib/python3.10/site-packages/plainbox/impl/decorators.py", line 153, in wrapper
    raise exc
  File "/snap/checkbox-baytown/22/checkbox-runtime/lib/python3.10/site-packages/plainbox/impl/decorators.py", line 145, in wrapper
    return func(*args, **kwargs)
  File "/snap/checkbox-baytown/22/checkbox-runtime/lib/python3.10/site-packages/plainbox/impl/session/assistant.py", line 1638, in use_job_result
    self._context.state.update_job_result(job, result)
  File "/snap/checkbox-baytown/22/checkbox-runtime/lib/python3.10/site-packages/plainbox/impl/session/state.py", line 1007, in update_job_result
    job.controller.observe_result(
  File "/snap/checkbox-baytown/22/checkbox-runtime/lib/python3.10/site-packages/plainbox/impl/ctrl.py", line 408, in observe_result
    self._process_resource_result(
  File "/snap/checkbox-baytown/22/checkbox-runtime/lib/python3.10/site-packages/plainbox/impl/ctrl.py", line 421, in _process_resource_result
    self._instantiate_templates(
  File "/snap/checkbox-baytown/22/checkbox-runtime/lib/python3.10/site-packages/plainbox/impl/ctrl.py", line 543, in _instantiate_templates
    session_state.add_unit(new_unit, via=job, recompute=False)
  File "/snap/checkbox-baytown/22/checkbox-runtime/lib/python3.10/site-packages/plainbox/impl/session/state.py", line 1084, in add_unit
    return self._add_job_unit(new_unit, recompute, via)
  File "/snap/checkbox-baytown/22/checkbox-runtime/lib/python3.10/site-packages/plainbox/impl/session/state.py", line 1111, in _add_job_unit
    raise DependencyDuplicateError(existing_job, new_job)
plainbox.impl.depmgr.DependencyDuplicateError: duplicate job id: 'com.canonical.certification::info/sriov-check_UNKNOWN'

For my DUT, I got some like follows from udevadm parser. And that will case the job-id duplicated.

root@ubuntu:/home/ceqa# ./udev_resource.py -l NETWORK
NETWORK (10):
 - Freescale Semiconductor Inc UNKNOWN [1957:e100]
 - Freescale Semiconductor Inc pcie [1957:e100]
 - Freescale Semiconductor Inc pcie [1957:e100]
 - Freescale Semiconductor Inc pcie [0000:0000]
 - Freescale Semiconductor Inc pcie [0000:0000]
 - Freescale Semiconductor Inc pcie [0000:0000]
 - Freescale Semiconductor Inc pcie [1957:eef0]
 - Freescale Semiconductor Inc UNKNOWN [1957:e100]
 - Marvell Technology Group Ltd. UNKNOWN [1b4b:2b43]
 - Marvell Technology Group Ltd. UNKNOWN [1b4b:2b44]

Resolved issues

Documentation

Tests

From the sideload result can see the template job can be generated.

Finalizing session that hasn't been submitted anywhere: checkbox-run-2025-08-08T07.56.51
==================================[ Results ]===================================
 ☑ : Collect information about hardware devices (udev)
 ☑ : Hardware Manifest
 ☐ : Check SR-IOV capability for network interface enp0s0f1
 ☐ : Check SR-IOV capability for network interface enp0s0f2
 ☐ : Check SR-IOV capability for network interface swp0
 ☐ : Check SR-IOV capability for network interface swp1
 ☐ : Check SR-IOV capability for network interface swp2
 ☐ : Check SR-IOV capability for network interface swp3

Since device.interface will be UNKNOWN instead of empty string
@codecov
Copy link
Copy Markdown

codecov bot commented Aug 8, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 51.87%. Comparing base (f89385d) to head (d3b45c1).
⚠️ Report is 82 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2071      +/-   ##
==========================================
- Coverage   52.22%   51.87%   -0.36%     
==========================================
  Files         391      388       -3     
  Lines       41950    41500     -450     
  Branches     7766     7715      -51     
==========================================
- Hits        21908    21527     -381     
+ Misses      19267    19205      -62     
+ Partials      775      768       -7     
Flag Coverage Δ
provider-base 28.04% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Hook25 Hook25 self-assigned this Aug 27, 2025
@Hook25
Copy link
Copy Markdown
Collaborator

Hook25 commented Aug 27, 2025

I'm encoutering this same issue and this indeed solves it. Why wasn't this marked as critical? either way, approved

@Hook25 Hook25 merged commit 98beb04 into main Aug 29, 2025
27 of 28 checks passed
@Hook25 Hook25 deleted the fix-misuse-template-filter branch August 29, 2025 07:48
stanley31huang pushed a commit that referenced this pull request Oct 3, 2025
Fix device.interface in template-filter

Since device.interface will be UNKNOWN instead of empty string

Co-authored-by: Massimiliano <massimiliano.girardi@canonical.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants