summaryrefslogtreecommitdiff
path: root/test/helpers.bash
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/helpers.bash
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/helpers.bash')
-rw-r--r--test/helpers.bash62
1 files changed, 7 insertions, 55 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"