Skip to content

Commit f6ff3b4

Browse files
committed
- Add has_sriov manifest entry to enable SR-IOV testing
- Only SR-IOV enabled interfaces will run the functional tests - Add info/sriov-check_{interface} template test that check if SR-IOV is enabled for an interface - Update SR-IOV LXD and LXD_VM tests to depend on interface-specific SR-IOV capability check
1 parent 5558910 commit f6ff3b4

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed

providers/base/units/info/jobs.pxu

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -583,3 +583,21 @@ command:
583583
mokutil --sb-state || true
584584
_summary: Check secure boot state
585585
_purpose: Output whether secure boot is enabled or disabled
586+
587+
unit: template
588+
template-resource: device
589+
template-filter: device.category == 'NETWORK' and device.interface != ''
590+
template-id: info/sriov-check__interface
591+
plugin: attachment
592+
category_id: com.canonical.plainbox::info
593+
id: info/sriov-check_{interface}
594+
estimated_duration: 0.1
595+
imports: from com.canonical.plainbox import manifest
596+
requires:
597+
manifest.has_sriov == 'True'
598+
command:
599+
interface="{interface}"
600+
sriov_file="/sys/class/net/$interface/device/sriov_numvfs"
601+
[ -f "$sriov_file" ]
602+
_summary: Check SR-IOV capability for network interface {interface}
603+
_purpose: Check if network interface {interface} is SR-IOV enabled by verifying sriov_numvfs file exists

providers/base/units/miscellanea/manifest.pxu

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,8 @@ unit: manifest entry
22
id: has_secure_boot
33
_name: Secure Boot support
44
value-type: bool
5+
6+
unit: manifest entry
7+
id: has_sriov
8+
_name: SR-IOV support
9+
value-type: bool

providers/base/units/networking/sriov-jobs.pxu

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,12 @@ environ: LXD_TEMPLATE LXD_ROOTFS
99
flags: also-after-suspend
1010
_summary: SRIOV LXD container test for network device {interface}
1111
estimated_duration: 120.0
12+
imports: from com.canonical.plainbox import manifest
1213
requires:
1314
executable.name == 'lxc'
1415
package.name == 'lxd' or package.name == 'lxd-installer' or snap.name == 'lxd'
16+
manifest.has_sriov == 'True'
17+
depends: info/sriov-check_{interface}
1518
command:
1619
sriov.py --debug --interface {interface} lxd
1720
user: root
@@ -31,9 +34,12 @@ environ: LXD_TEMPLATE KVM_IMAGE
3134
flags: also-after-suspend
3235
_summary: SRIOV LXD VM test for network device {interface}
3336
estimated_duration: 180.0
37+
imports: from com.canonical.plainbox import manifest
3438
requires:
3539
executable.name == 'lxc'
3640
package.name == 'lxd' or package.name == 'lxd-installer' or snap.name == 'lxd'
41+
manifest.has_sriov == 'True'
42+
depends: info/sriov-check_{interface}
3743
command:
3844
sriov.py --debug --interface {interface} lxdvm
3945
user: root

0 commit comments

Comments
 (0)