test: example addresses come from the documentation range
Sonos, UPnP and public-address tests used addresses from a real home network. They now use 198.51.100.x (RFC 5737), keeping the last number. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+1
-1
@@ -265,7 +265,7 @@ class UpnpDiscoveryController @Inject constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private companion object {
|
private companion object {
|
||||||
// " (192.168.0.77)" trailing host suffix some generic UPnP
|
// " (198.51.100.77)" trailing host suffix some generic UPnP
|
||||||
// devices append. Anchored to end-of-string so it never eats
|
// devices append. Anchored to end-of-string so it never eats
|
||||||
// a legitimate parenthetical inside a name.
|
// a legitimate parenthetical inside a name.
|
||||||
val IP_SUFFIX_REGEX = Regex("""\s*\(\d+\.\d+\.\d+\.\d+\)$""")
|
val IP_SUFFIX_REGEX = Regex("""\s*\(\d+\.\d+\.\d+\.\d+\)$""")
|
||||||
|
|||||||
+2
-2
@@ -21,9 +21,9 @@ class SingleTrackQueueTest {
|
|||||||
name = "Room",
|
name = "Room",
|
||||||
manufacturer = manufacturer,
|
manufacturer = manufacturer,
|
||||||
modelName = "",
|
modelName = "",
|
||||||
avTransportControlUrl = "http://192.168.0.2:1400/AVTransport/Control".toHttpUrl(),
|
avTransportControlUrl = "http://198.51.100.2:1400/AVTransport/Control".toHttpUrl(),
|
||||||
renderingControlUrl = null,
|
renderingControlUrl = null,
|
||||||
zoneGroupTopologyControlUrl = if (zgt) "http://192.168.0.2:1400/ZGT/Control".toHttpUrl() else null,
|
zoneGroupTopologyControlUrl = if (zgt) "http://198.51.100.2:1400/ZGT/Control".toHttpUrl() else null,
|
||||||
)
|
)
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
+4
-4
@@ -17,7 +17,7 @@ import kotlin.test.assertNull
|
|||||||
*/
|
*/
|
||||||
class DeviceDescriptionTest {
|
class DeviceDescriptionTest {
|
||||||
|
|
||||||
private val base = "http://192.168.1.50:1400/xml/device_description.xml".toHttpUrl()
|
private val base = "http://198.51.100.50:1400/xml/device_description.xml".toHttpUrl()
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `parses Sonos-shaped description`() {
|
fun `parses Sonos-shaped description`() {
|
||||||
@@ -51,11 +51,11 @@ class DeviceDescriptionTest {
|
|||||||
assertEquals("Sonos One", desc.modelName)
|
assertEquals("Sonos One", desc.modelName)
|
||||||
assertEquals("uuid:RINCON_ABC", desc.udn)
|
assertEquals("uuid:RINCON_ABC", desc.udn)
|
||||||
assertEquals(
|
assertEquals(
|
||||||
"http://192.168.1.50:1400/MediaRenderer/AVTransport/Control",
|
"http://198.51.100.50:1400/MediaRenderer/AVTransport/Control",
|
||||||
desc.avTransportControlUrl.toString(),
|
desc.avTransportControlUrl.toString(),
|
||||||
)
|
)
|
||||||
assertEquals(
|
assertEquals(
|
||||||
"http://192.168.1.50:1400/MediaRenderer/RenderingControl/Control",
|
"http://198.51.100.50:1400/MediaRenderer/RenderingControl/Control",
|
||||||
desc.renderingControlUrl?.toString(),
|
desc.renderingControlUrl?.toString(),
|
||||||
)
|
)
|
||||||
assertNull(desc.zoneGroupTopologyControlUrl)
|
assertNull(desc.zoneGroupTopologyControlUrl)
|
||||||
@@ -108,7 +108,7 @@ class DeviceDescriptionTest {
|
|||||||
val desc = DeviceDescription.parse(xml, base)
|
val desc = DeviceDescription.parse(xml, base)
|
||||||
assertNotNull(desc)
|
assertNotNull(desc)
|
||||||
assertEquals(
|
assertEquals(
|
||||||
"http://192.168.1.50:1400/ZoneGroupTopology/Control",
|
"http://198.51.100.50:1400/ZoneGroupTopology/Control",
|
||||||
desc.zoneGroupTopologyControlUrl?.toString(),
|
desc.zoneGroupTopologyControlUrl?.toString(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-5
@@ -13,7 +13,7 @@ class SonosTopologyTest {
|
|||||||
<ZoneGroups>
|
<ZoneGroups>
|
||||||
<ZoneGroup Coordinator="RINCON_A" ID="RINCON_A:1">
|
<ZoneGroup Coordinator="RINCON_A" ID="RINCON_A:1">
|
||||||
<ZoneGroupMember UUID="RINCON_A" ZoneName="Kitchen"
|
<ZoneGroupMember UUID="RINCON_A" ZoneName="Kitchen"
|
||||||
Location="http://192.168.1.10:1400/xml/device_description.xml"/>
|
Location="http://198.51.100.10:1400/xml/device_description.xml"/>
|
||||||
</ZoneGroup>
|
</ZoneGroup>
|
||||||
</ZoneGroups>
|
</ZoneGroups>
|
||||||
</ZoneGroupState>
|
</ZoneGroupState>
|
||||||
@@ -33,10 +33,10 @@ class SonosTopologyTest {
|
|||||||
<ZoneGroups>
|
<ZoneGroups>
|
||||||
<ZoneGroup Coordinator="RINCON_L" ID="RINCON_L:2">
|
<ZoneGroup Coordinator="RINCON_L" ID="RINCON_L:2">
|
||||||
<ZoneGroupMember UUID="RINCON_L" ZoneName="Living Room"
|
<ZoneGroupMember UUID="RINCON_L" ZoneName="Living Room"
|
||||||
Location="http://192.168.1.11:1400/xml/device_description.xml"
|
Location="http://198.51.100.11:1400/xml/device_description.xml"
|
||||||
ChannelMapSet="RINCON_L:LF,LF;RINCON_R:RF,RF"/>
|
ChannelMapSet="RINCON_L:LF,LF;RINCON_R:RF,RF"/>
|
||||||
<ZoneGroupMember UUID="RINCON_R" ZoneName="Living Room"
|
<ZoneGroupMember UUID="RINCON_R" ZoneName="Living Room"
|
||||||
Location="http://192.168.1.12:1400/xml/device_description.xml"
|
Location="http://198.51.100.12:1400/xml/device_description.xml"
|
||||||
ChannelMapSet="RINCON_L:LF,LF;RINCON_R:RF,RF"/>
|
ChannelMapSet="RINCON_L:LF,LF;RINCON_R:RF,RF"/>
|
||||||
</ZoneGroup>
|
</ZoneGroup>
|
||||||
</ZoneGroups>
|
</ZoneGroups>
|
||||||
@@ -82,7 +82,7 @@ class SonosTopologyTest {
|
|||||||
<ZoneGroups>
|
<ZoneGroups>
|
||||||
<ZoneGroup Coordinator="RINCON_A" ID="RINCON_A:1">
|
<ZoneGroup Coordinator="RINCON_A" ID="RINCON_A:1">
|
||||||
<ZoneGroupMember UUID="RINCON_A" ZoneName="Kitchen"
|
<ZoneGroupMember UUID="RINCON_A" ZoneName="Kitchen"
|
||||||
Location="http://192.168.1.10:1400/xml/device_description.xml"/>
|
Location="http://198.51.100.10:1400/xml/device_description.xml"/>
|
||||||
</ZoneGroup>
|
</ZoneGroup>
|
||||||
</ZoneGroups>
|
</ZoneGroups>
|
||||||
</ZoneGroupState>
|
</ZoneGroupState>
|
||||||
@@ -98,7 +98,7 @@ class SonosTopologyTest {
|
|||||||
<ZoneGroups>
|
<ZoneGroups>
|
||||||
<ZoneGroup Coordinator="RINCON_A" ID="RINCON_A:1">
|
<ZoneGroup Coordinator="RINCON_A" ID="RINCON_A:1">
|
||||||
<ZoneGroupMember UUID="RINCON_A" ZoneName="Kitchen"
|
<ZoneGroupMember UUID="RINCON_A" ZoneName="Kitchen"
|
||||||
Location="http://192.168.1.10:1400/xml/device_description.xml"/>
|
Location="http://198.51.100.10:1400/xml/device_description.xml"/>
|
||||||
</ZoneGroup>
|
</ZoneGroup>
|
||||||
</ZoneGroups>
|
</ZoneGroups>
|
||||||
</ZoneGroupState>
|
</ZoneGroupState>
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ func TestNormalizePublicURL(t *testing.T) {
|
|||||||
" ": "",
|
" ": "",
|
||||||
"https://music.example.com": "https://music.example.com",
|
"https://music.example.com": "https://music.example.com",
|
||||||
"https://music.example.com/": "https://music.example.com",
|
"https://music.example.com/": "https://music.example.com",
|
||||||
"http://192.168.1.10:4533": "http://192.168.1.10:4533",
|
"http://198.51.100.10:4533": "http://198.51.100.10:4533",
|
||||||
" https://Music.Example.com/ ": "https://Music.Example.com",
|
" https://Music.Example.com/ ": "https://Music.Example.com",
|
||||||
}
|
}
|
||||||
for in, want := range ok {
|
for in, want := range ok {
|
||||||
|
|||||||
Reference in New Issue
Block a user