mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-09-04 00:18:53 +00:00
Merge pull request #3511 from deitch/append-binds
support merge yaml flags
This commit is contained in:
15
test/cases/000_build/020_binds/check.sh
Executable file
15
test/cases/000_build/020_binds/check.sh
Executable file
@@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -x
|
||||
|
||||
function failed {
|
||||
printf "bindmerge test suite FAILED\n" >&1
|
||||
exit 1
|
||||
}
|
||||
|
||||
# the very fact that this is running means that the bind worked, so just need to check that the defaults also
|
||||
# are there
|
||||
|
||||
[ -d /dev/mapper ] || failed
|
||||
[ -d /hostroot ] || failed
|
||||
printf "bindmerge test suite PASSED\n" >&1
|
27
test/cases/000_build/020_binds/test.sh
Executable file
27
test/cases/000_build/020_binds/test.sh
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/bin/sh
|
||||
# SUMMARY: Check that the userdata is found and read when on a cidata partition
|
||||
# LABELS:
|
||||
# REPEAT:
|
||||
|
||||
set -ex
|
||||
|
||||
# Source libraries. Uncomment if needed/defined
|
||||
#. "${RT_LIB}"
|
||||
. "${RT_PROJECT_ROOT}/_lib/lib.sh"
|
||||
|
||||
NAME=bindtest
|
||||
DISK=disk.img
|
||||
|
||||
clean_up() {
|
||||
rm -rf ${NAME}-* ${DISK}
|
||||
}
|
||||
trap clean_up EXIT
|
||||
|
||||
# Test code goes here
|
||||
|
||||
linuxkit build -format kernel+initrd -name ${NAME} test.yml
|
||||
RESULT="$(linuxkit run -disk file=${DISK},size=32M ${NAME})"
|
||||
echo "${RESULT}"
|
||||
echo "${RESULT}" | grep -q "suite PASSED"
|
||||
|
||||
exit 0
|
28
test/cases/000_build/020_binds/test.yml
Normal file
28
test/cases/000_build/020_binds/test.yml
Normal file
@@ -0,0 +1,28 @@
|
||||
kernel:
|
||||
image: linuxkit/kernel:5.4.30
|
||||
cmdline: "console=ttyS0 console=ttyAMA0"
|
||||
init:
|
||||
- linuxkit/init:7195dc244cd92af01fd0895fd204249a6114c5e2
|
||||
- linuxkit/runc:f79954950022fea76b8b6f10de58cb48e4fb3878
|
||||
onboot:
|
||||
- name: mount
|
||||
image: linuxkit/mount:19fa297189166206ac97261679c3e31fb140d48f
|
||||
binds.add:
|
||||
- /check.sh:/check.sh
|
||||
- /var/tmp:/var/tmp
|
||||
# default binds from linuxkit/mount
|
||||
# - /dev:/dev
|
||||
# - /var:/var:rshared,rbind
|
||||
# - /:/hostroot
|
||||
command: ["sh", "-c", "/check.sh"]
|
||||
- name: poweroff
|
||||
image: linuxkit/poweroff:06dd4e46c62fbe79123a028835c921f80e4855d3
|
||||
command: ["/bin/sh", "/poweroff.sh", "10"]
|
||||
files:
|
||||
- path: check.sh
|
||||
source: ./check.sh
|
||||
mode: "0700"
|
||||
trust:
|
||||
org:
|
||||
- linuxkit
|
||||
- library
|
Reference in New Issue
Block a user