Also refactor setting flags for running kpod

* Remove duplicate definitions of storage-related flags for kpod, since
  we set them in helpers.bash now, and the other locations that were
  also setting it were doing so after loading the definitions in
  helpers.
* Set kpod storage flags after checking if we need to force use of the
  "vfs" storage driver for cri-o, to make sure kpod also ends up with
  the same override if we're using one.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
This commit is contained in:
Nalin Dahyabhai 2017-09-28 12:51:35 -04:00 committed by umohnani8
parent e16bb3feb3
commit 2491d38e03
8 changed files with 9 additions and 30 deletions

View file

@ -37,4 +37,4 @@ function teardown() {
cleanup_ctrs
cleanup_pods
stop_crio
}
}

View file

@ -59,11 +59,6 @@ PIDS_LIMIT=${PIDS_LIMIT:-1024}
# Log size max limit
LOG_SIZE_MAX_LIMIT=${LOG_SIZE_MAX_LIMIT:--1}
# Options for kpod.
ROOT="${TESTDIR}/crio"
RUNROOT="${TESTDIR}/crio-run"
KPOD_OPTIONS="--root ${ROOT} --runroot ${RUNROOT} ${STORAGE_OPTS} --runtime ${RUNTIME_BINARY}"
TESTDIR=$(mktemp -d)
# kpod pull needs a configuration file for shortname pulls
@ -95,6 +90,8 @@ CRIO_CNI_PLUGIN="/opt/cni/bin/"
POD_CIDR="10.88.0.0/16"
POD_CIDR_MASK="10.88.*.*"
KPOD_OPTIONS="--root $TESTDIR/crio $STORAGE_OPTS --runroot $TESTDIR/crio-run --runtime ${RUNTIME_BINARY}"
cp "$CONMON_BINARY" "$TESTDIR/conmon"
PATH=$PATH:$TESTDIR

View file

@ -3,10 +3,6 @@
load helpers
IMAGE="redis:alpine"
ROOT="${TESTDIR}/crio"
RUNROOT="${TESTDIR}/crio-run"
# Do not add --storage-driver vfs
KPOD_OPTIONS="--root ${ROOT} --runroot ${RUNROOT} --runtime ${RUNTIME_BINARY}"
function teardown() {
cleanup_test

View file

@ -1,16 +1,12 @@
#!/usr/bin/env bats
function teardown() {
cleanup_test
}
load helpers
IMAGE="redis:alpine"
ROOT="${TESTDIR}/crio"
RUNROOT="${TESTDIR}/crio-run"
# Do not add --storage-driver vfs
KPOD_OPTIONS="--root ${ROOT} --runroot ${RUNROOT} --runtime ${RUNTIME_BINARY}"
function teardown() {
cleanup_test
}
@test "mount" {
start_crio

View file

@ -3,9 +3,7 @@
load helpers
IMAGE="redis:alpine"
ROOT="$TESTDIR/crio"
RUNROOT="$TESTDIR/crio-run"
KPOD_OPTIONS="--root $ROOT --runroot $RUNROOT $STORAGE_OPTS --runtime $RUNTIME_BINARY"
function teardown() {
cleanup_test
}

View file

@ -12,7 +12,7 @@ function teardown() {
run ${KPOD_BINARY} $KPOD_OPTIONS pull "$IMAGE"
echo "$output"
[ "$status" -eq 0 ]
run ${KPOD_BINARY} $KPOD_OPTIONS push "$IMAGE" containers-storage:[$ROOT]busybox:test
run ${KPOD_BINARY} $KPOD_OPTIONS push "$IMAGE" containers-storage:[${TESTDIR}/crio]busybox:test
echo "$output"
[ "$status" -eq 0 ]
run ${KPOD_BINARY} $KPOD_OPTIONS rmi "$IMAGE" busybox:test

View file

@ -2,11 +2,7 @@
load helpers
IMAGE="docker.io/library/alpine:latest"
ROOT="$TESTDIR/crio"
RUNROOT="$TESTDIR/crio-run"
KPOD_OPTIONS="--root $ROOT --runroot $RUNROOT --storage-driver vfs"
function teardown() {
cleanup_test

View file

@ -3,10 +3,6 @@
load helpers
IMAGE="redis:alpine"
ROOT="$TESTDIR/crio"
RUNROOT="$TESTDIR/crio-run"
KPOD_OPTIONS="--root $ROOT --runroot $RUNROOT ${STORAGE_OPTS}"
# Returns the POD ID
function pod_run_from_template(){