diff options
Diffstat (limited to 'test/helpers.bash')
-rw-r--r-- | test/helpers.bash | 62 |
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" |