Merge pull request #737 from umohnani8/kpod_export

Add 'kpod export' command
This commit is contained in:
Mrunal Patel 2017-08-11 10:54:34 -07:00 committed by GitHub
commit fb2ee59225
5 changed files with 196 additions and 0 deletions

35
test/kpod_export.bats Normal file
View file

@ -0,0 +1,35 @@
#!/usr/bin/env bats
load helpers
IMAGE="redis:alpine"
ROOT="$TESTDIR/crio"
RUNROOT="$TESTDIR/crio-run"
KPOD_OPTIONS="--root $ROOT --runroot $RUNROOT ${STORAGE_OPTS}"
@test "kpod export output flag" {
start_crio
[ "$status" -eq 0 ]
run crioctl pod run --config "$TESTDATA"/sandbox_config.json
echo "$output"
[ "$status" -eq 0 ]
pod_id="$output"
run crioctl image pull "$IMAGE"
[ "$status" -eq 0 ]
run crioctl ctr create --config "$TESTDATA"/container_config.json --pod "$pod_id"
echo "$output"
[ "$status" -eq 0 ]
ctr_id="$output"
run ${KPOD_BINARY} ${KPOD_OPTIONS} export -o container.tar "$ctr_id"
echo "$output"
[ "$status" -eq 0 ]
cleanup_ctrs
[ "$status" -eq 0 ]
cleanup_pods
[ "$status" -eq 0 ]
stop_crio
[ "$status" -eq 0 ]
rm -f container.tar
[ "$status" -eq 0 ]
}