mirror of
				https://github.com/ossrs/srs.git
				synced 2025-03-09 15:49:59 +00:00 
			
		
		
		
	Test: Refine blackbox test args.
This commit is contained in:
		
							parent
							
								
									e655948e96
								
							
						
					
					
						commit
						fb1790230b
					
				
					 2 changed files with 16 additions and 16 deletions
				
			
		
							
								
								
									
										8
									
								
								trunk/3rdparty/srs-bench/README.md
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										8
									
								
								trunk/3rdparty/srs-bench/README.md
									
										
									
									
										vendored
									
									
								
							| 
						 | 
					@ -262,10 +262,10 @@ make && ./objs/srs_blackbox_test -test.v
 | 
				
			||||||
其他不常用参数:
 | 
					其他不常用参数:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
* `-srs-log`,是否开启详细日志。默认值:`false`
 | 
					* `-srs-log`,是否开启详细日志。默认值:`false`
 | 
				
			||||||
* `-srs-stdout`,是否开启SRS的stdout详细日志。默认值:`false`
 | 
					* `-srs-server-log`,是否开启SRS的stdout详细日志。默认值:`false`
 | 
				
			||||||
* `-srs-ffmpeg-stderr`,是否开启FFmpeg的stderr详细日志。默认值:`false`
 | 
					* `-srs-ffmpeg-log`,是否开启FFmpeg的stderr详细日志。默认值:`false`
 | 
				
			||||||
* `-srs-dvr-stderr`,是否开启DVR的stderr详细日志。默认值:`false`
 | 
					* `-srs-dvr-log`,是否开启DVR的stderr详细日志。默认值:`false`
 | 
				
			||||||
* `-srs-ffprobe-stdout`,是否开启FFprobe的stdout详细日志。默认值:`false`
 | 
					* `-srs-ffprobe-log`,是否开启FFprobe的stdout详细日志。默认值:`false`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
