1
0
Fork 0
forked from External/mediamtx

fix UDP-related tests (#3484)

for some reason, using "localhost" with UDP inside GitHub Actions and
Docker stopped working.
This commit is contained in:
Alessandro Ros 2024-06-17 23:09:25 +02:00 committed by GitHub
parent 9554fc4ba0
commit f227971517
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 6 additions and 6 deletions

View file

@ -106,7 +106,7 @@ func TestServerPublish(t *testing.T) {
require.NoError(t, err)
defer s.Close()
u := "srt://localhost:8890?streamid=publish:mypath:myuser:mypass"
u := "srt://127.0.0.1:8890?streamid=publish:mypath:myuser:mypass"
srtConf := srt.DefaultConfig()
address, err := srtConf.UnmarshalURL(u)
@ -205,7 +205,7 @@ func TestServerRead(t *testing.T) {
require.NoError(t, err)
defer s.Close()
u := "srt://localhost:8890?streamid=read:mypath:myuser:mypass"
u := "srt://127.0.0.1:8890?streamid=read:mypath:myuser:mypass"
srtConf := srt.DefaultConfig()
address, err := srtConf.UnmarshalURL(u)

View file

@ -15,7 +15,7 @@ import (
)
func TestSource(t *testing.T) {
ln, err := srt.Listen("srt", "localhost:9002", srt.DefaultConfig())
ln, err := srt.Listen("srt", "127.0.0.1:9002", srt.DefaultConfig())
require.NoError(t, err)
defer ln.Close()
@ -55,7 +55,7 @@ func TestSource(t *testing.T) {
te := test.NewSourceTester(
func(p defs.StaticSourceParent) defs.StaticSource {
return &Source{
ResolvedSource: "srt://localhost:9002?streamid=sidname&passphrase=ttest1234567",
ResolvedSource: "srt://127.0.0.1:9002?streamid=sidname&passphrase=ttest1234567",
ReadTimeout: conf.StringDuration(10 * time.Second),
Parent: p,
}

View file

@ -18,7 +18,7 @@ func TestSource(t *testing.T) {
te := test.NewSourceTester(
func(p defs.StaticSourceParent) defs.StaticSource {
return &Source{
ResolvedSource: "udp://localhost:9001",
ResolvedSource: "udp://127.0.0.1:9001",
ReadTimeout: conf.StringDuration(10 * time.Second),
Parent: p,
}
@ -29,7 +29,7 @@ func TestSource(t *testing.T) {
time.Sleep(50 * time.Millisecond)
conn, err := net.Dial("udp", "localhost:9001")
conn, err := net.Dial("udp", "127.0.0.1:9001")
require.NoError(t, err)
defer conn.Close()