mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-20 17:49:10 +00:00
pkg/bpftrace: Add a trivial test for pkg/bpftrace
Signed-off-by: Simarpreet Singh <simar@linux.com>
This commit is contained in:
parent
3e0686e5c2
commit
5c4523939b
9
test/cases/040_packages/002_bpftrace/check.sh
Normal file
9
test/cases/040_packages/002_bpftrace/check.sh
Normal file
@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
|
||||
nsenter -t1 -m -- /usr/bin/bpftrace -l
|
||||
if [ "$?" -ne "0" ]; then
|
||||
printf "bpftrace test suite FAILED\n" >&1
|
||||
exit 1
|
||||
fi;
|
||||
|
||||
printf "bpftrace test suite PASSED\n" >&1
|
23
test/cases/040_packages/002_bpftrace/test.sh
Normal file
23
test/cases/040_packages/002_bpftrace/test.sh
Normal file
@ -0,0 +1,23 @@
|
||||
#!/bin/sh
|
||||
# SUMMARY: Check that the bpftrace package works
|
||||
# REPEAT:
|
||||
|
||||
set -e
|
||||
|
||||
# Source libraries. Uncomment if needed/defined
|
||||
#. "${RT_LIB}"
|
||||
. "${RT_PROJECT_ROOT}/_lib/lib.sh"
|
||||
NAME=bpftrace
|
||||
|
||||
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
|
29
test/cases/040_packages/002_bpftrace/test.yml
Normal file
29
test/cases/040_packages/002_bpftrace/test.yml
Normal file
@ -0,0 +1,29 @@
|
||||
kernel:
|
||||
image: linuxkit/kernel:4.14.86
|
||||
cmdline: "console=ttyS0 console=ttyAMA0"
|
||||
init:
|
||||
- linuxkit/init:v0.5
|
||||
- linuxkit/runc:v0.5
|
||||
- linuxkit/bpftrace:67b5c3b4f13a4acf22eab8f422091e1efc06852d
|
||||
onboot:
|
||||
- name: bpftrace-test
|
||||
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
|
Loading…
Reference in New Issue
Block a user