Data scrubbing options for protecting sensitive data https://godoc.org/maze.io/x/scrub
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
604 B

package scrub
import "testing"
func TestCommandScrubber(t *testing.T) {
var tests = []struct {
Test, Want string
}{
{"/usr/bin/mysqldump", "/usr/bin/mysqldump"},
{"mysqldump -u john -h localhost", "mysqldump -u john -h localhost"},
{"mysqldump -u john -p testing -h localhost", "mysqldump -u john -p*redacted* -h localhost"},
{"/opt/sap/bin/mysqldump -u john -p testing -h localhost", "/opt/sap/bin/mysqldump -u john -p*redacted* -h localhost"},
}
for _, test := range tests {
if v := Command.Scrub(test.Test); v != test.Want {
t.Errorf("expected %q, got %q", test.Want, v)
}
}
}