feat(aa-log): add -a option to anonymize the logs.
This commit is contained in:
parent
26bd9350f2
commit
538da05696
4 changed files with 117 additions and 7 deletions
|
|
@ -14,6 +14,7 @@ func Test_app(t *testing.T) {
|
|||
logger string
|
||||
path string
|
||||
profile string
|
||||
anon bool
|
||||
wantErr bool
|
||||
}{
|
||||
{
|
||||
|
|
@ -21,6 +22,7 @@ func Test_app(t *testing.T) {
|
|||
logger: "auditd",
|
||||
path: "../../tests/audit.log",
|
||||
profile: "",
|
||||
anon: true,
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
|
|
@ -28,6 +30,7 @@ func Test_app(t *testing.T) {
|
|||
logger: "systemd",
|
||||
path: "../../tests/systemd.log",
|
||||
profile: "",
|
||||
anon: false,
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
|
|
@ -35,6 +38,7 @@ func Test_app(t *testing.T) {
|
|||
logger: "auditd",
|
||||
path: "../../tests/log",
|
||||
profile: "",
|
||||
anon: false,
|
||||
wantErr: true,
|
||||
},
|
||||
{
|
||||
|
|
@ -42,12 +46,13 @@ func Test_app(t *testing.T) {
|
|||
logger: "raw",
|
||||
path: "../../tests/audit.log",
|
||||
profile: "",
|
||||
anon: false,
|
||||
wantErr: true,
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
if err := aaLog(tt.logger, tt.path, tt.profile); (err != nil) != tt.wantErr {
|
||||
if err := aaLog(tt.logger, tt.path, tt.profile, tt.anon); (err != nil) != tt.wantErr {
|
||||
t.Errorf("aaLog() error = %v, wantErr %v", err, tt.wantErr)
|
||||
}
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue