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

TEST: Upgrade pion to v3.2.9. #3567

Merged
merged 4 commits into from
Jun 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 3 additions & 3 deletions trunk/3rdparty/srs-bench/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ clean:

#########################################################################################################
# SRS benchmark tool for SRS, janus, GB28181.
./objs/.format.bench.txt: *.go srs/*.go vnet/*.go janus/*.go gb28181/*.go
gofmt -w .
./objs/.format.bench.txt: *.go janus/*.go ./objs/.format.srs.txt ./objs/.format.gb28181.txt
gofmt -w *.go janus
mkdir -p objs && echo "done" > ./objs/.format.bench.txt

bench: ./objs/srs_bench

./objs/srs_bench: ./objs/.format.bench.txt *.go srs/*.go vnet/*.go janus/*.go gb28181/*.go Makefile
./objs/srs_bench: ./objs/.format.bench.txt *.go janus/*.go srs/*.go vnet/*.go gb28181/*.go Makefile
go build -mod=vendor -o objs/srs_bench .

#########################################################################################################
Expand Down
114 changes: 57 additions & 57 deletions trunk/3rdparty/srs-bench/blackbox/http_api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,73 +21,73 @@
package blackbox

import (
"context"
"fmt"
"github.com/ossrs/go-oryx-lib/errors"
"github.com/ossrs/go-oryx-lib/logger"
"net/http"
"sync"
"testing"
"time"
"context"
"fmt"
"github.com/ossrs/go-oryx-lib/errors"
"github.com/ossrs/go-oryx-lib/logger"
"net/http"
"sync"
"testing"
"time"
)

func TestFast_Http_Api_Basic_Auth(t *testing.T) {
// This case is run in parallel.
t.Parallel()
// This case is run in parallel.
t.Parallel()

// Setup the max timeout for this case.
ctx, cancel := context.WithTimeout(logger.WithContext(context.Background()), time.Duration(*srsTimeout)*time.Millisecond)
defer cancel()
// Setup the max timeout for this case.
ctx, cancel := context.WithTimeout(logger.WithContext(context.Background()), time.Duration(*srsTimeout)*time.Millisecond)
defer cancel()

// Check a set of errors.
var r0, r1, r2, r3, r4, r5, r6 error
defer func(ctx context.Context) {
if err := filterTestError(ctx.Err(), r0, r1, r2, r3, r4, r5, r6); err != nil {
t.Errorf("Fail for err %+v", err)
} else {
logger.Tf(ctx, "test done with err %+v", err)
}
}(ctx)
// Check a set of errors.
var r0, r1, r2, r3, r4, r5, r6 error
defer func(ctx context.Context) {
if err := filterTestError(ctx.Err(), r0, r1, r2, r3, r4, r5, r6); err != nil {
t.Errorf("Fail for err %+v", err)
} else {
logger.Tf(ctx, "test done with err %+v", err)
}
}(ctx)

var wg sync.WaitGroup
defer wg.Wait()
var wg sync.WaitGroup
defer wg.Wait()

// Start SRS server and wait for it to be ready.
svr := NewSRSServer(func(v *srsServer) {
v.envs = []string{
"SRS_HTTP_API_AUTH_ENABLED=on",
"SRS_HTTP_API_AUTH_USERNAME=admin",
"SRS_HTTP_API_AUTH_PASSWORD=admin",
}
})
wg.Add(1)
go func() {
defer wg.Done()
r0 = svr.Run(ctx, cancel)
}()
// Start SRS server and wait for it to be ready.
svr := NewSRSServer(func(v *srsServer) {
v.envs = []string{
"SRS_HTTP_API_AUTH_ENABLED=on",
"SRS_HTTP_API_AUTH_USERNAME=admin",
"SRS_HTTP_API_AUTH_PASSWORD=admin",
}
})
wg.Add(1)
go func() {
defer wg.Done()
r0 = svr.Run(ctx, cancel)
}()

<-svr.ReadyCtx().Done()
<-svr.ReadyCtx().Done()

if true {
defer cancel()
if true {
defer cancel()

var res *http.Response
url := fmt.Sprintf("http://admin:admin@localhost:%v/api/v1/versions", svr.APIPort())
res, r1 = http.Get(url)
if r1 == nil && res.StatusCode != 200 {
r2 = errors.Errorf("get status code=%v, expect=200", res.StatusCode)
}
var res *http.Response
url := fmt.Sprintf("http://admin:admin@localhost:%v/api/v1/versions", svr.APIPort())
res, r1 = http.Get(url)
if r1 == nil && res.StatusCode != 200 {
r2 = errors.Errorf("get status code=%v, expect=200", res.StatusCode)
}

url = fmt.Sprintf("http://admin:123456@localhost:%v/api/v1/versions", svr.APIPort())
res, r3 = http.Get(url)
if r3 == nil && res.StatusCode != 401 {
r4 = errors.Errorf("get status code=%v, expect=401", res.StatusCode)
}
url = fmt.Sprintf("http://admin:123456@localhost:%v/api/v1/versions", svr.APIPort())
res, r3 = http.Get(url)
if r3 == nil && res.StatusCode != 401 {
r4 = errors.Errorf("get status code=%v, expect=401", res.StatusCode)
}

url = fmt.Sprintf("http://localhost:%v/api/v1/versions", svr.APIPort())
res, r5 = http.Get(url)
if r5 == nil && res.StatusCode != 401 {
r6 = errors.Errorf("get status code=%v, expect=401", res.StatusCode)
}
}
url = fmt.Sprintf("http://localhost:%v/api/v1/versions", svr.APIPort())
res, r5 = http.Get(url)
if r5 == nil && res.StatusCode != 401 {
r6 = errors.Errorf("get status code=%v, expect=401", res.StatusCode)
}
}
}
2 changes: 1 addition & 1 deletion trunk/3rdparty/srs-bench/gb28181/gb28181.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// The MIT License (MIT)
//
// Copyright (c) 2022 Winlin
// # Copyright (c) 2022 Winlin
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
Expand Down
2 changes: 1 addition & 1 deletion trunk/3rdparty/srs-bench/gb28181/gb28181_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// The MIT License (MIT)
//
// Copyright (c) 2022 Winlin
// # Copyright (c) 2022 Winlin
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
Expand Down
2 changes: 1 addition & 1 deletion trunk/3rdparty/srs-bench/gb28181/sip.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// The MIT License (MIT)
//
// Copyright (c) 2022 Winlin
// # Copyright (c) 2022 Winlin
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
Expand Down
46 changes: 39 additions & 7 deletions trunk/3rdparty/srs-bench/go.mod
Original file line number Diff line number Diff line change
@@ -1,18 +1,50 @@
module github.com/ossrs/srs-bench

go 1.15
go 1.17

require (
github.com/ghettovoice/gosip v0.0.0-20220929080231-de8ba881be83
github.com/ossrs/go-oryx-lib v0.0.9
github.com/pion/interceptor v0.0.10
github.com/pion/ice/v2 v2.3.6
github.com/pion/interceptor v0.1.17
github.com/pion/logging v0.2.2
github.com/pion/rtcp v1.2.6
github.com/pion/rtp v1.6.2
github.com/pion/sdp/v3 v3.0.4
github.com/pion/transport v0.12.2
github.com/pion/webrtc/v3 v3.0.13
github.com/pion/rtcp v1.2.10
github.com/pion/rtp v1.7.13
github.com/pion/sdp/v3 v3.0.6
github.com/pion/transport/v2 v2.2.1
github.com/pion/webrtc/v3 v3.2.9
github.com/pkg/errors v0.9.1
github.com/yapingcat/gomedia/codec v0.0.0-20220617074658-94762898dc25
github.com/yapingcat/gomedia/mpeg2 v0.0.0-20220617074658-94762898dc25
)

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/gobwas/httphead v0.1.0 // indirect
github.com/gobwas/pool v0.2.1 // indirect
github.com/gobwas/ws v1.1.0-rc.1 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect
github.com/mattn/go-colorable v0.1.4 // indirect
github.com/mattn/go-isatty v0.0.8 // indirect
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b // indirect
github.com/pion/datachannel v1.5.5 // indirect
github.com/pion/dtls/v2 v2.2.7 // indirect
github.com/pion/mdns v0.0.7 // indirect
github.com/pion/randutil v0.1.0 // indirect
github.com/pion/sctp v1.8.7 // indirect
github.com/pion/srtp/v2 v2.0.15 // indirect
github.com/pion/stun v0.6.0 // indirect
github.com/pion/turn/v2 v2.1.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/satori/go.uuid v1.2.1-0.20181028125025-b2ce2384e17b // indirect
github.com/sirupsen/logrus v1.4.2 // indirect
github.com/stretchr/testify v1.8.4 // indirect
github.com/tevino/abool v0.0.0-20170917061928-9b9efcf221b5 // indirect
github.com/x-cray/logrus-prefixed-formatter v0.5.2 // indirect
golang.org/x/crypto v0.9.0 // indirect
golang.org/x/net v0.10.0 // indirect
golang.org/x/sys v0.8.0 // indirect
golang.org/x/term v0.8.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading