Skip to content

Commit 1703a36

Browse files
updates per latest comments
1 parent 840e7eb commit 1703a36

File tree

1 file changed

+66
-70
lines changed

1 file changed

+66
-70
lines changed

src/python_testing/TC_SC_4_1.py

Lines changed: 66 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -122,21 +122,23 @@ def steps_TC_SC_4_1(self):
122122
"""If supported:
123123
- Set supports_obcw to True, otherwise, set supports_obcw to False"""),
124124

125-
TestStep(6, """Get the 'Long Discriminator Subtype'""",
126-
"""TH gets the 'Long Discriminator' from the DUT and constructs the 'Long Discriminator Subtype'
127-
- Verify that the 'Long Discriminator Subtype' discriminator value is a valid 12-bit variable length decimal
128-
number in ASCII text, omitting any leading zeros. Save as 'long_discriminator_subtype'
129-
- Save the 'Long Discriminator' value as 'long_discriminator'"""),
130-
131125
# OPEN BASIC COMMISSIONING WINDOW
132126
#
133-
TestStep(7, """If supports_obcw is True, DUT is put in Commissioning Mode using Open Basic Commissioning Window command""",
127+
TestStep(6, """If supports_obcw is True, DUT is put in Commissioning Mode using Open Basic Commissioning Window command""",
134128
"""DUT starts advertising Commissionable Node Discovery service through DNS-SD"""),
135129

136-
TestStep(8, """Get the 'Long Discriminator Subtype' PTR record's instance name""",
130+
TestStep(7, """TH gets the discriminator from the DUT and constructs the Discriminator
131+
subtype (Long or Short) based on the setup code type (QR or manual)""",
132+
"""If setup code type is QR Code, construct the 'Long Discriminator Subtype'
133+
- Verify that the discriminator value is a valid 12-bit variable length decimal number in ASCII text, omitting any leading zeros
134+
If setup code type is Manual, construct the 'Short Discriminator Subtype'
135+
- Verify that the discriminator value is a valid 4-bit variable length decimal number in ASCII text, omitting any leading zeros
136+
Save as 'discriminator_subtype'."""),
137+
138+
TestStep(8, """Get the Discriminator Subtype (Long or Short from the previous step) PTR record's instance name""",
137139
"""TH performs a PTR record query against the 'Long Discriminator Subtype' _L
138140
- Verify that there is one, and only one, 'Long Discriminator Subtype' PTR record
139-
- Save the 'Long Discriminator Subtype' PTR record's instance name as 'long_discriminator_subtype_ptr_instance_name'"""),
141+
- Save the 'Long Discriminator Subtype' PTR record's instance name as 'discriminator_subtype_ptr_instance_name'"""),
140142

141143
TestStep(9, """Verify commissionable subtype advertisements""",
142144
"""See the 'Commissionable Subtypes Verifications' table in the Notes/Testing considerations
@@ -159,55 +161,61 @@ def steps_TC_SC_4_1(self):
159161

160162
# OPEN COMISSIONING WINDOW
161163
#
162-
TestStep(14, """DUT is put in Commissioning Mode using Open Commissioning Window command""",
164+
TestStep(14, """TH gets the Long Discriminator from the DUT and constructs the Long Discriminator Subtype""",
165+
"""Verify that the Long discriminator value is a valid 12-bit variable length decimal number in ASCII text,
166+
omitting any leading zeros
167+
Save the 'Long Discriminator Subtype' as long_discriminator_subtype
168+
Save 'Long Discriminator' value as long_discriminator"""),
169+
170+
TestStep(15, """DUT is put in Commissioning Mode using Open Commissioning Window command""",
163171
"""DUT starts advertising Commissionable Node Discovery service through DNS-SD"""),
164172

165-
TestStep(15, """Get the 'Long Discriminator Subtype' PTR record's instance name""",
173+
TestStep(16, """Get the 'Long Discriminator Subtype' PTR record's instance name""",
166174
"""TH performs a PTR record query against the 'Long Discriminator Subtype' _L
167175
- Verify that there is one, and only one, 'Long Discriminator Subtype' PTR record
168-
- Save the 'Long Discriminator Subtype' PTR record's instance name as 'long_discriminator_subtype_ptr_instance_name'"""),
176+
- Save the 'Long Discriminator Subtype' PTR record's instance name as long_discriminator_subtype_ptr_instance_name"""),
169177

170-
TestStep(16, """Verify commissionable subtype advertisements""",
178+
TestStep(17, """Verify commissionable subtype advertisements""",
171179
"""See the 'Commissionable Subtypes Verifications' table in the Notes/Testing considerations
172180
section of the Test Plan for the list of verifications to be performed"""),
173181

174-
TestStep(17, """Verify SRV record advertisements""",
182+
TestStep(18, """Verify SRV record advertisements""",
175183
"""See the 'SRV Record Verifications' table in the Notes/Testing considerations
176184
section of the Test Plan for the list of verifications to be performed"""),
177185

178-
TestStep(18, """Verify TXT record advertisements""",
186+
TestStep(19, """Verify TXT record advertisements""",
179187
"""See the 'TXT Record Verifications' table in the Notes/Testing considerations
180188
section of the Test Plan for the list of verifications to be performed. Expected CM TXT key value = 2"""),
181189

182-
TestStep(19, """Verify AAAA records""",
190+
TestStep(20, """Verify AAAA records""",
183191
"""See the 'AAAA Record Verifications' table in the Notes/Testing considerations
184192
section of the Test Plan for the list of verifications to be performed"""),
185193

186-
TestStep(20, """Close commissioning window""",
194+
TestStep(21 , """Close commissioning window""",
187195
"""DUT stops advertising Commissionable Node Discovery services"""),
188196

189197
# EXTENDED DISCOVERY MODE
190198
#
191-
TestStep(21, """Check if DUT Extended Discovery mode is active""",
199+
TestStep(22, """Check if DUT Extended Discovery mode is active""",
192200
"""Get the 'Long Discriminator Subtype' PTR record's instance name
193201
- If the DUT's 'Long Discriminator Subtype' PTR record's instance name is present,
194202
Extended Discovery mode is active, if so, save the 'Long Discriminator Subtype'
195203
PTR record's instance name as 'long_discriminator_subtype_ptr_instance_name'"""),
196204

197-
TestStep(22, """Verify commissionable subtype advertisements""",
205+
TestStep(23, """Verify commissionable subtype advertisements""",
198206
"""See the 'Commissionable Subtypes Verifications' table in the Notes/Testing considerations
199207
section of the Test Plan for the list of verifications to be performed"""),
200208

201-
TestStep(23, """Verify SRV record advertisements""",
209+
TestStep(24, """Verify SRV record advertisements""",
202210
"""See the 'SRV Record Verifications' table in the Notes/Testing considerations
203211
section of the Test Plan for the list of verifications to be performed"""),
204212

205-
TestStep(24, """Verify TXT record advertisements""",
213+
TestStep(25, """Verify TXT record advertisements""",
206214
"""See the 'TXT Record Verifications' table in the Notes/Testing considerations
207215
section of the Test Plan for the list of verifications to be performed. Expected
208216
CM TXT key value = 0 or omitted key"""),
209217

210-
TestStep(25, """Verify AAAA records""",
218+
TestStep(26, """Verify AAAA records""",
211219
"""See the 'AAAA Record Verifications' table in the Notes/Testing considerations
212220
section of the Test Plan for the list of verifications to be performed"""),
213221
]
@@ -741,15 +749,11 @@ async def test_TC_SC_4_1(self):
741749
feature_int=Clusters.AdministratorCommissioning.Bitmaps.Feature.kBasic)
742750

743751
# *** STEP 6 ***
744-
# Get the 'Long Discriminator Subtype'
745-
self.step(6)
746-
747-
# *** STEP 7 ***
748752
# If 'supports_obcw' is True DUT is put in Commissioning
749753
# Mode using **Open Basic Commissioning Window** command
750754
# - DUT starts advertising Commissionable Node Discovery services
751-
self.step(7)
752755
if supports_obcw:
756+
self.step(6)
753757
logging.info("\n\n\t ** Open Basic Commissioning Window supported\n")
754758
await self.default_controller.SendCommand(
755759
nodeid=self.dut_node_id,
@@ -758,16 +762,10 @@ async def test_TC_SC_4_1(self):
758762
timedRequestTimeoutMs=6000
759763
)
760764

761-
# TH gets the discriminator from the DUT and constructs the Long
762-
# or Short Discriminator subtype based on the setup code type
763-
# - If setup code type is QR Code, construct the Long Discriminator subtype
764-
# - If setup code type is Manual, construct the Short Discriminator subtype
765-
# - If Long Discriminator subtype, verify that the discriminator value is a valid 12-bit
766-
# variable length decimal number in ASCII text, omitting any leading zeros.
767-
# Save as 'discriminator_subtype'.
768-
# - If Short Discriminator subtype, verify that the discriminator value is a valid 4-bit
769-
# variable length decimal number in ASCII text, omitting any leading zeros.
770-
# Save as 'discriminator_subtype'.
765+
# *** STEP 7 ***
766+
# TH gets the discriminator from the DUT and constructs the Discriminator
767+
# subtype (Long or Short) based on the setup code type (QR or manual)
768+
self.step(7)
771769
discriminator_subtype, _ = self.get_discriminator_subtype(is_obcw=True)
772770

773771
# *** STEP 8 ***
@@ -800,21 +798,18 @@ async def test_TC_SC_4_1(self):
800798
self.step(13)
801799
await self.close_commissioning_window()
802800
else:
803-
logging.info("\n\n\t ** Open Basic Commissioning Window unsupported, skipping step.\n")
804-
self.mark_step_range_skipped(8, 13)
801+
logging.info("\n\n\t ** Open Basic Commissioning Window command is unsupported, skipping advertisement verification steps.\n")
802+
self.mark_step_range_skipped(6, 13)
805803

806804
# *** STEP 14 ***
807-
# DUT is put in Commissioning Mode using Open Commissioning Window command
808-
# - DUT starts advertising Commissionable Node Discovery services
805+
# TH gets the Lomg Discriminator from the DUT and constructs the Long Discriminator Subtype
809806
self.step(14)
810-
811-
# TH gets the discriminator from the DUT and constructs the Long Discriminator subtype
812-
# - Verify that the Long discriminator value is a valid 12-bit variable
813-
# length decimal number in ASCII text, omitting any leading zeros.
814-
# Save as 'long_discriminator_subtype'.
815-
# - Save Long discriminator value as 'long_discriminator'.
816807
long_discriminator_subtype, long_discriminator = self.get_discriminator_subtype(is_obcw=False)
817808

809+
# *** STEP 15 ***
810+
# DUT is put in Commissioning Mode using Open Commissioning Window command
811+
# - DUT starts advertising Commissionable Node Discovery services
812+
self.step(15)
818813
await self.default_controller.OpenCommissioningWindow(
819814
nodeid=self.dut_node_id,
820815
timeout=180,
@@ -823,39 +818,39 @@ async def test_TC_SC_4_1(self):
823818
option=1
824819
)
825820

826-
# *** STEP 15 ***
821+
# *** STEP 16 ***
827822
# Get the 'Long Discriminator Subtype' PTR record's instance name
828-
self.step(15)
823+
self.step(16)
829824
long_discriminator_ptr_instance_name = await self._get_verify_discriminator_subtype_ptr_instance_name(long_discriminator_subtype)
830825

831-
# *** STEP 16 ***
826+
# *** STEP 17 ***
832827
# Verify commissionable subtype advertisements
833-
self.step(16)
828+
self.step(17)
834829
await self._verify_commissionable_subtypes(long_discriminator_ptr_instance_name)
835830

836-
# *** STEP 17 ***
831+
# *** STEP 18 ***
837832
# Verify SRV record advertisements
838-
self.step(17)
833+
self.step(18)
839834
srv_hostname = await self._get_verify_srv_record(long_discriminator_ptr_instance_name)
840835

841-
# *** STEP 18 ***
836+
# *** STEP 19 ***
842837
# Verify TXT record keys advertisements
843-
self.step(18)
838+
self.step(19)
844839
await self._verify_txt_record_keys(long_discriminator_ptr_instance_name, expected_cm="2")
845840

846-
# *** STEP 19 ***
841+
# *** STEP 20 ***
847842
# Verify AAAA records
848-
self.step(19)
843+
self.step(20)
849844
await self._verify_aaaa_records(srv_hostname)
850845

851-
# *** STEP 20 ***
846+
# *** STEP 21 ***
852847
# Close commissioning window
853-
self.step(20)
848+
self.step(21)
854849
await self.close_commissioning_window()
855850

856-
# *** STEP 21 ***
851+
# *** STEP 22 ***
857852
# Check if DUT Extended Discovery mode is active
858-
self.step(21)
853+
self.step(22)
859854
# Get the 'Long Discriminator Subtype' PTR record's instance name
860855
long_discriminator_ptr_instance_name = await self._get_verify_discriminator_subtype_ptr_instance_name(long_discriminator_subtype, must_be_present=False)
861856

@@ -864,27 +859,28 @@ async def test_TC_SC_4_1(self):
864859
logging.info(f"DUT Extended Discovery mode active: {extended_discovery_mode}")
865860

866861
if extended_discovery_mode:
867-
# *** STEP 22 ***
862+
# *** STEP 23 ***
868863
# Verify commissionable subtype advertisements
869-
self.step(22)
864+
self.step(23)
870865
await self._verify_commissionable_subtypes(long_discriminator_ptr_instance_name, extended_discovery_mode)
871866

872-
# *** STEP 23 ***
867+
# *** STEP 24 ***
873868
# Verify SRV record advertisements
874-
self.step(23)
869+
self.step(24)
875870
srv_hostname = await self._get_verify_srv_record(long_discriminator_ptr_instance_name)
876871

877-
# *** STEP 24 ***
872+
# *** STEP 25 ***
878873
# Verify TXT record keys advertisements
879-
self.step(24)
874+
self.step(25)
880875
await self._verify_txt_record_keys(long_discriminator_ptr_instance_name, expected_cm="0")
881876

882-
# *** STEP 25 ***
877+
# *** STEP 26 ***
883878
# Verify AAAA records
884-
self.step(25)
879+
self.step(26)
885880
await self._verify_aaaa_records(srv_hostname)
886881
else:
887-
self.mark_step_range_skipped(22, 25)
882+
logging.info("Skipping Extended Discovery mode advertisements verification steps.")
883+
self.mark_step_range_skipped(23, 26)
888884

889885

890886
if __name__ == "__main__":

0 commit comments

Comments
 (0)