aa-log: add -f option to set a log file.
This commit is contained in:
parent
ba0ccc3edc
commit
6876938719
4 changed files with 47 additions and 13 deletions
|
|
@ -131,26 +131,26 @@ func TestAppArmorLogs_String(t *testing.T) {
|
|||
func Test_app(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
args []string
|
||||
path string
|
||||
profile string
|
||||
wantErr bool
|
||||
}{
|
||||
{
|
||||
name: "OK",
|
||||
args: []string{"aa-log", ""},
|
||||
path: "../../tests/audit.log",
|
||||
profile: "",
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
name: "No logfile",
|
||||
args: []string{"aa-log", ""},
|
||||
path: "../../tests/log",
|
||||
profile: "",
|
||||
wantErr: true,
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
if err := aaLog(tt.args, tt.path); (err != nil) != tt.wantErr {
|
||||
if err := aaLog(tt.path, tt.profile); (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