diff options
Diffstat (limited to 'test')
-rwxr-xr-x | test/apiv2/test-apiv2 | 2 | ||||
-rw-r--r-- | test/e2e/network_create_test.go | 41 | ||||
-rw-r--r-- | test/system/260-sdnotify.bats | 13 | ||||
-rw-r--r-- | test/system/400-unprivileged-access.bats | 2 | ||||
-rwxr-xr-x | test/system/helpers.t | 2 | ||||
-rwxr-xr-x | test/test_podman_baseline.sh | 4 | ||||
-rw-r--r-- | test/test_podman_build.sh | 2 | ||||
-rwxr-xr-x | test/test_podman_pods.sh | 2 |
8 files changed, 58 insertions, 10 deletions
diff --git a/test/apiv2/test-apiv2 b/test/apiv2/test-apiv2 index d0bf28b9a..2f01783ff 100755 --- a/test/apiv2/test-apiv2 +++ b/test/apiv2/test-apiv2 @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # Usage: test-apiv2 [PORT] # diff --git a/test/e2e/network_create_test.go b/test/e2e/network_create_test.go index fcd324cd1..f97e6c1f1 100644 --- a/test/e2e/network_create_test.go +++ b/test/e2e/network_create_test.go @@ -178,6 +178,47 @@ var _ = Describe("Podman network create", func() { Expect(subnet.Contains(containerIP)).To(BeTrue()) }) + It("podman network create with name and IPv6 subnet", func() { + SkipIfRemote() + var ( + results []network.NcList + ) + nc := podmanTest.Podman([]string{"network", "create", "--subnet", "fd00:1:2:3:4::/64", "newIPv6network"}) + nc.WaitWithDefaultTimeout() + Expect(nc.ExitCode()).To(BeZero()) + + defer podmanTest.removeCNINetwork("newIPv6network") + + // Inspect the network configuration + inspect := podmanTest.Podman([]string{"network", "inspect", "newIPv6network"}) + inspect.WaitWithDefaultTimeout() + + // JSON the network configuration into something usable + err := json.Unmarshal([]byte(inspect.OutputToString()), &results) + Expect(err).To(BeNil()) + result := results[0] + Expect(result["name"]).To(Equal("newIPv6network")) + + // JSON the bridge info + bridgePlugin, err := genericPluginsToBridge(result["plugins"], "bridge") + Expect(err).To(BeNil()) + Expect(bridgePlugin.IPAM.Routes[0].Dest).To(Equal("::/0")) + + // Once a container executes a new network, the nic will be created. We should clean those up + // best we can + defer removeNetworkDevice(bridgePlugin.BrName) + + try := podmanTest.Podman([]string{"run", "-it", "--rm", "--network", "newIPv6network", ALPINE, "sh", "-c", "ip addr show eth0 | grep global | awk ' /inet6 / {print $2}'"}) + try.WaitWithDefaultTimeout() + + _, subnet, err := net.ParseCIDR("fd00:1:2:3:4::/64") + Expect(err).To(BeNil()) + containerIP, _, err := net.ParseCIDR(try.OutputToString()) + Expect(err).To(BeNil()) + // Ensure that the IP the container got is within the subnet the user asked for + Expect(subnet.Contains(containerIP)).To(BeTrue()) + }) + It("podman network create with invalid subnet", func() { nc := podmanTest.Podman([]string{"network", "create", "--subnet", "10.11.12.0/17000", "fail"}) nc.WaitWithDefaultTimeout() diff --git a/test/system/260-sdnotify.bats b/test/system/260-sdnotify.bats index c37eea15a..6bc9fc02e 100644 --- a/test/system/260-sdnotify.bats +++ b/test/system/260-sdnotify.bats @@ -12,8 +12,15 @@ _SOCAT_LOG= function setup() { skip_if_remote - # TODO: remove this once CI systems have newer crun and container-selinux - skip "TEMPORARY SKIP - until CI systems get new crun, container-selinux" + # Skip if systemd is not running + systemctl list-units &>/dev/null || skip "systemd not available" + + # sdnotify fails with runc 1.0.0-3-dev2 on Ubuntu. Let's just + # assume that we work only with crun, nothing else. + run_podman info --format '{{ .Host.OCIRuntime.Name }}' + if [[ "$output" != "crun" ]]; then + skip "this test only works with crun, not '$output'" + fi basic_setup } @@ -107,7 +114,7 @@ function _assert_mainpid_is_conmon() { @test "sdnotify : container" { # Sigh... we need to pull a humongous image because it has systemd-notify. # FIXME: is there a smaller image we could use? - _FEDORA=registry.fedoraproject.org/fedora:latest + _FEDORA=registry.fedoraproject.org/fedora:31 # Pull that image. Retry in case of flakes. run_podman pull $_FEDORA || \ diff --git a/test/system/400-unprivileged-access.bats b/test/system/400-unprivileged-access.bats index 1b2d14554..142d7dcd9 100644 --- a/test/system/400-unprivileged-access.bats +++ b/test/system/400-unprivileged-access.bats @@ -23,7 +23,7 @@ load helpers # as a user, the parent directory must be world-readable. test_script=$PODMAN_TMPDIR/fail-if-writable cat >$test_script <<"EOF" -#!/bin/bash +#!/usr/bin/env bash path="$1" diff --git a/test/system/helpers.t b/test/system/helpers.t index bee09505c..7a331174b 100755 --- a/test/system/helpers.t +++ b/test/system/helpers.t @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # regression tests for helpers.bash # diff --git a/test/test_podman_baseline.sh b/test/test_podman_baseline.sh index d205f544a..3624d24c2 100755 --- a/test/test_podman_baseline.sh +++ b/test/test_podman_baseline.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # test_podman_baseline.sh # A script to be run at the command line with Podman installed. # This should be run against a new kit to provide base level testing @@ -215,7 +215,7 @@ podman run $image ls / ######## FILE=./runecho.sh /bin/cat <<EOM >$FILE -#!/bin/bash +#!/usr/bin/env bash for i in {1..9}; do echo "This is a new container pull ipbabble [" \$i "]" diff --git a/test/test_podman_build.sh b/test/test_podman_build.sh index e3e53cae6..29b7354b1 100644 --- a/test/test_podman_build.sh +++ b/test/test_podman_build.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # test_podman_build.sh # diff --git a/test/test_podman_pods.sh b/test/test_podman_pods.sh index f2f47f510..c19f4fcab 100755 --- a/test/test_podman_pods.sh +++ b/test/test_podman_pods.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # test_podman_pods.sh # A script to be run at the command line with Podman installed. # This should be run against a new kit to provide base level testing |