Avoid probing UUID file-transfer namespaces
This commit is contained in:
1 parent
d9e7daa203
commit
13d2a38f5d
3 files changed
+79
-5
No files matched your search
@@ -226,6 +226,37 @@ class TestCourseCodesFromSupportedOptions:
|
||||
"8F",
|
||||
]
|
||||
|
||||
def test_decodes_reported_dishwasher_course_table_without_editcourse(self):
|
||||
"""Real DA_DW_A51_20_COMMON diagnostics: the board has no
|
||||
/wm/editcourse/vs/0, so every selectable code must come from its
|
||||
packed supportedOptions table, including the newer 82/8A/A7/A8/8C
|
||||
family that previously appeared as raw UI text.
|
||||
"""
|
||||
resources = {
|
||||
"/course/vs/0": {
|
||||
"x.com.samsung.da.options": ["Course_82"],
|
||||
"x.com.samsung.da.supportedOptions": [
|
||||
"482E0026002F00270028AE0026002F0027002A7E0026002F00270028"
|
||||
"0E0006000F0027000A8E0026002F002700288E0006000F00070008C"
|
||||
"E0026002F00270028DE0026002F00270028EE0006000F00270028FE"
|
||||
"0006002F0027002"
|
||||
],
|
||||
},
|
||||
}
|
||||
|
||||
assert laundry.cycle_options(resources) == [
|
||||
"82",
|
||||
"8A",
|
||||
"A7",
|
||||
"80",
|
||||
"A8",
|
||||
"88",
|
||||
"8C",
|
||||
"8D",
|
||||
"8E",
|
||||
"8F",
|
||||
]
|
||||
|
||||
|
||||
class TestCycleSelect:
|
||||
def test_builds_labelled_cycle_select(self):
|
||||
|
||||
@@ -625,7 +625,10 @@ def test_enumerate_prefixed_id_named_by_both_subdevice_id_list_and_oic_res_is_no
|
||||
{
|
||||
"di": "a",
|
||||
"links": [
|
||||
{"href": f"/{_UUID}/multidevice/vs/0"},
|
||||
{
|
||||
"href": f"/{_UUID}/multidevice/vs/0",
|
||||
"rt": ["x.com.samsung.da.multidevice"],
|
||||
},
|
||||
],
|
||||
}
|
||||
]
|
||||
@@ -650,7 +653,10 @@ def test_enumerate_prefixed_id_case_mismatch_between_sources_is_not_duplicated()
|
||||
{
|
||||
"di": "a",
|
||||
"links": [
|
||||
{"href": f"/{_UUID}/multidevice/vs/0"},
|
||||
{
|
||||
"href": f"/{_UUID}/multidevice/vs/0",
|
||||
"rt": ["x.com.samsung.da.multidevice"],
|
||||
},
|
||||
],
|
||||
}
|
||||
]
|
||||
@@ -666,6 +672,39 @@ def test_enumerate_prefixed_id_case_mismatch_between_sources_is_not_duplicated()
|
||||
assert subdevices[0].key.lower() == _UUID
|
||||
|
||||
|
||||
def test_uuid_prefixed_file_links_do_not_trigger_flat_subdevice_probe():
|
||||
"""A single-unit AC can advertise UUID-prefixed file-transfer links.
|
||||
|
||||
They identify a transfer namespace, not a sibling indoor unit. Treating
|
||||
the prefix as Pattern C makes setup probe every master href under a UUID
|
||||
that never answers, consuming the whole enumeration timeout budget.
|
||||
"""
|
||||
oic_res = [
|
||||
{
|
||||
"di": "a",
|
||||
"links": [
|
||||
{
|
||||
"href": f"/{_UUID}/file/transfer/vs/0",
|
||||
"rt": ["x.com.samsung.file.transfer"],
|
||||
},
|
||||
{
|
||||
"href": f"/{_UUID}/file/list/vs/0",
|
||||
"rt": ["x.com.samsung.file.list"],
|
||||
},
|
||||
],
|
||||
}
|
||||
]
|
||||
sess = _FakeSession({})
|
||||
probes: dict[str, bool] = {}
|
||||
|
||||
subdevices, _extra = enumerate_subdevices(
|
||||
sess, {}, oic_res, probe_log=probes.__setitem__
|
||||
)
|
||||
|
||||
assert subdevices == []
|
||||
assert not any(href.startswith(f"/{_UUID}/") for href in probes)
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# discover_partitioned
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
Reference in new issue
Block a user