Skip to content

Commit 6117361

Browse files
heartlockMa Shimiao
authored andcommitted
replace start to create-start
Signed-off-by: heartlock <[email protected]> Signed-off-by: Ma Shimiao <[email protected]>
1 parent 893d9e3 commit 6117361

1 file changed

Lines changed: 13 additions & 6 deletions

File tree

test_runtime.sh

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,16 +74,23 @@ cleanup() {
7474
}
7575
trap cleanup EXIT
7676

77+
die() {
78+
echo $1
79+
exit 1
80+
}
81+
7782
tar -xf rootfs.tar.gz -C ${TESTDIR}
7883
cp runtimetest ${TESTDIR}
7984

8085
oci-runtime-tool generate --output "${TESTDIR}/config.json" "${TEST_ARGS[@]}" --rootfs-path '.'
8186

82-
TESTCMD="${RUNTIME} start $(uuidgen)"
87+
CONID=$(uuidgen)
88+
89+
CREATECMD="${RUNTIME} create ${CONID}"
90+
TESTCMD="${RUNTIME} start ${CONID}"
91+
DELCMD="${RUNTIME} delete ${CONID}"
8392
pushd $TESTDIR > /dev/null
84-
if ! ${TESTCMD}; then
85-
error "Runtime ${RUNTIME} failed validation"
86-
else
87-
info "Runtime ${RUNTIME} passed validation"
88-
fi
93+
${CREATECMD} || die "failed to create ${CONID}"
94+
${TESTCMD} || die "failed to start ${CONID}"
95+
sleep 1 && ${DELCMD} || die "failed to delete ${CONID}"
8996
popd > /dev/null

0 commit comments

Comments
 (0)