Add -dump-headers and -dump-bodies flags for operations test debugging

This commit is contained in:
Nick Craig-Wood 2015-12-29 00:17:39 +00:00
parent afaec1a2e9
commit 113624691a

View File

@ -38,6 +38,8 @@ var (
RemoteName = flag.String("remote", "", "Remote to test with, defaults to local filesystem") RemoteName = flag.String("remote", "", "Remote to test with, defaults to local filesystem")
SubDir = flag.Bool("subdir", false, "Set to test with a sub directory") SubDir = flag.Bool("subdir", false, "Set to test with a sub directory")
Verbose = flag.Bool("verbose", false, "Set to enable logging") Verbose = flag.Bool("verbose", false, "Set to enable logging")
DumpHeaders = flag.Bool("dump-headers", false, "Set to dump headers (needs -verbose)")
DumpBodies = flag.Bool("dump-bodies", false, "Set to dump bodies (needs -verbose)")
finalise func() finalise func()
) )
@ -68,6 +70,8 @@ func TestInit(t *testing.T) {
fs.LoadConfig() fs.LoadConfig()
fs.Config.Verbose = *Verbose fs.Config.Verbose = *Verbose
fs.Config.Quiet = !*Verbose fs.Config.Quiet = !*Verbose
fs.Config.DumpHeaders = *DumpHeaders
fs.Config.DumpBodies = *DumpBodies
var err error var err error
fremote, finalise, err = fstest.RandomRemote(*RemoteName, *SubDir) fremote, finalise, err = fstest.RandomRemote(*RemoteName, *SubDir)
if err != nil { if err != nil {