mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
SquashSRS4: Update srs-bench.
This commit is contained in:
parent
25145b945d
commit
b7b474deba
10 changed files with 590 additions and 516 deletions
35
trunk/3rdparty/srs-bench/vnet/udpproxy_test.go
vendored
35
trunk/3rdparty/srs-bench/vnet/udpproxy_test.go
vendored
|
@ -1,23 +1,5 @@
|
|||
// The MIT License (MIT)
|
||||
//
|
||||
// Copyright (c) 2021 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
|
||||
// the Software without restriction, including without limitation the rights to
|
||||
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
// the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all
|
||||
// copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
// +build !wasm
|
||||
|
||||
package vnet
|
||||
|
||||
import (
|
||||
|
@ -32,7 +14,6 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/pion/logging"
|
||||
"github.com/pion/transport/vnet"
|
||||
)
|
||||
|
||||
type MockUDPEchoServer struct {
|
||||
|
@ -163,7 +144,7 @@ func TestUDPProxyOne2One(t *testing.T) {
|
|||
}
|
||||
|
||||
doVnetProxy := func() error {
|
||||
router, err := vnet.NewRouter(&vnet.RouterConfig{
|
||||
router, err := NewRouter(&RouterConfig{
|
||||
CIDR: "0.0.0.0/0",
|
||||
LoggerFactory: logging.NewDefaultLoggerFactory(),
|
||||
})
|
||||
|
@ -171,7 +152,7 @@ func TestUDPProxyOne2One(t *testing.T) {
|
|||
return err
|
||||
}
|
||||
|
||||
clientNetwork := vnet.NewNet(&vnet.NetConfig{
|
||||
clientNetwork := NewNet(&NetConfig{
|
||||
StaticIP: "10.0.0.11",
|
||||
})
|
||||
if err = router.AddNet(clientNetwork); err != nil {
|
||||
|
@ -309,7 +290,7 @@ func TestUDPProxyTwo2One(t *testing.T) {
|
|||
}
|
||||
|
||||
doVnetProxy := func() error {
|
||||
router, err := vnet.NewRouter(&vnet.RouterConfig{
|
||||
router, err := NewRouter(&RouterConfig{
|
||||
CIDR: "0.0.0.0/0",
|
||||
LoggerFactory: logging.NewDefaultLoggerFactory(),
|
||||
})
|
||||
|
@ -317,7 +298,7 @@ func TestUDPProxyTwo2One(t *testing.T) {
|
|||
return err
|
||||
}
|
||||
|
||||
clientNetwork := vnet.NewNet(&vnet.NetConfig{
|
||||
clientNetwork := NewNet(&NetConfig{
|
||||
StaticIP: "10.0.0.11",
|
||||
})
|
||||
if err = router.AddNet(clientNetwork); err != nil {
|
||||
|
@ -487,7 +468,7 @@ func TestUDPProxyProxyTwice(t *testing.T) {
|
|||
}
|
||||
|
||||
doVnetProxy := func() error {
|
||||
router, err := vnet.NewRouter(&vnet.RouterConfig{
|
||||
router, err := NewRouter(&RouterConfig{
|
||||
CIDR: "0.0.0.0/0",
|
||||
LoggerFactory: logging.NewDefaultLoggerFactory(),
|
||||
})
|
||||
|
@ -495,7 +476,7 @@ func TestUDPProxyProxyTwice(t *testing.T) {
|
|||
return err
|
||||
}
|
||||
|
||||
clientNetwork := vnet.NewNet(&vnet.NetConfig{
|
||||
clientNetwork := NewNet(&NetConfig{
|
||||
StaticIP: "10.0.0.11",
|
||||
})
|
||||
if err = router.AddNet(clientNetwork); err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue