Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TC-CNET-4.3: Automate #37387

Open
wants to merge 28 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
9b6bad1
read ServerList
khodya Jan 22, 2025
6d499b7
WIP step 4
khodya Jan 31, 2025
2b508ea
impl step 4
khodya Feb 1, 2025
1e4bf6a
impl step 5
khodya Feb 1, 2025
6d847a4
imple step 6
khodya Feb 1, 2025
94c09f1
impl step 7
khodya Feb 1, 2025
c26a9b9
impl step 8
khodya Feb 1, 2025
7cb1c4a
fix step 4
khodya Feb 1, 2025
098b8c3
Restyled by isort
restyled-commits Feb 4, 2025
71d816f
change year
khodya Feb 4, 2025
47d1133
fix step 7
khodya Feb 7, 2025
9fbc49f
decouple assert_all and assert_list_element_type
khodya Feb 10, 2025
5903c55
network list should not be empty
khodya Feb 10, 2025
2269801
fix argument order
khodya Feb 10, 2025
f44600c
Merge branch 'master' into tc_cent_4_3_automate
khodya Feb 13, 2025
83612cc
Merge branch 'master' into tc_cent_4_3_automate
khodya Feb 25, 2025
0982449
remove CI arguments for manual tests
khodya Feb 25, 2025
c11a8c2
Merge branch 'master' into tc_cent_4_3_automate
khodya Feb 25, 2025
6941fa4
Revert "remove CI arguments for manual tests"
khodya Feb 25, 2025
986ada6
impl step 7 correctly
khodya Feb 25, 2025
3778f06
remove PICS
khodya Feb 25, 2025
fce427d
add expected steps & fix steps 6-7
khodya Feb 26, 2025
50b53f4
Merge remote-tracking branch 'upstream/master' into tc_cent_4_3_automate
khodya Feb 26, 2025
f58f8a3
fix step 4
khodya Feb 27, 2025
59f663a
fix step 7
khodya Feb 27, 2025
7275d0c
disable test on CI
khodya Feb 28, 2025
b8d5985
Restyled by whitespace
restyled-commits Feb 28, 2025
4584068
Restyled by prettier-yaml
restyled-commits Feb 28, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
impl step 5
  • Loading branch information
khodya committed Feb 1, 2025
commit 1e4bf6ae40ed7e904f7f660da8d0bd65515f1be8
16 changes: 12 additions & 4 deletions src/python_testing/TC_CNET_4_3.py
Original file line number Diff line number Diff line change
@@ -62,7 +62,8 @@ def steps_TC_CNET_4_3(self) -> list[TestStep]:
TestStep(1, test_plan_support.commission_if_required(), "", is_commissioning=True),
TestStep(2, "TH reads Descriptor Cluster from the DUT with EP0 TH reads ServerList from the DUT"),
TestStep(3, "TH reads the MaxNetworks attribute from the DUT"),
TestStep(4, "TH reads the Networks attribute list from the DUT")
TestStep(4, "TH reads the Networks attribute list from the DUT"),
TestStep(5, "TH reads InterfaceEnabled attribute from the DUT")
]
return steps

@@ -91,11 +92,18 @@ async def test_TC_CNET_4_3(self):
attribute=Clusters.NetworkCommissioning.Attributes.Networks)
matter_asserts.assert_list_element_type(networks, Clusters.NetworkCommissioning.Structs.NetworkInfoStruct,
"All elements in list are of type NetworkInfoStruct")
matter_asserts.assert_all(networks, lambda x: isinstance(x, bytes) and 1 <= len(x.networkID) <= 32,
matter_asserts.assert_all(networks, lambda x: isinstance(x.networkID, bytes) and 1 <= len(x.networkID) <= 32,
"NetworkID field is an octet string within a length range 1 to 32")
connected_networks_count = sum(map(lambda x: x.connected, networks))
asserts.assert_equal(connected_networks_count, 1, "Verify that only one entry has connected status as TRUE")
asserts.assert_less_equal(connected_networks_count, max_networks_count)
# asserts.assert_equal(connected_networks_count, 1, "Verify that only one entry has connected status as TRUE")
asserts.assert_less_equal(connected_networks_count, max_networks_count,
"Number of entries in the Networks attribute is less than or equal to 'MaxNetworksValue'")

self.step(5)
interface_enabled = await self.read_single_attribute_check_success(
cluster=Clusters.NetworkCommissioning,
attribute=Clusters.NetworkCommissioning.Attributes.InterfaceEnabled)
asserts.assert_true(interface_enabled, "InterfaceEnabled")


if __name__ == "__main__":