Add a test case for bcc to packages.

Signed-off-by: Krister Johansen <krister.johansen@oracle.com>
This commit is contained in:
Krister Johansen 2018-07-30 21:37:33 -07:00
parent 0643093f6a
commit 6e48041dee
3 changed files with 62 additions and 0 deletions

View File

@ -0,0 +1,9 @@
#!/bin/sh
nsenter -t 1 -m -- /bin/ash -c "/usr/share/bcc/tools/softirqs 1 1"
if [ "$?" -ne "0" ]; then
printf "bcc test suite FAILED\n" >&1
exit 1
fi;
printf "bcc test suite PASSED\n" >&1

View File

@ -0,0 +1,24 @@
#!/bin/sh
# SUMMARY: Check that the bcc package works
# LABELS: skip
# REPEAT:
set -e
# Source libraries. Uncomment if needed/defined
#. "${RT_LIB}"
. "${RT_PROJECT_ROOT}/_lib/lib.sh"
NAME=bcc
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

View File

@ -0,0 +1,29 @@
kernel:
image: linuxkit/kernel:4.14.54
cmdline: "console=ttyS0 console=ttyAMA0"
init:
- linuxkit/init:v0.5
- linuxkit/runc:v0.5
- linuxkit/kernel-bcc:4.14.54
onboot:
- name: check-bcc
image: alpine:3.8
binds:
- /check.sh:/check.sh
command: ["sh", "./check.sh"]
pid: host
net: host
ipc: host
capabilities:
- all
- name: poweroff
image: linuxkit/poweroff:2687ed712690766b8156a77ac600005b532d2c7d
command: ["/bin/sh", "/poweroff.sh", "10"]
files:
- path: check.sh
source: ./check.sh
trust:
org:
- linuxkit
image:
- alpine:3.8