From 62490ce3864f226aa53341cae8e1ea21258a5677 Mon Sep 17 00:00:00 2001 From: Hector Cao <122458375+hector-cao@users.noreply.github.com> Date: Tue, 10 Dec 2024 00:53:45 +0100 Subject: [PATCH 1/3] proviers/base: add requires for bluetooth4/beacon_eddystone_url_* In order to pass, the test bluetooth4/beacon_eddystone_url_* needs: - bluez package/snap (+ adequate connections for ubuntu core) --- providers/base/units/bluetooth/jobs.pxu | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/providers/base/units/bluetooth/jobs.pxu b/providers/base/units/bluetooth/jobs.pxu index 071c686292..abad1c6df2 100644 --- a/providers/base/units/bluetooth/jobs.pxu +++ b/providers/base/units/bluetooth/jobs.pxu @@ -287,6 +287,11 @@ user: root flags: also-after-suspend category_id: com.canonical.plainbox::bluetooth estimated_duration: 10 +requires: + package.name == 'bluez' or snap.name == 'bluez' + {%- if __on_ubuntucore__ %} + connections.slot == 'bluez:service' and connections.plug == '{{ __system_env__["SNAP_NAME"] }}:bluez' + {% endif -%} unit: template template-resource: bluez-internal-rfcomm-tests From 4c46fca9535e6efd1f535de05a1eb36110d2f857 Mon Sep 17 00:00:00 2001 From: Hector Cao <122458375+hector-cao@users.noreply.github.com> Date: Tue, 10 Dec 2024 02:20:47 +0100 Subject: [PATCH 2/3] switch the test to use jinja template backend --- providers/base/units/bluetooth/jobs.pxu | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/providers/base/units/bluetooth/jobs.pxu b/providers/base/units/bluetooth/jobs.pxu index abad1c6df2..5f71bfc0de 100644 --- a/providers/base/units/bluetooth/jobs.pxu +++ b/providers/base/units/bluetooth/jobs.pxu @@ -276,22 +276,23 @@ requires: unit: template template-resource: device template-filter: device.category == 'BLUETOOTH' +template-engine: jinja2 template-unit: job -id: bluetooth4/beacon_eddystone_url_{interface} +id: bluetooth4/beacon_eddystone_url_{{ interface }} template-id: bluetooth4/beacon_eddystone_url_interface -_summary: Test system can get beacon EddyStone URL advertisements on the {interface} adapter +_summary: Test system can get beacon EddyStone URL advertisements on the {{ interface }} adapter command: - checkbox-support-eddystone_scanner -D {interface} + checkbox-support-eddystone_scanner -D {{ interface }} plugin: shell user: root flags: also-after-suspend category_id: com.canonical.plainbox::bluetooth estimated_duration: 10 requires: - package.name == 'bluez' or snap.name == 'bluez' - {%- if __on_ubuntucore__ %} - connections.slot == 'bluez:service' and connections.plug == '{{ __system_env__["SNAP_NAME"] }}:bluez' - {% endif -%} + package.name == 'bluez' or snap.name == 'bluez' + {%- if __on_ubuntucore__ %} + connections.slot == 'bluez:service' and connections.plug == '{{ __system_env__["SNAP_NAME"] }}:bluez' + {% endif -%} unit: template template-resource: bluez-internal-rfcomm-tests From 9694748ff96d913ad1d8093efd41486b520a93d9 Mon Sep 17 00:00:00 2001 From: Hector Cao <122458375+hector-cao@users.noreply.github.com> Date: Thu, 9 Jan 2025 10:40:08 +0100 Subject: [PATCH 3/3] add fail-on-resource flag to make the test fail instead of skipped if bluez is not installed --- providers/base/units/bluetooth/jobs.pxu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/providers/base/units/bluetooth/jobs.pxu b/providers/base/units/bluetooth/jobs.pxu index 5f71bfc0de..0dab83ab21 100644 --- a/providers/base/units/bluetooth/jobs.pxu +++ b/providers/base/units/bluetooth/jobs.pxu @@ -285,7 +285,7 @@ command: checkbox-support-eddystone_scanner -D {{ interface }} plugin: shell user: root -flags: also-after-suspend +flags: also-after-suspend fail-on-resource category_id: com.canonical.plainbox::bluetooth estimated_duration: 10 requires: