refractor(build): move os logic to its own module.
This commit is contained in:
parent
662dd1c6dc
commit
e1d1d0be3d
9 changed files with 158 additions and 86 deletions
|
|
@ -15,7 +15,7 @@ import (
|
|||
"github.com/roddhjav/apparmor.d/pkg/aa"
|
||||
"github.com/roddhjav/apparmor.d/pkg/integration"
|
||||
"github.com/roddhjav/apparmor.d/pkg/logging"
|
||||
"github.com/roddhjav/apparmor.d/pkg/prebuild"
|
||||
oss "github.com/roddhjav/apparmor.d/pkg/os"
|
||||
)
|
||||
|
||||
const usage = `aa-test [-h] [--bootstrap | --run | --list]
|
||||
|
|
@ -123,7 +123,7 @@ func testDeps(dryRun bool) error {
|
|||
}
|
||||
|
||||
deps := tSuite.GetDependencies()
|
||||
switch prebuild.Distribution {
|
||||
switch oss.Distribution {
|
||||
case "arch":
|
||||
arg := []string{"pacman", "-Sy", "--noconfirm"}
|
||||
arg = append(arg, deps...)
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import (
|
|||
"os"
|
||||
|
||||
"github.com/roddhjav/apparmor.d/pkg/logging"
|
||||
oss "github.com/roddhjav/apparmor.d/pkg/os"
|
||||
"github.com/roddhjav/apparmor.d/pkg/prebuild"
|
||||
)
|
||||
|
||||
|
|
@ -46,7 +47,7 @@ func init() {
|
|||
}
|
||||
|
||||
func aaPrebuild() error {
|
||||
logging.Step("Building apparmor.d profiles for %s.", prebuild.Distribution)
|
||||
logging.Step("Building apparmor.d profiles for %s.", oss.Distribution)
|
||||
|
||||
if full {
|
||||
prebuild.Prepares = append(prebuild.Prepares, prebuild.SetFullSystemPolicy)
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import (
|
|||
"os/exec"
|
||||
"testing"
|
||||
|
||||
oss "github.com/roddhjav/apparmor.d/pkg/os"
|
||||
"github.com/roddhjav/apparmor.d/pkg/prebuild"
|
||||
)
|
||||
|
||||
|
|
@ -71,7 +72,7 @@ func Test_AAPrebuild(t *testing.T) {
|
|||
chdirGitRoot()
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
prebuild.Distribution = tt.dist
|
||||
oss.Distribution = tt.dist
|
||||
if tt.full {
|
||||
prebuild.Prepares = append(prebuild.Prepares, prebuild.SetFullSystemPolicy)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue