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:
parent
9554fc4ba0
commit
f227971517
3 changed files with 6 additions and 6 deletions
|
|
@ -106,7 +106,7 @@ func TestServerPublish(t *testing.T) {
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
defer s.Close()
|
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()
|
srtConf := srt.DefaultConfig()
|
||||||
address, err := srtConf.UnmarshalURL(u)
|
address, err := srtConf.UnmarshalURL(u)
|
||||||
|
|
@ -205,7 +205,7 @@ func TestServerRead(t *testing.T) {
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
defer s.Close()
|
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()
|
srtConf := srt.DefaultConfig()
|
||||||
address, err := srtConf.UnmarshalURL(u)
|
address, err := srtConf.UnmarshalURL(u)
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestSource(t *testing.T) {
|
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)
|
require.NoError(t, err)
|
||||||
defer ln.Close()
|
defer ln.Close()
|
||||||
|
|
||||||
|
|
@ -55,7 +55,7 @@ func TestSource(t *testing.T) {
|
||||||
te := test.NewSourceTester(
|
te := test.NewSourceTester(
|
||||||
func(p defs.StaticSourceParent) defs.StaticSource {
|
func(p defs.StaticSourceParent) defs.StaticSource {
|
||||||
return &Source{
|
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),
|
ReadTimeout: conf.StringDuration(10 * time.Second),
|
||||||
Parent: p,
|
Parent: p,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ func TestSource(t *testing.T) {
|
||||||
te := test.NewSourceTester(
|
te := test.NewSourceTester(
|
||||||
func(p defs.StaticSourceParent) defs.StaticSource {
|
func(p defs.StaticSourceParent) defs.StaticSource {
|
||||||
return &Source{
|
return &Source{
|
||||||
ResolvedSource: "udp://localhost:9001",
|
ResolvedSource: "udp://127.0.0.1:9001",
|
||||||
ReadTimeout: conf.StringDuration(10 * time.Second),
|
ReadTimeout: conf.StringDuration(10 * time.Second),
|
||||||
Parent: p,
|
Parent: p,
|
||||||
}
|
}
|
||||||
|
|
@ -29,7 +29,7 @@ func TestSource(t *testing.T) {
|
||||||
|
|
||||||
time.Sleep(50 * time.Millisecond)
|
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)
|
require.NoError(t, err)
|
||||||
defer conn.Close()
|
defer conn.Close()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue