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:
Alexandre Pujol 2024-10-02 16:22:46 +01:00
parent d6b7bef89e
commit 59ac54e2fc
No known key found for this signature in database
GPG key ID: C5469996F0DF68EC
39 changed files with 473 additions and 440 deletions

View file

@ -8,7 +8,7 @@ import (
"testing"
"github.com/roddhjav/apparmor.d/pkg/paths"
"github.com/roddhjav/apparmor.d/pkg/prebuild/cfg"
"github.com/roddhjav/apparmor.d/pkg/prebuild"
)
func TestExec_Apply(t *testing.T) {
@ -51,7 +51,7 @@ func TestExec_Apply(t *testing.T) {
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
cfg.RootApparmord = tt.rootApparmord
prebuild.RootApparmord = tt.rootApparmord
got, err := Directives["exec"].Apply(tt.opt, tt.profile)
if (err != nil) != tt.wantErr {
t.Errorf("Exec.Apply() error = %v, wantErr %v", err, tt.wantErr)