From 81b78e87a663a458733702ce6783804f003d7d10 Mon Sep 17 00:00:00 2001 From: Rolf Neugebauer Date: Sun, 15 Sep 2019 13:52:51 +0100 Subject: [PATCH] tests: Remove 5.1.x kernel tests Signed-off-by: Rolf Neugebauer --- .../cases/020_kernel/008_config_5.1.x/test.sh | 24 -------------- .../020_kernel/008_config_5.1.x/test.yml | 15 --------- .../020_kernel/018_kmod_5.1.x/Dockerfile | 23 -------------- test/cases/020_kernel/018_kmod_5.1.x/check.sh | 15 --------- .../020_kernel/018_kmod_5.1.x/src/Makefile | 6 ---- .../018_kmod_5.1.x/src/hello_world.c | 22 ------------- test/cases/020_kernel/018_kmod_5.1.x/test.sh | 31 ------------------- test/cases/020_kernel/018_kmod_5.1.x/test.yml | 20 ------------ 8 files changed, 156 deletions(-) delete mode 100644 test/cases/020_kernel/008_config_5.1.x/test.sh delete mode 100644 test/cases/020_kernel/008_config_5.1.x/test.yml delete mode 100644 test/cases/020_kernel/018_kmod_5.1.x/Dockerfile delete mode 100755 test/cases/020_kernel/018_kmod_5.1.x/check.sh delete mode 100644 test/cases/020_kernel/018_kmod_5.1.x/src/Makefile delete mode 100644 test/cases/020_kernel/018_kmod_5.1.x/src/hello_world.c delete mode 100644 test/cases/020_kernel/018_kmod_5.1.x/test.sh delete mode 100644 test/cases/020_kernel/018_kmod_5.1.x/test.yml diff --git a/test/cases/020_kernel/008_config_5.1.x/test.sh b/test/cases/020_kernel/008_config_5.1.x/test.sh deleted file mode 100644 index fdfccb99c..000000000 --- a/test/cases/020_kernel/008_config_5.1.x/test.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# SUMMARY: Sanity check on the kernel config file -# LABELS: -# REPEAT: - -set -e - -# Source libraries. Uncomment if needed/defined -#. "${RT_LIB}" -. "${RT_PROJECT_ROOT}/_lib/lib.sh" - -NAME=kconfig - -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}" | grep -q "suite PASSED" - -exit 0 diff --git a/test/cases/020_kernel/008_config_5.1.x/test.yml b/test/cases/020_kernel/008_config_5.1.x/test.yml deleted file mode 100644 index dbf3b77a4..000000000 --- a/test/cases/020_kernel/008_config_5.1.x/test.yml +++ /dev/null @@ -1,15 +0,0 @@ -kernel: - image: linuxkit/kernel:5.1.15 - cmdline: "console=ttyS0 console=ttyAMA0" -init: - - linuxkit/init:1d8e0532ca588c5ad0d9ca6038349a70bb7ac626 - - linuxkit/runc:c1f0db27e71d948f3134b31ce76276f843849b0a -onboot: - - name: check-kernel-config - image: linuxkit/test-kernel-config:0e9308f871ac86c680d64836a050547a2feebb36 - - name: poweroff - image: linuxkit/poweroff:b498d30dd9660090565537fceb9e757618737a85 - command: ["/bin/sh", "/poweroff.sh", "3"] -trust: - org: - - linuxkit diff --git a/test/cases/020_kernel/018_kmod_5.1.x/Dockerfile b/test/cases/020_kernel/018_kmod_5.1.x/Dockerfile deleted file mode 100644 index b7eae50c4..000000000 --- a/test/cases/020_kernel/018_kmod_5.1.x/Dockerfile +++ /dev/null @@ -1,23 +0,0 @@ -# This Dockerfile extracts the kernel headers from the kernel image -# and then compiles a simple hello world kernel module against them. -# In the last stage, it creates a package, which can be used for -# testing. - -FROM linuxkit/kernel:5.1.15 AS ksrc - -# Extract headers and compile module -FROM linuxkit/alpine:86cd4f51b49fb9a078b50201d892a3c7973d48ec AS build -RUN apk add build-base elfutils-dev - -COPY --from=ksrc /kernel-dev.tar / -RUN tar xf kernel-dev.tar - -WORKDIR /kmod -COPY ./src/* ./ -RUN make all - -# Package -FROM alpine:3.9 -COPY --from=build /kmod/hello_world.ko / -COPY check.sh /check.sh -ENTRYPOINT ["/bin/sh", "/check.sh"] diff --git a/test/cases/020_kernel/018_kmod_5.1.x/check.sh b/test/cases/020_kernel/018_kmod_5.1.x/check.sh deleted file mode 100755 index 02e491624..000000000 --- a/test/cases/020_kernel/018_kmod_5.1.x/check.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -function failed { - printf "Kernel module test suite FAILED\n" - /sbin/poweroff -f -} - -uname -a -modinfo hello_world.ko || failed -insmod hello_world.ko || failed -[ -n "$(dmesg | grep -o 'Hello LinuxKit')" ] || failed -rmmod hello_world || failed - -printf "Kernel module test suite PASSED\n" - -/sbin/poweroff -f diff --git a/test/cases/020_kernel/018_kmod_5.1.x/src/Makefile b/test/cases/020_kernel/018_kmod_5.1.x/src/Makefile deleted file mode 100644 index 31c8215dd..000000000 --- a/test/cases/020_kernel/018_kmod_5.1.x/src/Makefile +++ /dev/null @@ -1,6 +0,0 @@ -obj-m += hello_world.o -KVER=$(shell basename /usr/src/linux-headers-*) -all: - make -C /usr/src/$(KVER) M=$(PWD) modules -clean: - make -C /usr/src/$(KVER) M=$(PWD) clean diff --git a/test/cases/020_kernel/018_kmod_5.1.x/src/hello_world.c b/test/cases/020_kernel/018_kmod_5.1.x/src/hello_world.c deleted file mode 100644 index 7dd6d3ee2..000000000 --- a/test/cases/020_kernel/018_kmod_5.1.x/src/hello_world.c +++ /dev/null @@ -1,22 +0,0 @@ -/* - * A simple Hello World kernel module - */ -#include -#include - -int init_hello(void) -{ - printk(KERN_INFO "Hello LinuxKit\n"); - return 0; -} - -void exit_hello(void) -{ - printk(KERN_INFO "Goodbye LinuxKit.\n"); -} - -module_init(init_hello); -module_exit(exit_hello); -MODULE_AUTHOR("Rolf Neugebauer "); -MODULE_LICENSE("GPL"); -MODULE_DESCRIPTION("A simple Hello World kernel module for testing"); diff --git a/test/cases/020_kernel/018_kmod_5.1.x/test.sh b/test/cases/020_kernel/018_kmod_5.1.x/test.sh deleted file mode 100644 index 1162b0e72..000000000 --- a/test/cases/020_kernel/018_kmod_5.1.x/test.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh -# SUMMARY: Test build and insertion of kernel modules -# LABELS: -# REPEAT: - -set -e - -# Source libraries. Uncomment if needed/defined -#. "${RT_LIB}" -. "${RT_PROJECT_ROOT}/_lib/lib.sh" - -NAME=kmod -IMAGE_NAME=kmod-test - -clean_up() { - docker rmi ${IMAGE_NAME} || true - rm -rf ${NAME}-* -} -trap clean_up EXIT - -# Make sure we have the latest kernel image -docker pull linuxkit/kernel:5.1.15 -# Build a package -docker build -t ${IMAGE_NAME} . - -# Build and run a LinuxKit image with kernel module (and test script) -linuxkit build -format kernel+initrd -name "${NAME}" test.yml -RESULT="$(linuxkit run ${NAME})" -echo "${RESULT}" | grep -q "Hello LinuxKit" - -exit 0 diff --git a/test/cases/020_kernel/018_kmod_5.1.x/test.yml b/test/cases/020_kernel/018_kmod_5.1.x/test.yml deleted file mode 100644 index 4bbffa782..000000000 --- a/test/cases/020_kernel/018_kmod_5.1.x/test.yml +++ /dev/null @@ -1,20 +0,0 @@ -kernel: - image: linuxkit/kernel:5.1.15 - cmdline: "console=ttyS0 console=ttyAMA0" -init: - - linuxkit/init:1d8e0532ca588c5ad0d9ca6038349a70bb7ac626 - - linuxkit/runc:c1f0db27e71d948f3134b31ce76276f843849b0a -onboot: - - name: check - image: kmod-test - binds: - - /dev:/dev - - /lib/modules:/lib/modules - capabilities: - - all - - name: poweroff - image: linuxkit/poweroff:b498d30dd9660090565537fceb9e757618737a85 - command: ["/bin/sh", "/poweroff.sh", "3"] -trust: - org: - - linuxkit