Skip to content

Commit d493b1f

Browse files
Revert "Add test logic to Matter Casting Automation test script for commissioner-generated-passcode flow. (project-chip#34079)"
This reverts commit 176896a. "Test TV Casting Example / Linux Test" has been failing in master and all PRs since this landed. See https://github.com/project-chip/connectedhomeip/actions/workflows/examples-linux-tv-casting-app.yaml
1 parent 1919112 commit d493b1f

File tree

3 files changed

+13
-147
lines changed

3 files changed

+13
-147
lines changed

.github/workflows/examples-linux-tv-casting-app.yaml

+1-11
Original file line numberDiff line numberDiff line change
@@ -63,22 +63,12 @@ jobs:
6363
./scripts/run_in_build_env.sh \
6464
"scripts/examples/gn_build_example.sh examples/tv-casting-app/linux/ out/tv-casting-app chip_casting_simplified=true"
6565
66-
- name:
67-
Test casting from Linux tv-casting-app to Linux tv-app -
68-
Commissionee Generated Passcode
66+
- name: Test casting from Linux tv-casting-app to Linux tv-app
6967
run: |
7068
./scripts/run_in_build_env.sh \
7169
"python3 ./scripts/tests/run_tv_casting_test.py"
7270
timeout-minutes: 2 # Comment this out to debug if GitHub Action times out.
7371

74-
- name:
75-
Test casting from Linux tv-casting-app to Linux tv-app -
76-
Commissioner Generated Passcode
77-
run: |
78-
./scripts/run_in_build_env.sh \
79-
"python3 ./scripts/tests/run_tv_casting_test.py --commissioner-generated-passcode=True"
80-
timeout-minutes: 2 # Comment this out to debug if GitHub Action times out.
81-
8272
- name: Uploading Size Reports
8373
uses: ./.github/actions/upload-size-reports
8474
if: ${{ !env.ACT }}

scripts/tests/linux/tv_casting_test_sequences.py

+5-113
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,9 @@
6767

6868
# Values that identify the Linux tv-app and are noted in the 'Device Configuration' in the Linux tv-app output
6969
# as well as under the 'Discovered Commissioner' details in the Linux tv-casting-app output.
70-
VENDOR_ID = 0xFFF1 # 0xFFF1 = 65521; Spec 7.20.2.1 MEI code: test vendor IDs are 0xFFF1 to 0xFFF4
71-
PRODUCT_ID = 0x8001 # 0x8001 = 32769 = Test product id
72-
DEVICE_TYPE_CASTING_VIDEO_PLAYER = 0x23 # 0x23 = 35 = Device type library 10.3: Casting Video Player
73-
74-
# 0x457 = 1111 = Target Content Application Vendor ID for the commissioner generated passcode flow
75-
COMMISSIONER_GENERATED_PASSCODE_VENDOR_ID = 0x457
76-
COMMISSIONER_GENERATED_PASSCODE = '0x00BC_614E' # 0x00BC_614E = 12345678 = Default commissioner generated passcode
70+
VENDOR_ID = 0xFFF1 # Spec 7.20.2.1 MEI code: test vendor IDs are 0xFFF1 to 0xFFF4
71+
PRODUCT_ID = 0x8001 # Test product id
72+
DEVICE_TYPE_CASTING_VIDEO_PLAYER = 0x23 # Device type library 10.3: Casting Video Player
7773

7874
# Value to verify the subscription state against in the Linux tv-casting-app output.
7975
ATTRIBUTE_CURRENT_PLAYBACK_STATE = 0x0000_0000 # Application Cluster Spec 6.10.6 Attribute ID: Current State of Playback
@@ -98,7 +94,7 @@
9894
Step(app=App.TV_CASTING_APP, output_msg=['Discovered CastingPlayer #0', f'Product ID: {PRODUCT_ID}', f'Vendor ID: {VENDOR_ID}',
9995
f'Device Type: {DEVICE_TYPE_CASTING_VIDEO_PLAYER}', 'Supports Commissioner Generated Passcode: true']),
10096

101-
# Send `cast request {valid_discovered_castingplayer_number}\n` command to the tv-casting-app subprocess.
97+
# Send `cast request {valid_discovered_commissioner_number}\n` command to the tv-casting-app subprocess.
10298
Step(app=App.TV_CASTING_APP, input_cmd='cast request 0\n'),
10399

104100
# Validate that the tv-casting-app begins the commissioning process.
@@ -116,7 +112,7 @@
116112
# Validate that we received the instructions on the tv-app output for sending the `controller ux ok` command.
117113
Step(app=App.TV_APP, output_msg=['Via Shell Enter: controller ux ok|cancel']),
118114

119-
# Send `controller ux ok\n` command to the tv-app subprocess.
115+
# Send `controller ux ok` command to the tv-app subprocess.
120116
Step(app=App.TV_APP, input_cmd='controller ux ok\n'),
121117

122118
# Validate that pairing succeeded between the tv-casting-app and the tv-app.
@@ -144,110 +140,6 @@
144140
# Signal to stop the tv-casting-app as we finished validation.
145141
Step(app=App.TV_CASTING_APP, input_cmd=STOP_APP),
146142

147-
# Signal to stop the tv-app as we finished validation.
148-
Step(app=App.TV_APP, input_cmd=STOP_APP)
149-
]
150-
),
151-
Sequence(
152-
name='commissioner_generated_passcode_test',
153-
steps=[
154-
# Signal to start the tv-app.
155-
Step(app=App.TV_APP, input_cmd=START_APP),
156-
157-
# Validate that the tv-app is up and running.
158-
Step(app=App.TV_APP, timeout_sec=APP_MAX_START_WAIT_SEC, output_msg=['Started commissioner']),
159-
160-
# Signal to start the tv-casting-app.
161-
Step(app=App.TV_CASTING_APP, input_cmd=START_APP),
162-
163-
# Validate that the server is properly initialized in the tv-casting-app output.
164-
Step(app=App.TV_CASTING_APP, timeout_sec=APP_MAX_START_WAIT_SEC, output_msg=['Server initialization complete']),
165-
166-
# Validate that there is a valid discovered casting player with {PRODUCT_ID}, {VENDOR_ID}, {DEVICE_TYPE_CASTING_VIDEO_PLAYER}, and the
167-
# `Commissioner Generated Passcode` flag is set to true in the tv-casting-app output.
168-
Step(app=App.TV_CASTING_APP, output_msg=['Discovered CastingPlayer #0', f'Product ID: {PRODUCT_ID}', f'Vendor ID: {VENDOR_ID}',
169-
f'Device Type: {DEVICE_TYPE_CASTING_VIDEO_PLAYER}', 'Supports Commissioner Generated Passcode: true']),
170-
171-
# Send `cast request {valid_discovered_castingplayer_number} commissioner-generated-passcode\n` command to the tv-casting-app subprocess.
172-
Step(app=App.TV_CASTING_APP, input_cmd='cast request 0 commissioner-generated-passcode\n'),
173-
174-
# Validate that the tv-casting-app begins the commissioning process.
175-
Step(app=App.TV_CASTING_APP, output_msg=[
176-
'CastingPlayer::VerifyOrEstablishConnection() calling OpenBasicCommissioningWindow()']),
177-
178-
# Validate that the `IdentificationDeclaration` message sent from the tv-casting-app to the tv-app will contain the following entries:
179-
# mCommissionerPasscode: true -> This flag instructs the commissioner to use the commissioner-generated-passcode flow for commissioning.
180-
# mCommissionerPasscodeReady: false -> This flag indicates that the commissionee has not obtained the commissioner passcode from the user and
181-
# thus is not ready for commissioning.
182-
# Vendor ID: {COMMISSIONER_GENERATED_PASSCODE_VENDOR_ID} -> The initial VENDOR_ID of the casting player will be overridden to {COMMISSIONER_GENERATED_PASSCODE_VENDOR_ID}.
183-
# Otherwise we will enter the commissionee-generated-passcode flow.
184-
Step(app=App.TV_CASTING_APP, output_msg=['IdentificationDeclarationOptions::LogDetail()', 'IdentificationDeclarationOptions::mCommissionerPasscode: true',
185-
'IdentificationDeclarationOptions::mCommissionerPasscodeReady: false', 'IdentificationDeclarationOptions::TargetAppInfos list:', f'TargetAppInfo 1, Vendor ID: {COMMISSIONER_GENERATED_PASSCODE_VENDOR_ID}']),
186-
187-
# Validate that we received the cast request from the tv-casting-app on the tv-app output.
188-
Step(app=App.TV_APP,
189-
output_msg=['------PROMPT USER: Test TV casting app is requesting permission to cast to this TV, approve?']),
190-
191-
# Validate that we received the instructions on the tv-app output for sending the `controller ux ok` command.
192-
Step(app=App.TV_APP, output_msg=['Via Shell Enter: controller ux ok|cancel']),
193-
194-
# Send `controller ux ok` command to the tv-app subprocess.
195-
Step(app=App.TV_APP, input_cmd='controller ux ok\n'),
196-
197-
# Validate that the tv-app sent a message to the tv-casting-app indicating that the tv-app is now displaying the passcode to the user.
198-
Step(app=App.TV_APP, output_msg=['Commissioner Declaration Start',
199-
'commissioner passcode: true', 'Commissioner Declaration End']),
200-
201-
# Validate that we received the cast request with the casting passcode on the tv-app output.
202-
Step(app=App.TV_APP, output_msg=[
203-
f'------PROMPT USER: Test TV casting app is requesting permission to cast to this TV. Casting passcode: [{COMMISSIONER_GENERATED_PASSCODE}].']),
204-
205-
# Validate that the tv-casting-app received the message from the tv-app indicating that the tv-app is now displaying the passcode to the user.
206-
Step(app=App.TV_CASTING_APP, output_msg=['Commissioner Declaration Start',
207-
'commissioner passcode: true', 'Commissioner Declaration End']),
208-
209-
# Validate that the user is prompted to input passcode from the tv-app on the tv-casting-app output.
210-
Step(app=App.TV_CASTING_APP, output_msg=['Awaiting user input', 'Input the Commissioner-Generated passcode displayed on the CastingPlayer UX.',
211-
f'cast setcommissionerpasscode {int(COMMISSIONER_GENERATED_PASSCODE, 16)}', 'Awaiting user input']),
212-
213-
# Send `cast setcommissionerpasscode {COMMISSIONER_GENERATED_PASSCODE}\n` to the tv-casting-app subprocess.
214-
Step(app=App.TV_CASTING_APP, input_cmd=f'cast setcommissionerpasscode {int(COMMISSIONER_GENERATED_PASSCODE, 16)}\n'),
215-
216-
# Validate the commissioner passcode that the user entered on the tv-casting-app output.
217-
Step(app=App.TV_CASTING_APP, output_msg=[
218-
f'CommandHandler() setcommissionerpasscode user entered passcode: {int(COMMISSIONER_GENERATED_PASSCODE, 16)}']),
219-
220-
# Validate that the `IdentificationDeclaration` message sent from the tv-casting-app to the tv-app will contain the following entries:
221-
# mCommissionerPasscode: true -> This flag instructs the commissioner to use the commissioner-generated-passcode flow for commissioning.
222-
# mCommissionerPasscodeReady: true -> This flag indicates that the commissionee has obtained the commissioner passcode from the user and
223-
# thus is ready for commissioning.
224-
# Vendor ID: {COMMISSIONER_GENERATED_PASSCODE_VENDOR_ID} -> The initial VENDOR_ID of the casting player will be overridden to {COMMISSIONER_GENERATED_PASSCODE_VENDOR_ID}.
225-
# Otherwise we will enter the commissionee-generated-passcode flow.
226-
Step(app=App.TV_CASTING_APP, output_msg=['IdentificationDeclarationOptions::LogDetail()', 'IdentificationDeclarationOptions::mCommissionerPasscode: true',
227-
'IdentificationDeclarationOptions::mCommissionerPasscodeReady: true', 'IdentificationDeclarationOptions::TargetAppInfos list:', f'TargetAppInfo 1, Vendor ID: {COMMISSIONER_GENERATED_PASSCODE_VENDOR_ID}']),
228-
229-
# Validate that pairing succeeded between the tv-casting-app and the tv-app.
230-
Step(app=App.TV_APP, output_msg=['Secure Pairing Success']),
231-
232-
# Validate that the connection succeeded in the tv-casting-app output.
233-
Step(app=App.TV_CASTING_APP, output_msg=['Successfully connected to CastingPlayer']),
234-
235-
# Validate that commissioning succeeded in the tv-app output.
236-
Step(app=App.TV_APP, output_msg=['------PROMPT USER: commissioning success']),
237-
238-
# Validate that we are able to subscribe to the media playback cluster by reading the CurrentState value and that it matches {ATTRIBUTE_CURRENT_PLAYBACK_STATE}.
239-
Step(app=App.TV_CASTING_APP, output_msg=[f'Read CurrentState value: {ATTRIBUTE_CURRENT_PLAYBACK_STATE}']),
240-
241-
# Validate the LaunchURL in the tv-app output.
242-
Step(app=App.TV_APP,
243-
output_msg=['ContentLauncherManager::HandleLaunchUrl TEST CASE ContentURL=https://www.test.com/videoid DisplayString=Test video']),
244-
245-
# Validate the LaunchURL in the tv-casting-app output.
246-
Step(app=App.TV_CASTING_APP, output_msg=['LaunchURL Success with response.data: exampleData']),
247-
248-
# Signal to stop the tv-casting-app as we finished validation.
249-
Step(app=App.TV_CASTING_APP, input_cmd=STOP_APP),
250-
251143
# Signal to stop the tv-app as we finished validation.
252144
Step(app=App.TV_APP, input_cmd=STOP_APP)
253145
]

scripts/tests/run_tv_casting_test.py

+7-23
Original file line numberDiff line numberDiff line change
@@ -270,26 +270,12 @@ def run_test_sequence_steps(
270270
@click.command()
271271
@click.option('--tv-app-rel-path', type=str, default='out/tv-app/chip-tv-app', help='Path to the Linux tv-app executable.')
272272
@click.option('--tv-casting-app-rel-path', type=str, default='out/tv-casting-app/chip-tv-casting-app', help='Path to the Linux tv-casting-app executable.')
273-
@click.option('--commissioner-generated-passcode', type=bool, default=False, help='Enable the commissioner generated passcode test flow.')
274-
def test_casting_fn(tv_app_rel_path, tv_casting_app_rel_path, commissioner_generated_passcode):
273+
def test_casting_fn(tv_app_rel_path, tv_casting_app_rel_path):
275274
"""Test if the casting experience between the Linux tv-casting-app and the Linux tv-app continues to work.
276275
277-
By default, it uses the provided executable paths and the commissionee generated passcode flow as the test sequence.
278-
279-
Example usages:
280-
1. Use default paths and test sequence:
281-
python3 run_tv_casting_test.py
282-
283-
2. Use custom executable paths and default test sequence:
284-
python3 run_tv_casting_test.py --tv-app-rel-path=path/to/tv-app --tv-casting-app-rel-path=path/to/tv-casting-app
285-
286-
3. Use default paths and a test sequence that is not the default test sequence (replace `test-sequence-name` with the actual name of the test sequence):
287-
python3 run_tv_casting_test.py --test-sequence-name=True
288-
289-
4. Use custom executable paths and a test sequence that is not the default test sequence (replace `test-sequence-name` with the actual name of the test sequence):
290-
python3 run_tv_casting_test.py --tv-app-rel-path=path/to/tv-app --tv-casting-app-rel-path=path/to/tv-casting-app --test-sequence-name=True
291-
292-
Note: In order to enable a new test sequence, we also need to define a @click.option() entry for the test sequence.
276+
Default paths for the executables are provided but can be overridden via command line arguments.
277+
For example: python3 run_tv_casting_test.py --tv-app-rel-path=path/to/tv-app
278+
--tv-casting-app-rel-path=path/to/tv-casting-app
293279
"""
294280

295281
# Store the log files to a temporary directory.
@@ -302,17 +288,15 @@ def test_casting_fn(tv_app_rel_path, tv_casting_app_rel_path, commissioner_gener
302288
# Get all the test sequences.
303289
test_sequences = Sequence.get_test_sequences()
304290

305-
# Get the test sequence that we are interested in validating.
306-
test_sequence_name = 'commissionee_generated_passcode_test'
307-
if commissioner_generated_passcode:
308-
test_sequence_name = 'commissioner_generated_passcode_test'
309-
test_sequence = Sequence.get_test_sequence_by_name(test_sequences, test_sequence_name)
291+
# Get the test sequence of interest.
292+
test_sequence = Sequence.get_test_sequence_by_name(test_sequences, 'commissionee_generated_passcode_test')
310293

311294
if not test_sequence:
312295
logging.error('No test sequence found by the test sequence name provided.')
313296
handle_casting_failure(None, [])
314297

315298
# At this point, we have retrieved the test sequence of interest.
299+
test_sequence_name = test_sequence.name
316300
test_sequence_steps = test_sequence.steps
317301

318302
# Configure command options to disable stdout buffering during tests.

0 commit comments

Comments
 (0)