Skip to content

Commit

Permalink
CI: load ipv6 kernel modules for rootless tests
Browse files Browse the repository at this point in the history
Rootless cni with ipv6 needs the `ip6_tables` module loaded, normally
the cni plugins will load this module but as rootless it does not have
the necessary permission to do so. Therefore we load it manually.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
  • Loading branch information
Luap99 committed Sep 15, 2021
1 parent b906b9d commit 1bcd006
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 3 additions & 0 deletions contrib/cirrus/setup_environment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@ esac
case "$PRIV_NAME" in
root) ;;
rootless)
# load kernel modules since the rootless user has no permission to do so
modprobe ip6_tables || :
modprobe ip6table_nat || :
# Needs to exist for setup_rootless()
ROOTLESS_USER="${ROOTLESS_USER:-some${RANDOM}dude}"
echo "ROOTLESS_USER=$ROOTLESS_USER" >> /etc/ci_environment
Expand Down
3 changes: 0 additions & 3 deletions test/e2e/network_create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ var _ = Describe("Podman network create", func() {
})

It("podman network create with name and IPv6 subnet", func() {
SkipIfRootless("FIXME It needs the ip6tables modules loaded")
netName := "ipv6-" + stringid.GenerateNonCryptoID()
nc := podmanTest.Podman([]string{"network", "create", "--subnet", "fd00:1:2:3:4::/64", netName})
nc.WaitWithDefaultTimeout()
Expand Down Expand Up @@ -121,7 +120,6 @@ var _ = Describe("Podman network create", func() {
})

It("podman network create with name and IPv6 flag (dual-stack)", func() {
SkipIfRootless("FIXME It needs the ip6tables modules loaded")
netName := "dual-" + stringid.GenerateNonCryptoID()
nc := podmanTest.Podman([]string{"network", "create", "--subnet", "fd00:4:3:2::/64", "--ipv6", netName})
nc.WaitWithDefaultTimeout()
Expand Down Expand Up @@ -275,7 +273,6 @@ var _ = Describe("Podman network create", func() {
})

It("podman network create two IPv6 networks with same subnet should fail", func() {
SkipIfRootless("FIXME It needs the ip6tables modules loaded")
netName1 := "subipv61-" + stringid.GenerateNonCryptoID()
nc := podmanTest.Podman([]string{"network", "create", "--subnet", "fd00:4:4:4:4::/64", "--ipv6", netName1})
nc.WaitWithDefaultTimeout()
Expand Down

0 comments on commit 1bcd006

Please sign in to comment.