mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-21 01:59:07 +00:00
tests: add build test for Docker for Mac blueprint
Adds a new test group "linuxkit.build.blueprints" and a test for building blueprints/docker-for-mac.yml. Signed-off-by: Magnus Skjegstad <magnus@skjegstad.com>
This commit is contained in:
parent
d65bb86c37
commit
7bbc39374e
@ -0,0 +1,24 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# SUMMARY: Test the Docker for Mac blueprint
|
||||||
|
# LABELS:
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Source libraries. Uncomment if needed/defined
|
||||||
|
#. "${RT_LIB}"
|
||||||
|
. "${RT_PROJECT_ROOT}/_lib/lib.sh"
|
||||||
|
|
||||||
|
IMAGE_NAME=docker-for-mac
|
||||||
|
|
||||||
|
clean_up() {
|
||||||
|
# remove any files, containers, images etc
|
||||||
|
rm -rf ${IMAGE_NAME}*
|
||||||
|
}
|
||||||
|
|
||||||
|
trap clean_up EXIT
|
||||||
|
|
||||||
|
# Test code goes here
|
||||||
|
moby build "${LINUXKIT_BLUEPRINTS_DIR}/${IMAGE_NAME}.yml"
|
||||||
|
|
||||||
|
exit 0
|
||||||
|
|
31
test/cases/000_build/200_blueprints/group.sh
Normal file
31
test/cases/000_build/200_blueprints/group.sh
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# SUMMARY: Check that the blueprint YAML files work
|
||||||
|
# LABELS:
|
||||||
|
|
||||||
|
group_init() {
|
||||||
|
# Group initialisation code goes here
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
group_deinit() {
|
||||||
|
# Group de-initialisation code goes here
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
CMD=$1
|
||||||
|
case $CMD in
|
||||||
|
init)
|
||||||
|
group_init
|
||||||
|
res=$?
|
||||||
|
;;
|
||||||
|
deinit)
|
||||||
|
group_deinit
|
||||||
|
res=$?
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
res=1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
exit $res
|
||||||
|
|
@ -11,6 +11,7 @@ group_init() {
|
|||||||
[ -r "${LINUXKIT_TMPDIR}" ] && rm -rf "${LINUXKIT_TMPDIR}"
|
[ -r "${LINUXKIT_TMPDIR}" ] && rm -rf "${LINUXKIT_TMPDIR}"
|
||||||
mkdir "${LINUXKIT_TMPDIR}"
|
mkdir "${LINUXKIT_TMPDIR}"
|
||||||
echo "export LINUXKIT_EXAMPLES_DIR=${RT_PROJECT_ROOT}/../../examples" >> "${LINUXKIT_TMPDIR}/env.sh"
|
echo "export LINUXKIT_EXAMPLES_DIR=${RT_PROJECT_ROOT}/../../examples" >> "${LINUXKIT_TMPDIR}/env.sh"
|
||||||
|
echo "export LINUXKIT_BLUEPRINTS_DIR=${RT_PROJECT_ROOT}/../../blueprints" >> "${LINUXKIT_TMPDIR}/env.sh"
|
||||||
|
|
||||||
if rt_label_set "gcp"; then
|
if rt_label_set "gcp"; then
|
||||||
# If we run GCP tests, make sure it is configured
|
# If we run GCP tests, make sure it is configured
|
||||||
|
Loading…
Reference in New Issue
Block a user