mirror of
https://github.com/roddhjav/apparmor.d.git
synced 2025-01-18 08:58:15 +01:00
fix: userspace prebuild test.
This commit is contained in:
parent
cfd4786f76
commit
fd46c0de30
1 changed files with 4 additions and 3 deletions
|
@ -7,6 +7,8 @@ package builder
|
||||||
import (
|
import (
|
||||||
"slices"
|
"slices"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
"github.com/roddhjav/apparmor.d/pkg/prebuild/cfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestBuilder_Apply(t *testing.T) {
|
func TestBuilder_Apply(t *testing.T) {
|
||||||
|
@ -216,7 +218,7 @@ func TestBuilder_Apply(t *testing.T) {
|
||||||
}`,
|
}`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "userspace-1",
|
name: "userspace-2",
|
||||||
b: Builders["userspace"],
|
b: Builders["userspace"],
|
||||||
profile: `
|
profile: `
|
||||||
profile foo /usr/bin/foo {
|
profile foo /usr/bin/foo {
|
||||||
|
@ -238,7 +240,7 @@ func TestBuilder_Apply(t *testing.T) {
|
||||||
}
|
}
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
t.Run(tt.name, func(t *testing.T) {
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
opt := &Option{}
|
opt := &Option{File: cfg.RootApparmord.Join(tt.name)}
|
||||||
got, err := tt.b.Apply(opt, tt.profile)
|
got, err := tt.b.Apply(opt, tt.profile)
|
||||||
if (err != nil) != tt.wantErr {
|
if (err != nil) != tt.wantErr {
|
||||||
t.Errorf("Builder.Apply() error = %v, wantErr %v", err, tt.wantErr)
|
t.Errorf("Builder.Apply() error = %v, wantErr %v", err, tt.wantErr)
|
||||||
|
@ -264,7 +266,6 @@ func TestRegister(t *testing.T) {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
|
|
||||||
t.Run(tt.name, func(t *testing.T) {
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
Register(tt.names...)
|
Register(tt.names...)
|
||||||
for _, name := range tt.names {
|
for _, name := range tt.names {
|
||||||
|
|
Loading…
Reference in a new issue