diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 366d47e465..cbf3fa2f10 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -198,7 +198,7 @@ jobs: - name: Run SRS regression-test run: | docker run --rm srs:test bash -c './objs/srs -c conf/regression-test.conf && \ - cd 3rdparty/srs-bench && (./objs/srs_test -test.v || (cat ../../objs/srs.log && exit -1)) && ./objs/srs_gb28181_test -test.v' + cd 3rdparty/srs-bench && (./objs/srs_test -test.v -srs-log || (cat ../../objs/srs.log && exit -1)) && ./objs/srs_gb28181_test -test.v' runs-on: ubuntu-20.04 coverage: diff --git a/trunk/3rdparty/srs-bench/srs/rtmp_test.go b/trunk/3rdparty/srs-bench/srs/rtmp_test.go index 7dd39597f2..76e5d707d6 100644 --- a/trunk/3rdparty/srs-bench/srs/rtmp_test.go +++ b/trunk/3rdparty/srs-bench/srs/rtmp_test.go @@ -24,13 +24,14 @@ import ( "bytes" "context" "fmt" - "github.com/pkg/errors" "math/rand" "os" "sync" "testing" "time" + "github.com/pkg/errors" + "github.com/ossrs/go-oryx-lib/avc" "github.com/ossrs/go-oryx-lib/flv" "github.com/ossrs/go-oryx-lib/logger" @@ -472,7 +473,7 @@ func TestRtmpPublish_HttpFlvPlay(t *testing.T) { } } -func TestRtmpPublish_HttpFlvPlayNoAudio(t *testing.T) { +func TestRtmpPublish_HttpFlvPlayNoVideo(t *testing.T) { ctx := logger.WithContext(context.Background()) ctx, cancel := context.WithTimeout(ctx, time.Duration(*srsTimeout)*time.Millisecond) @@ -481,8 +482,8 @@ func TestRtmpPublish_HttpFlvPlayNoAudio(t *testing.T) { publisher := NewRTMPPublisher() defer publisher.Close() - // Set publisher to drop audio. - publisher.hasAudio = false + // Set publisher to drop video. + publisher.hasVideo = false player := NewFLVPlayer() defer player.Close() @@ -522,8 +523,8 @@ func TestRtmpPublish_HttpFlvPlayNoAudio(t *testing.T) { return nil } player.onRecvTag = func(tp flv.TagType, size, ts uint32, tag []byte) error { - if tp == flv.TagTypeAudio { - return errors.New("should no audio") + if tp == flv.TagTypeVideo { + return errors.New("should no video") } logger.Tf(ctx, "got %v tag, %v %vms %vB", nnPackets, tp, ts, len(tag)) if nnPackets += 1; nnPackets > 50 { @@ -555,7 +556,7 @@ func TestRtmpPublish_HttpFlvPlayNoAudio(t *testing.T) { } } -func TestRtmpPublish_HttpFlvPlayNoVideo(t *testing.T) { +func TestRtmpPublish_HttpFlvPlayNoAudio(t *testing.T) { ctx := logger.WithContext(context.Background()) ctx, cancel := context.WithTimeout(ctx, time.Duration(*srsTimeout)*time.Millisecond) @@ -564,8 +565,8 @@ func TestRtmpPublish_HttpFlvPlayNoVideo(t *testing.T) { publisher := NewRTMPPublisher() defer publisher.Close() - // Set publisher to drop video. - publisher.hasVideo = false + // Set publisher to drop audio. + publisher.hasAudio = false player := NewFLVPlayer() defer player.Close() @@ -605,8 +606,8 @@ func TestRtmpPublish_HttpFlvPlayNoVideo(t *testing.T) { return nil } player.onRecvTag = func(tp flv.TagType, size, ts uint32, tag []byte) error { - if tp == flv.TagTypeVideo { - return errors.New("should no video") + if tp == flv.TagTypeAudio { + return errors.New("should no audio") } logger.Tf(ctx, "got %v tag, %v %vms %vB", nnPackets, tp, ts, len(tag)) if nnPackets += 1; nnPackets > 50 {