Skip to content

Commit 73029f1

Browse files
refactor: Extract perform_test_ssp from test_ssp in SecurityTest (#97)
This change refactors SecurityTest by extracting the core logic of test_ssp into a new perform_test_ssp method. This allows subclasses to override perform_test_ssp to add custom behavior, such as retry mechanisms, around the test execution.
1 parent 8d919e7 commit 73029f1

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

avatar/cases/security_test.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,32 @@ async def test_ssp(
164164
Literal['against_central'],
165165
Literal['against_peripheral'],
166166
],
167+
) -> None:
168+
await self.perform_test_ssp(connect, pair, variant, ref_io_capability, ref_role)
169+
170+
async def perform_test_ssp(
171+
self,
172+
connect: Union[Literal['outgoing_connection'], Literal['incoming_connection']],
173+
pair: Union[Literal['outgoing_pairing'], Literal['incoming_pairing']],
174+
variant: Union[
175+
Literal['accept'],
176+
Literal['reject'],
177+
Literal['rejected'],
178+
Literal['disconnect'],
179+
Literal['disconnected'],
180+
Literal['accept_ctkd'],
181+
],
182+
ref_io_capability: Union[
183+
Literal['against_default_io_cap'],
184+
Literal['against_no_output_no_input'],
185+
Literal['against_keyboard_only'],
186+
Literal['against_display_only'],
187+
Literal['against_display_yes_no'],
188+
],
189+
ref_role: Union[
190+
Literal['against_central'],
191+
Literal['against_peripheral'],
192+
],
167193
) -> None:
168194
if self.dut.name == 'android' and connect == 'outgoing_connection' and pair == 'incoming_pairing':
169195
# TODO: do not skip when doing physical tests.

0 commit comments

Comments
 (0)