summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2017-12-20 15:13:52 -0600
committerAtomic Bot <atomic-devel@projectatomic.io>2017-12-22 19:23:36 +0000
commit7f531263e6e41195278f205ad01274487cc1c1e0 (patch)
tree1e162ee89a8302e16e743ec8d884f62d193ef2ef /test
parentb08ac1065ca0201cd66cf53bf6fc75470a70f398 (diff)
downloadpodman-7f531263e6e41195278f205ad01274487cc1c1e0.tar.gz
podman-7f531263e6e41195278f205ad01274487cc1c1e0.tar.bz2
podman-7f531263e6e41195278f205ad01274487cc1c1e0.zip
Add default CNI configuration
podman needs a pair of configuration files to set up its default network configuration: a bridge and loopback file. Signed-off-by: baude <bbaude@redhat.com> Closes: #161 Approved by: baude
Diffstat (limited to 'test')
-rw-r--r--test/helpers.bash62
-rw-r--r--test/podman_attach.bats1
-rw-r--r--test/podman_commit.bats1
-rw-r--r--test/podman_create.bats1
-rw-r--r--test/podman_diff.bats1
-rw-r--r--test/podman_exec.bats1
-rw-r--r--test/podman_export.bats1
-rw-r--r--test/podman_history.bats1
-rw-r--r--test/podman_images.bats4
-rw-r--r--test/podman_import.bats1
-rw-r--r--test/podman_inspect.bats1
-rw-r--r--test/podman_kill.bats1
-rw-r--r--test/podman_load.bats1
-rw-r--r--test/podman_logs.bats1
-rw-r--r--test/podman_mount.bats1
-rw-r--r--test/podman_pause.bats1
-rw-r--r--test/podman_ps.bats1
-rw-r--r--test/podman_push.bats1
-rw-r--r--test/podman_rm.bats1
-rw-r--r--test/podman_run.bats1
-rw-r--r--test/podman_run_device.bats1
-rw-r--r--test/podman_run_ns.bats1
-rw-r--r--test/podman_save.bats1
-rw-r--r--test/podman_start.bats1
-rw-r--r--test/podman_stats.bats1
-rw-r--r--test/podman_stop.bats1
-rw-r--r--test/podman_top.bats1
-rw-r--r--test/podman_wait.bats1
28 files changed, 7 insertions, 85 deletions
diff --git a/test/helpers.bash b/test/helpers.bash
index 30f66f283..2ac203027 100644
--- a/test/helpers.bash
+++ b/test/helpers.bash
@@ -85,7 +85,7 @@ HOOKS_OPTS="--hooks-dir-path=$HOOKSDIR"
MOUNT_PATH="$TESTDIR/secrets"
mkdir ${MOUNT_PATH}
MOUNT_FILE="${MOUNT_PATH}/test.txt"
-touch ${MOUNT_FILE}
+touch ${MOUNT_FILE}}
echo "Testing secrets mounts!" > ${MOUNT_FILE}
DEFAULT_MOUNTS_OPTS="--default-mounts=${MOUNT_PATH}:/container/path1"
@@ -104,11 +104,16 @@ if [ -e /usr/sbin/selinuxenabled ] && /usr/sbin/selinuxenabled; then
filelabel=$(awk -F'"' '/^file.*=.*/ {print $2}' /etc/selinux/${SELINUXTYPE}/contexts/lxc_contexts)
chcon -R ${filelabel} $TESTDIR
fi
-LIBPOD_CNI_CONFIG="$TESTDIR/cni/net.d/"
+
+LIBPOD_CNI_CONFIG="$TESTDIR/etc/cni/net.d/"
LIBPOD_CNI_PLUGIN=${LIBPOD_CNI_PLUGIN:-/opt/cni/bin/}
POD_CIDR="10.88.0.0/16"
POD_CIDR_MASK="10.88.*.*"
+# Make sure the cni config dirs are created and populate them with the default configs
+mkdir -p ${LIBPOD_CNI_CONFIG}
+cp ${CRIO_ROOT}/cni/* ${LIBPOD_CNI_CONFIG}
+
PODMAN_OPTIONS="--root $TESTDIR/crio $STORAGE_OPTIONS --runroot $TESTDIR/crio-run --runtime ${RUNTIME_BINARY} --conmon ${CONMON_BINARY} --cni-config-dir ${LIBPOD_CNI_CONFIG}"
cp "$CONMON_BINARY" "$TESTDIR/conmon"
@@ -193,59 +198,6 @@ function is_apparmor_enabled() {
echo 0
}
-function prepare_network_conf() {
- mkdir -p $LIBPOD_CNI_CONFIG
- cat >$LIBPOD_CNI_CONFIG/10-crio.conf <<-EOF
-{
- "cniVersion": "0.2.0",
- "name": "crionet",
- "type": "bridge",
- "bridge": "cni0",
- "isGateway": true,
- "ipMasq": true,
- "ipam": {
- "type": "host-local",
- "subnet": "10.20.40.0/24",
- "routes": [
- { "dst": "0.0.0.0/0" }
- ]
- }
-}
-EOF
-
- cat >$LIBPOD_CNI_CONFIG/99-loopback.conf <<-EOF
-{
- "cniVersion": "0.2.0",
- "type": "loopback"
-}
-EOF
-
- echo 0
-}
-
-function prepare_plugin_test_args_network_conf() {
- mkdir -p $LIBPOD_CNI_CONFIG
- cat >$LIBPOD_CNI_CONFIG/10-plugin-test-args.conf <<-EOF
-{
- "cniVersion": "0.2.0",
- "name": "crionet_test_args",
- "type": "bridge-custom",
- "bridge": "cni0",
- "isGateway": true,
- "ipMasq": true,
- "ipam": {
- "type": "host-local",
- "subnet": "10.20.40.0/24",
- "routes": [
- { "dst": "0.0.0.0/0" }
- ]
- }
-}
-EOF
-
- echo 0
-}
-
function check_pod_cidr() {
run crioctl ctr execsync --id $1 ip addr show dev eth0 scope global 2>&1
echo "$output"
diff --git a/test/podman_attach.bats b/test/podman_attach.bats
index 1d3451eeb..9baaf339c 100644
--- a/test/podman_attach.bats
+++ b/test/podman_attach.bats
@@ -7,7 +7,6 @@ function teardown() {
}
function setup() {
- prepare_network_conf
copy_images
}
diff --git a/test/podman_commit.bats b/test/podman_commit.bats
index 46eaf32a4..9257743e9 100644
--- a/test/podman_commit.bats
+++ b/test/podman_commit.bats
@@ -9,7 +9,6 @@ function teardown() {
}
function setup() {
- prepare_network_conf
copy_images
}
diff --git a/test/podman_create.bats b/test/podman_create.bats
index a9f70cdfa..d7a9cd72e 100644
--- a/test/podman_create.bats
+++ b/test/podman_create.bats
@@ -3,7 +3,6 @@
load helpers
function setup() {
- prepare_network_conf
copy_images
}
diff --git a/test/podman_diff.bats b/test/podman_diff.bats
index 942af8805..9ed088807 100644
--- a/test/podman_diff.bats
+++ b/test/podman_diff.bats
@@ -3,7 +3,6 @@
load helpers
function setup() {
- prepare_network_conf
copy_images
}
diff --git a/test/podman_exec.bats b/test/podman_exec.bats
index 57f7217d8..76114aa0a 100644
--- a/test/podman_exec.bats
+++ b/test/podman_exec.bats
@@ -7,7 +7,6 @@ function teardown() {
}
function setup() {
- prepare_network_conf
copy_images
}
diff --git a/test/podman_export.bats b/test/podman_export.bats
index 2a620dc4a..3847ab14c 100644
--- a/test/podman_export.bats
+++ b/test/podman_export.bats
@@ -7,7 +7,6 @@ function teardown() {
}
function setup() {
- prepare_network_conf
copy_images
}
diff --git a/test/podman_history.bats b/test/podman_history.bats
index ea5aa8d31..2eeb1b5ac 100644
--- a/test/podman_history.bats
+++ b/test/podman_history.bats
@@ -7,7 +7,6 @@ function teardown() {
}
function setup() {
- prepare_network_conf
copy_images
}
diff --git a/test/podman_images.bats b/test/podman_images.bats
index f62508e80..b500f6b98 100644
--- a/test/podman_images.bats
+++ b/test/podman_images.bats
@@ -4,10 +4,6 @@ load helpers
IMAGE="busybox"
-function setup() {
- prepare_network_conf
-}
-
function teardown() {
cleanup_test
}
diff --git a/test/podman_import.bats b/test/podman_import.bats
index b665b789e..6303141c9 100644
--- a/test/podman_import.bats
+++ b/test/podman_import.bats
@@ -9,7 +9,6 @@ function teardown() {
}
function setup() {
- prepare_network_conf
copy_images
}
diff --git a/test/podman_inspect.bats b/test/podman_inspect.bats
index 197cc4556..5c353aae8 100644
--- a/test/podman_inspect.bats
+++ b/test/podman_inspect.bats
@@ -7,7 +7,6 @@ function teardown() {
}
function setup() {
- prepare_network_conf
copy_images
}
diff --git a/test/podman_kill.bats b/test/podman_kill.bats
index 88837aa8d..449603905 100644
--- a/test/podman_kill.bats
+++ b/test/podman_kill.bats
@@ -7,7 +7,6 @@ function teardown() {
}
function setup() {
- prepare_network_conf
copy_images
}
diff --git a/test/podman_load.bats b/test/podman_load.bats
index 1219144e4..6fe8638b6 100644
--- a/test/podman_load.bats
+++ b/test/podman_load.bats
@@ -3,7 +3,6 @@
load helpers
function setup() {
- prepare_network_conf
copy_images
}
diff --git a/test/podman_logs.bats b/test/podman_logs.bats
index 927f36bca..4c20654a7 100644
--- a/test/podman_logs.bats
+++ b/test/podman_logs.bats
@@ -7,7 +7,6 @@ function teardown() {
}
function setup() {
- prepare_network_conf
copy_images
}
diff --git a/test/podman_mount.bats b/test/podman_mount.bats
index 110cf0e93..bc6be1a19 100644
--- a/test/podman_mount.bats
+++ b/test/podman_mount.bats
@@ -9,7 +9,6 @@ function teardown() {
}
function setup() {
- prepare_network_conf
copy_images
}
diff --git a/test/podman_pause.bats b/test/podman_pause.bats
index 1075fa05f..768ffa53a 100644
--- a/test/podman_pause.bats
+++ b/test/podman_pause.bats
@@ -3,7 +3,6 @@
load helpers
function setup() {
- prepare_network_conf
copy_images
}
diff --git a/test/podman_ps.bats b/test/podman_ps.bats
index 3b904535c..b99c84304 100644
--- a/test/podman_ps.bats
+++ b/test/podman_ps.bats
@@ -4,7 +4,6 @@ load helpers
IMAGE="redis:alpine"
function setup() {
- prepare_network_conf
copy_images
}
diff --git a/test/podman_push.bats b/test/podman_push.bats
index cc9220bfd..82798b3fc 100644
--- a/test/podman_push.bats
+++ b/test/podman_push.bats
@@ -7,7 +7,6 @@ function teardown() {
}
function setup() {
- prepare_network_conf
copy_images
}
diff --git a/test/podman_rm.bats b/test/podman_rm.bats
index 8ef39435d..f6430711f 100644
--- a/test/podman_rm.bats
+++ b/test/podman_rm.bats
@@ -3,7 +3,6 @@
load helpers
function setup() {
- prepare_network_conf
copy_images
}
diff --git a/test/podman_run.bats b/test/podman_run.bats
index 57ae0872e..46b136fee 100644
--- a/test/podman_run.bats
+++ b/test/podman_run.bats
@@ -7,7 +7,6 @@ function teardown() {
}
function setup() {
- prepare_network_conf
copy_images
}
diff --git a/test/podman_run_device.bats b/test/podman_run_device.bats
index 98d6833eb..b5a901ff9 100644
--- a/test/podman_run_device.bats
+++ b/test/podman_run_device.bats
@@ -7,7 +7,6 @@ function teardown() {
}
function setup() {
- prepare_network_conf
copy_images
}
diff --git a/test/podman_run_ns.bats b/test/podman_run_ns.bats
index 8d1bd4b54..0d6e645c0 100644
--- a/test/podman_run_ns.bats
+++ b/test/podman_run_ns.bats
@@ -7,7 +7,6 @@ function teardown() {
}
function setup() {
- prepare_network_conf
copy_images
}
diff --git a/test/podman_save.bats b/test/podman_save.bats
index 2e03a95cc..27e627b8f 100644
--- a/test/podman_save.bats
+++ b/test/podman_save.bats
@@ -7,7 +7,6 @@ function teardown() {
}
function setup() {
- prepare_network_conf
copy_images
}
diff --git a/test/podman_start.bats b/test/podman_start.bats
index 025316462..50cbf43dc 100644
--- a/test/podman_start.bats
+++ b/test/podman_start.bats
@@ -3,7 +3,6 @@
load helpers
function setup() {
- prepare_network_conf
copy_images
}
diff --git a/test/podman_stats.bats b/test/podman_stats.bats
index f9981227a..91ef62f6b 100644
--- a/test/podman_stats.bats
+++ b/test/podman_stats.bats
@@ -7,7 +7,6 @@ function teardown() {
}
function setup() {
- prepare_network_conf
copy_images
}
diff --git a/test/podman_stop.bats b/test/podman_stop.bats
index 06b001fed..b505d8827 100644
--- a/test/podman_stop.bats
+++ b/test/podman_stop.bats
@@ -7,7 +7,6 @@ function teardown() {
}
function setup() {
- prepare_network_conf
copy_images
}
diff --git a/test/podman_top.bats b/test/podman_top.bats
index 1d3df149d..e592a0e22 100644
--- a/test/podman_top.bats
+++ b/test/podman_top.bats
@@ -7,7 +7,6 @@ function teardown() {
}
function setup() {
- prepare_network_conf
copy_images
}
diff --git a/test/podman_wait.bats b/test/podman_wait.bats
index 823a8591f..2ebf1d58d 100644
--- a/test/podman_wait.bats
+++ b/test/podman_wait.bats
@@ -3,7 +3,6 @@
load helpers
function setup() {
- prepare_network_conf
copy_images
}