Merge ~clairlin/plainbox-provider-checkbox:add_BT_record_case into plainbox-provider-checkbox:master

Proposed by Clair Lin
Status: Rejected
Rejected by: Pierre Equoy
Proposed branch: ~clairlin/plainbox-provider-checkbox:add_BT_record_case
Merge into: plainbox-provider-checkbox:master
Diff against target: 77 lines (+41/-1)
2 files modified
units/bluetooth/jobs.pxu (+38/-1)
units/bluetooth/test-plan.pxu (+3/-0)
Reviewer Review Type Date Requested Status
StanleyHuang Approve
Pierre Equoy Needs Fixing
PeiYao Chang Approve
Scott Hu Needs Fixing
YANG, ZHI-HAO Approve
Weichen Wu Pending
Gabriel Zhi Chen Pending
Yujin.Wu Pending
Clair Lin Pending
Chen Wei Pending
Checkbox Developers Pending
Review via email: mp+429954@code.launchpad.net

Description of the change

Add Bluetooth microphone recording test which is covered with HSP/HFP profile.

The Bluetooth test case only has a2dp profile test for now, we need to make sure the input function on bluetooth headset device and this also covers the HSP/HFP profile test.

22.04 pactl list cards: https://pastebin.canonical.com/p/pDGDY6s8XW/
20.04 pactl list cards: https://pastebin.canonical.com/p/3fYwD94nVJ/

To post a comment you must log in.
Revision history for this message
YANG, ZHI-HAO (isaacyang) wrote :

Can test pass, need to use the good Bluetooth earphone, and one of my Bluetooth earphone, can't switch the correct HFP profile (either manual switch on GUI).

review: Approve
Revision history for this message
Scott Hu (huntu207) :
review: Needs Fixing
Revision history for this message
StanleyHuang (stanley31) wrote :

I have some inline comments for this MR.
Are we going to perform tests if one of audio variable is not available?

review: Needs Information
Revision history for this message
Clair Lin (clairlin) wrote :

> I have some inline comments for this MR.
> Are we going to perform tests if one of audio variable is not available?

Add the bt_source variable to check the condition

Revision history for this message
PeiYao Chang (baconyao) wrote :

LGTM +1

review: Approve
Revision history for this message
Pierre Equoy (pieq) wrote :

Function tested OK on 22.04.

I added a few inline comments below. It would be good to address them before landing this.

review: Needs Fixing
Revision history for this message
Pierre Equoy (pieq) wrote :

Thanks for the changes!

There is one minor thing to be fixed (see below, inline).

Once this is done, you can approve it!

review: Needs Fixing
Revision history for this message
Clair Lin (clairlin) wrote :

10/11 remove '_description:'

Revision history for this message
StanleyHuang (stanley31) wrote :

LGTM

review: Approve
Revision history for this message
Pierre Equoy (pieq) wrote :

This PR was moved to Github:

https://github.com/canonical/checkbox/pull/15

I'll close this one on Launchpad and people can add comments on Github instead.

Unmerged commits

3e5ec3f... by Clair Lin

Add Bluetooth microphone recording test which is covered with HSP/HFP profile.

The Bluetooth test case only has a2dp profile test for now,
we need to make sure the input function on bluetooth headset device
and this also covers the HSP/HFP profile test.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/units/bluetooth/jobs.pxu b/units/bluetooth/jobs.pxu
2index d001dba..daeede6 100644
3--- a/units/bluetooth/jobs.pxu
4+++ b/units/bluetooth/jobs.pxu
5@@ -415,4 +415,41 @@ command:
6 flags: also-after-suspend
7 _summary: Bluetooth OBEX send
8 _description:
9- This is an automated Bluetooth file transfer test. It sends an image to the device specified by the BTDEVADDR environment variable
10\ No newline at end of file
11+ This is an automated Bluetooth file transfer test. It sends an image to the device specified by the BTDEVADDR environment variable
12+
13+plugin: user-interact-verify
14+category_id: com.canonical.plainbox::bluetooth
15+id: bluetooth/audio_record_playback
16+depends: bluetooth/detect-output
17+estimated_duration: 120.0
18+flags: also-after-suspend
19+command:
20+ audio_settings.py store --file="$PLAINBOX_SESSION_SHARE"/pulseaudio_settings
21+ idx=$(pactl list cards short | awk '/bluez/{print $1}')
22+ if [ "$idx" = "" ]; then
23+ echo "Please enable and pair the bluetooth headset device"
24+ exit 1
25+ fi
26+ bt_sink=$(pactl list sinks short | awk '/bluez/{print $2}')
27+ bt_profile=$(pactl list cards | awk -v RS='' '/bluez/' | awk -F':' '{print $1}' | awk '/head_unit/{print $1}')
28+ pactl set-card-profile "$idx" "$bt_profile"
29+ pactl set-default-sink "$bt_sink"
30+ bt_source=$(pactl list sources short | awk '/bluez_source/{print $2}')
31+ if [ "$bt_source" = "" ]; then
32+ echo "Please check your bluetooth support HSP/HFP profile"
33+ exit 1
34+ fi
35+ pactl set-default-source "$bt_source"
36+ alsa_record_playback.sh
37+ EXIT_CODE=$?
38+ audio_settings.py restore --file="$PLAINBOX_SESSION_SHARE"/pulseaudio_settings
39+ exit $EXIT_CODE
40+_purpose:
41+ This test will check the Headset Head Unit (HSP/HFP) capability of your Bluetooth device,
42+ to check if you can recording sounds
43+_steps:
44+ 1. Enable and pair the bluetooth headset
45+ 2. Click "Test", then speak into your Bluetooth microphone.
46+ 3. After a few seconds, your speech will be played back to you.
47+_verification:
48+ Did you hear your speech played back?
49\ No newline at end of file
50diff --git a/units/bluetooth/test-plan.pxu b/units/bluetooth/test-plan.pxu
51index b0301da..7953773 100644
52--- a/units/bluetooth/test-plan.pxu
53+++ b/units/bluetooth/test-plan.pxu
54@@ -17,6 +17,7 @@ include:
55 bluetooth/audio-a2dp certification-status=blocker
56 bluetooth4/HOGP-mouse certification-status=blocker
57 bluetooth4/HOGP-keyboard certification-status=blocker
58+ bluetooth/audio_record_playback certification-status=blocker
59
60 id: bluetooth-cert-automated
61 unit: test plan
62@@ -37,6 +38,7 @@ include:
63 bluetooth4/HOGP-mouse certification-status=blocker
64 bluetooth4/HOGP-keyboard certification-status=blocker
65 bluetooth/audio-a2dp certification-status=blocker
66+ bluetooth/audio_record_playback certification-status=blocker
67
68 id: bluetooth-full
69 unit: test plan
70@@ -173,6 +175,7 @@ include:
71 after-suspend-bluetooth/audio-a2dp certification-status=blocker
72 after-suspend-bluetooth4/HOGP-mouse certification-status=blocker
73 after-suspend-bluetooth4/HOGP-keyboard certification-status=blocker
74+ after-suspend-bluetooth/audio_record_playback certification-status=blocker
75
76 id: after-suspend-bluetooth-cert-automated
77 unit: test plan

Subscribers

People subscribed via source and target branches