由于每个黑盒的用例时间都很长,可以开启并行:
 | 
					由于每个黑盒的用例时间都很长,可以开启并行:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										24
									
								
								trunk/3rdparty/srs-bench/blackbox/util.go
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										24
									
								
								trunk/3rdparty/srs-bench/blackbox/util.go
									
										
									
									
										vendored
									
									
								
							| 
						 | 
					@ -44,10 +44,10 @@ import (
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
var srsLog *bool
 | 
					var srsLog *bool
 | 
				
			||||||
var srsStdout *bool
 | 
					var srsServerLog *bool
 | 
				
			||||||
var srsFFmpegStderr *bool
 | 
					var srsFFmpegLog *bool
 | 
				
			||||||
var srsDVRStderr *bool
 | 
					var srsDVRLog *bool
 | 
				
			||||||
var srsFFprobeStdout *bool
 | 
					var srsFFprobeLog *bool
 | 
				
			||||||
 | 
					
 | 
				
			||||||
var srsTimeout *int
 | 
					var srsTimeout *int
 | 
				
			||||||
var srsFFprobeDuration *int
 | 
					var srsFFprobeDuration *int
 | 
				
			||||||
| 
						 | 
					@ -61,10 +61,10 @@ var srsPublishAvatar *string
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func prepareTest() (err error) {
 | 
					func prepareTest() (err error) {
 | 
				
			||||||
	srsLog = flag.Bool("srs-log", false, "Whether enable the detail log")
 | 
						srsLog = flag.Bool("srs-log", false, "Whether enable the detail log")
 | 
				
			||||||
	srsStdout = flag.Bool("srs-stdout", false, "Whether enable the SRS stdout log")
 | 
						srsServerLog = flag.Bool("srs-server-log", false, "Whether enable the SRS stdout log")
 | 
				
			||||||
	srsFFmpegStderr = flag.Bool("srs-ffmpeg-stderr", false, "Whether enable the FFmpeg stderr log")
 | 
						srsFFmpegLog = flag.Bool("srs-ffmpeg-log", false, "Whether enable the FFmpeg stderr log")
 | 
				
			||||||
	srsDVRStderr = flag.Bool("srs-dvr-stderr", false, "Whether enable the DVR stderr log")
 | 
						srsDVRLog = flag.Bool("srs-dvr-log", false, "Whether enable the DVR stderr log")
 | 
				
			||||||
	srsFFprobeStdout = flag.Bool("srs-ffprobe-stdout", false, "Whether enable the FFprobe stdout log")
 | 
						srsFFprobeLog = flag.Bool("srs-ffprobe-log", false, "Whether enable the FFprobe stdout log")
 | 
				
			||||||
	srsTimeout = flag.Int("srs-timeout", 64000, "For each case, the timeout in ms")
 | 
						srsTimeout = flag.Int("srs-timeout", 64000, "For each case, the timeout in ms")
 | 
				
			||||||
	srsFFprobeDuration = flag.Int("srs-ffprobe-duration", 16000, "For each case, the duration for ffprobe in ms")
 | 
						srsFFprobeDuration = flag.Int("srs-ffprobe-duration", 16000, "For each case, the duration for ffprobe in ms")
 | 
				
			||||||
	srsFFprobeTimeout = flag.Int("srs-ffprobe-timeout", 21000, "For each case, the timeout for ffprobe in ms")
 | 
						srsFFprobeTimeout = flag.Int("srs-ffprobe-timeout", 21000, "For each case, the timeout for ffprobe in ms")
 | 
				
			||||||
| 
						 | 
					@ -623,7 +623,7 @@ func (v *srsServer) Run(ctx context.Context, cancel context.CancelFunc) error {
 | 
				
			||||||
		defer v.readyCtxCancel()
 | 
							defer v.readyCtxCancel()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		logger.Tf(ctx, "SRS process pid=%v exit, r0=%v", bs.pid, r0)
 | 
							logger.Tf(ctx, "SRS process pid=%v exit, r0=%v", bs.pid, r0)
 | 
				
			||||||
		if *srsStdout == true {
 | 
							if *srsServerLog == true {
 | 
				
			||||||
			logger.Tf(ctx, "SRS process pid=%v, stdout is \n%v", bs.pid, stdout.String())
 | 
								logger.Tf(ctx, "SRS process pid=%v, stdout is \n%v", bs.pid, stdout.String())
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		if stderr.Len() > 0 {
 | 
							if stderr.Len() > 0 {
 | 
				
			||||||
| 
						 | 
					@ -688,7 +688,7 @@ func (v *ffmpegClient) Run(ctx context.Context, cancel context.CancelFunc) error
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	v.process.onStop = func(ctx context.Context, bs *backendService, cmd *exec.Cmd, r0 error, stdout, stderr *bytes.Buffer) error {
 | 
						v.process.onStop = func(ctx context.Context, bs *backendService, cmd *exec.Cmd, r0 error, stdout, stderr *bytes.Buffer) error {
 | 
				
			||||||
		logger.Tf(ctx, "FFmpeg process pid=%v exit, r0=%v, stdout=%v", bs.pid, r0, stdout.String())
 | 
							logger.Tf(ctx, "FFmpeg process pid=%v exit, r0=%v, stdout=%v", bs.pid, r0, stdout.String())
 | 
				
			||||||
		if *srsFFmpegStderr && stderr.Len() > 0 {
 | 
							if *srsFFmpegLog && stderr.Len() > 0 {
 | 
				
			||||||
			logger.Tf(ctx, "FFmpeg process pid=%v, stderr is \n%v", bs.pid, stderr.String())
 | 
								logger.Tf(ctx, "FFmpeg process pid=%v, stderr is \n%v", bs.pid, stderr.String())
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		return nil
 | 
							return nil
 | 
				
			||||||
| 
						 | 
					@ -837,7 +837,7 @@ func (v *ffprobeClient) doDVR(ctx context.Context) error {
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	process.onStop = func(ctx context.Context, bs *backendService, cmd *exec.Cmd, r0 error, stdout, stderr *bytes.Buffer) error {
 | 
						process.onStop = func(ctx context.Context, bs *backendService, cmd *exec.Cmd, r0 error, stdout, stderr *bytes.Buffer) error {
 | 
				
			||||||
		logger.Tf(ctx, "DVR process pid=%v exit, r0=%v, stdout=%v", bs.pid, r0, stdout.String())
 | 
							logger.Tf(ctx, "DVR process pid=%v exit, r0=%v, stdout=%v", bs.pid, r0, stdout.String())
 | 
				
			||||||
		if *srsDVRStderr && stderr.Len() > 0 {
 | 
							if *srsDVRLog && stderr.Len() > 0 {
 | 
				
			||||||
			logger.Tf(ctx, "DVR process pid=%v, stderr is \n%v", bs.pid, stderr.String())
 | 
								logger.Tf(ctx, "DVR process pid=%v, stderr is \n%v", bs.pid, stderr.String())
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		return nil
 | 
							return nil
 | 
				
			||||||
| 
						 | 
					@ -868,7 +868,7 @@ func (v *ffprobeClient) doProbe(ctx context.Context, cancel context.CancelFunc)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	process.onStop = func(ctx context.Context, bs *backendService, cmd *exec.Cmd, r0 error, stdout, stderr *bytes.Buffer) error {
 | 
						process.onStop = func(ctx context.Context, bs *backendService, cmd *exec.Cmd, r0 error, stdout, stderr *bytes.Buffer) error {
 | 
				
			||||||
		logger.Tf(ctx, "FFprobe process pid=%v exit, r0=%v, stderr=%v", bs.pid, r0, stderr.String())
 | 
							logger.Tf(ctx, "FFprobe process pid=%v exit, r0=%v, stderr=%v", bs.pid, r0, stderr.String())
 | 
				
			||||||
		if *srsFFprobeStdout && stdout.Len() > 0 {
 | 
							if *srsFFprobeLog && stdout.Len() > 0 {
 | 
				
			||||||
			logger.Tf(ctx, "FFprobe process pid=%v, stdout is \n%v", bs.pid, stdout.String())
 | 
								logger.Tf(ctx, "FFprobe process pid=%v, stdout is \n%v", bs.pid, stdout.String())
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue