mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-19 17:26:28 +00:00
fix reversed equals error
Signed-off-by: Avi Deitcher <avi@deitcher.net>
This commit is contained in:
parent
f0b002718d
commit
54be4048f0
@ -85,7 +85,7 @@ func systemInitCmd(ctx context.Context, args []string) {
|
||||
|
||||
// look for containerd options
|
||||
ctrdArgs := []string{}
|
||||
if b, err := ioutil.ReadFile(containerdOptsFile); err != nil {
|
||||
if b, err := ioutil.ReadFile(containerdOptsFile); err == nil {
|
||||
ctrdArgs = strings.Fields(string(b))
|
||||
}
|
||||
|
||||
|
13
test/cases/040_packages/020_init_containerd/check.sh
Normal file
13
test/cases/040_packages/020_init_containerd/check.sh
Normal file
@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
function failed {
|
||||
printf "containerd commandline vars not set: FAILED\n" >/dev/console
|
||||
/sbin/poweroff -f
|
||||
exit 1
|
||||
}
|
||||
|
||||
ps -ef | grep containerd | grep -q trace || failed
|
||||
|
||||
printf "containerd commandline vars test suite PASSED\n" >/dev/console
|
||||
|
||||
/sbin/poweroff -f
|
24
test/cases/040_packages/020_init_containerd/test.sh
Normal file
24
test/cases/040_packages/020_init_containerd/test.sh
Normal file
@ -0,0 +1,24 @@
|
||||
#!/bin/sh
|
||||
# SUMMARY: Check that the containerd command-line options have been enabled by init
|
||||
# LABELS:
|
||||
# REPEAT:
|
||||
|
||||
set -e
|
||||
|
||||
# Source libraries. Uncomment if needed/defined
|
||||
#. "${RT_LIB}"
|
||||
. "${RT_PROJECT_ROOT}/_lib/lib.sh"
|
||||
NAME=init_containerd
|
||||
|
||||
clean_up() {
|
||||
rm -rf ${NAME}-*
|
||||
}
|
||||
trap clean_up EXIT
|
||||
|
||||
# Test code goes here
|
||||
linuxkit build -format kernel+initrd -name "${NAME}" test.yml
|
||||
RESULT="$(linuxkit run $NAME)"
|
||||
echo "${RESULT}"
|
||||
echo "${RESULT}" | grep -q "suite PASSED"
|
||||
|
||||
exit 0
|
28
test/cases/040_packages/020_init_containerd/test.yml
Normal file
28
test/cases/040_packages/020_init_containerd/test.yml
Normal file
@ -0,0 +1,28 @@
|
||||
kernel:
|
||||
image: linuxkit/kernel:5.4.39
|
||||
cmdline: "console=ttyS0 console=ttyAMA0"
|
||||
init:
|
||||
- linuxkit/init:4f6508f4f35b134dda3807bb5d75c117c193a86a
|
||||
- linuxkit/runc:v0.8
|
||||
- linuxkit/containerd:a4aa19c608556f7d786852557c36136255220c1f
|
||||
- linuxkit/ca-certificates:v0.8
|
||||
services:
|
||||
- name: test
|
||||
image: alpine:3.11
|
||||
pid: host
|
||||
binds:
|
||||
- /check.sh:/check.sh
|
||||
- /dev/console:/dev/console
|
||||
capabilities:
|
||||
- CAP_SYS_BOOT
|
||||
command: ["sh", "/check.sh"]
|
||||
files:
|
||||
- path: check.sh
|
||||
source: ./check.sh
|
||||
- path: /etc/containerd/cli-opts
|
||||
contents: "--log-level trace"
|
||||
trust:
|
||||
org:
|
||||
- linuxkit
|
||||
image:
|
||||
- alpine:3.11
|
Loading…
Reference in New Issue
Block a user