Switch to moby/sys/capability

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
Kir Kolyshkin
2024-09-30 14:54:43 -07:00
parent 6a91149b53
commit 28e01cc8cc
3 changed files with 5 additions and 5 deletions

View File

@@ -8,9 +8,9 @@ import (
"strings"
. "github.com/containers/podman/v5/test/utils"
"github.com/moby/sys/capability"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"github.com/syndtr/gocapability/capability"
)
// helper function for confirming that container capabilities are equal
@@ -32,7 +32,7 @@ func containerCapMatchesHost(ctrCap string, hostCap string) {
// and host caps must always be a superset (inclusive) of container
Expect(hostCapN).To(BeNumerically(">", 0), "host cap %q should be nonzero", hostCap)
Expect(hostCapN).To(BeNumerically(">=", ctrCapN), "host cap %q should never be less than container cap %q", hostCap, ctrCap)
hostCapMasked := hostCapN & (1<<len(capability.List()) - 1)
hostCapMasked := hostCapN & (1<<len(capability.ListKnown()) - 1)
Expect(ctrCapN).To(Equal(hostCapMasked), "container cap %q is not a subset of host cap %q", ctrCap, hostCap)
}