@@ -40,6 +40,20 @@ func TestDumpCmd(t *testing.T) {
4040 DBConn : database.Connection {Host : "abc" , Port : defaultPort },
4141 FilenamePattern : "db_backup_{{ .now }}.{{ .compression }}" ,
4242 }, core.TimerOptions {Frequency : defaultFrequency , Begin : defaultBegin }, nil },
43+ {"file URL with pass-file" , []string {"--server" , "abc" , "--target" , "file:///foo/bar" , "--pass-file" , "testdata/password.txt" }, "" , false , core.DumpOptions {
44+ Targets : []storage.Storage {file .New (* fileTargetURL )},
45+ MaxAllowedPacket : defaultMaxAllowedPacket ,
46+ Compressor : & compression.GzipCompressor {},
47+ DBConn : database.Connection {Host : "abc" , Port : defaultPort , Pass : "testpassword" },
48+ FilenamePattern : "db_backup_{{ .now }}.{{ .compression }}" ,
49+ }, core.TimerOptions {Frequency : defaultFrequency , Begin : defaultBegin }, nil },
50+ {"file URL with pass and pass-file (pass takes precedence)" , []string {"--server" , "abc" , "--target" , "file:///foo/bar" , "--pass" , "explicitpass" , "--pass-file" , "testdata/password.txt" }, "" , false , core.DumpOptions {
51+ Targets : []storage.Storage {file .New (* fileTargetURL )},
52+ MaxAllowedPacket : defaultMaxAllowedPacket ,
53+ Compressor : & compression.GzipCompressor {},
54+ DBConn : database.Connection {Host : "abc" , Port : defaultPort , Pass : "explicitpass" },
55+ FilenamePattern : "db_backup_{{ .now }}.{{ .compression }}" ,
56+ }, core.TimerOptions {Frequency : defaultFrequency , Begin : defaultBegin }, nil },
4357 {"file URL with prune" , []string {"--server" , "abc" , "--target" , "file:///foo/bar" , "--retention" , "1h" }, "" , false , core.DumpOptions {
4458 Targets : []storage.Storage {file .New (* fileTargetURL )},
4559 MaxAllowedPacket : defaultMaxAllowedPacket ,
0 commit comments