mirror of
https://github.com/linuxkit/linuxkit.git
synced 2026-04-05 21:59:32 +00:00
This adds a test suite to be executed using `linuxkit/rtf`. This is installed in the top-level Makefile The tests are written in shell script and cover the following cases: - Kernel Config is OK! - Kernel Modules can be built and loaded - QEMU can build and run kernel+initrd, iso-bios and iso-uefi - That we can build for all other supported output formats - That all of the examples in `./examples` can be built - The LTP tests can be run (if `-l slow` is provided) The virtsock and docker-bench tests were migrated but no test has been written as yet as AFAICT they are still a WIP Signed-off-by: Dave Tucker <dt@docker.com>
48 lines
1.1 KiB
Makefile
48 lines
1.1 KiB
Makefile
.PHONY: default pr all
|
|
|
|
default: check-deps test
|
|
pr: check-deps test-pr
|
|
# TODO: all should point to test-all once ltp is no longer required
|
|
all: check-deps test-pr ltp
|
|
|
|
MOBY:=$(shell command -v moby 2> /dev/null)
|
|
LINUXKIT:=$(shell command -v linuxkit 2> /dev/null)
|
|
RTF:=$(shell command -v rtf 2> /dev/null)
|
|
|
|
.PHONY: check-deps
|
|
check-deps:
|
|
ifndef MOBY
|
|
$(error "moby is not available. please install it.")
|
|
endif
|
|
ifndef LINUXKIT
|
|
$(error "linuxkit binary not found. please install it.")
|
|
endif
|
|
ifndef RTF
|
|
$(error "rtf is not available. please install it!")
|
|
endif
|
|
|
|
|
|
# TODO: Remove this section once we no longer depend on this in CI
|
|
### -------
|
|
define check_test_log
|
|
@cat $1 |grep -q 'test suite PASSED'
|
|
endef
|
|
|
|
.PHONY: ltp
|
|
ltp: export CLOUDSDK_IMAGE_NAME?=test-ltp
|
|
ltp: $(LINUXKIT) test-ltp.img.tar.gz
|
|
$(MOBY) build --pull cases/020_stress/000_ltp/test-ltp.yml
|
|
$(LINUXKIT) push gcp test-ltp.img.tar.gz
|
|
$(LINUXKIT) run gcp -skip-cleanup -machine n1-highcpu-4 $(CLOUDSDK_IMAGE_NAME) | tee test-ltp.log
|
|
$(call check_test_log, test-ltp.log)
|
|
### ------
|
|
|
|
test:
|
|
@rtf -l build -x run
|
|
|
|
test-pr:
|
|
@rtf -vvv -l build -x run
|
|
|
|
test-all:
|
|
@rtf -vvv -x -l build,slow run
|