build: reorganise build: abi4, fallback, prebuild cli
- ABI4 by default, fallback to abi 3. - aa-prebuild cli that can be used by other project shipping profiles. - --file option to cli to only build one dev profile. - add abi version filter to only & exclude directives.
This commit is contained in:
parent
d6b7bef89e
commit
59ac54e2fc
39 changed files with 473 additions and 440 deletions
|
|
@ -8,7 +8,7 @@ import (
|
|||
"slices"
|
||||
"testing"
|
||||
|
||||
"github.com/roddhjav/apparmor.d/pkg/prebuild/cfg"
|
||||
"github.com/roddhjav/apparmor.d/pkg/prebuild"
|
||||
)
|
||||
|
||||
func TestBuilder_Apply(t *testing.T) {
|
||||
|
|
@ -23,17 +23,17 @@ func TestBuilder_Apply(t *testing.T) {
|
|||
name: "abi3",
|
||||
b: Builders["abi3"],
|
||||
profile: `
|
||||
abi <abi/3.0>,
|
||||
profile test {
|
||||
# userns,
|
||||
# mqueue r type=posix /,
|
||||
}`,
|
||||
want: `
|
||||
abi <abi/4.0>,
|
||||
profile test {
|
||||
userns,
|
||||
mqueue r type=posix /,
|
||||
}`,
|
||||
want: `
|
||||
abi <abi/3.0>,
|
||||
profile test {
|
||||
# userns,
|
||||
# mqueue r type=posix /,
|
||||
}`,
|
||||
},
|
||||
{
|
||||
name: "complain-1",
|
||||
|
|
@ -234,7 +234,7 @@ func TestBuilder_Apply(t *testing.T) {
|
|||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
opt := &Option{File: cfg.RootApparmord.Join(tt.name)}
|
||||
opt := &Option{File: prebuild.RootApparmord.Join(tt.name)}
|
||||
got, err := tt.b.Apply(opt, tt.profile)
|
||||
if (err != nil) != tt.wantErr {
|
||||
t.Errorf("Builder.Apply() error = %v, wantErr %v", err, tt.wantErr)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue