github.com/dmaizel/tests@v0.0.0-20210728163746-cae6a2d9cee8/Makefile (about)

     1  #
     2  # Copyright (c) 2017-2018 Intel Corporation
     3  #
     4  # SPDX-License-Identifier: Apache-2.0
     5  #
     6  
     7  ifneq (,$(wildcard /usr/lib/os-release))
     8  include /usr/lib/os-release
     9  else
    10  include /etc/os-release
    11  endif
    12  
    13  # The time limit in seconds for each test
    14  TIMEOUT := 120
    15  
    16  PODMAN_DEPENDENCY = podman
    17  ifeq (${CI}, true)
    18          ifneq (${TEST_CGROUPSV2}, true)
    19                  PODMAN_DEPENDENCY =
    20          endif
    21  endif
    22  
    23  # union for 'make test'
    24  UNION := kubernetes
    25  
    26  # filter scheme script for docker integration test suites
    27  FILTER_FILE = .ci/filter/filter_docker_test.sh
    28  
    29  # skipped docker integration tests for Firecraker
    30  # Firecracker configuration file
    31  FIRECRACKER_CONFIG = .ci/hypervisors/firecracker/configuration_firecracker.yaml
    32  # Cloud hypervisor configuration file
    33  CLH_CONFIG = .ci/hypervisors/clh/configuration_clh.yaml
    34  ifneq ($(wildcard $(FILTER_FILE)),)
    35  SKIP_FIRECRACKER := $(shell bash -c '$(FILTER_FILE) $(FIRECRACKER_CONFIG)')
    36  SKIP_CLH := $(shell bash -c '$(FILTER_FILE) $(CLH_CONFIG)')
    37  endif
    38  
    39  # get arch
    40  ARCH := $(shell bash -c '.ci/kata-arch.sh -d')
    41  
    42  ARCH_DIR = arch
    43  ARCH_FILE_SUFFIX = -options.mk
    44  ARCH_FILE = $(ARCH_DIR)/$(ARCH)$(ARCH_FILE_SUFFIX)
    45  
    46  INSTALL_FILES := $(wildcard .ci/install_*.sh)
    47  INSTALL_TARGETS := $(INSTALL_FILES:.ci/install_%.sh=install-%)
    48  
    49  # Load architecture-dependent settings
    50  ifneq ($(wildcard $(ARCH_FILE)),)
    51  include $(ARCH_FILE)
    52  endif
    53  
    54  default: checkcommits github-labels
    55  
    56  checkcommits:
    57  	make -C cmd/checkcommits
    58  
    59  github-labels:
    60  	make -C cmd/github-labels
    61  
    62  spell-check-dictionary:
    63  	make -C cmd/check-spelling
    64  
    65  check-markdown:
    66  	make -C cmd/check-markdown
    67  
    68  ginkgo:
    69  	ln -sf . vendor/src
    70  	GOPATH=$(PWD)/vendor go build ./vendor/github.com/onsi/ginkgo/ginkgo
    71  	unlink vendor/src
    72  
    73  docker: ginkgo
    74  ifeq ($(RUNTIME),)
    75  	$(error RUNTIME is not set)
    76  endif
    77  
    78  ifeq ($(KATA_HYPERVISOR),firecracker)
    79  	./ginkgo -failFast -v -focus "${FOCUS}" -skip "${SKIP_FIRECRACKER}" \
    80  		./integration/docker/ -- -runtime=${RUNTIME} -timeout=${TIMEOUT} \
    81  		-hypervisor=$(KATA_HYPERVISOR)
    82  else ifeq ($(KATA_HYPERVISOR),cloud-hypervisor)
    83  	./ginkgo -failFast -v -focus "${FOCUS}" -skip "${SKIP_CLH}" \
    84  		./integration/docker/ -- -runtime=${RUNTIME} -timeout=${TIMEOUT} \
    85  		-hypervisor=$(KATA_HYPERVISOR)
    86  else ifeq ($(ARCH),$(filter $(ARCH), aarch64 s390x ppc64le))
    87  	./ginkgo -failFast -v -focus "${FOCUS}" -skip "${SKIP}" \
    88  		./integration/docker/ -- -runtime=${RUNTIME} -timeout=${TIMEOUT}
    89  else ifneq (${FOCUS},)
    90  	./ginkgo -failFast -v -focus "${FOCUS}" -skip "${SKIP}" \
    91  		./integration/docker/ -- -runtime=${RUNTIME} -timeout=${TIMEOUT}
    92  else
    93  # Run tests in parallel, skip tests that need to be run serialized
    94  	./ginkgo -failFast -p -stream -v -skip "${SKIP}" -skip "\[Serial Test\]" \
    95  		./integration/docker/ -- -runtime=${RUNTIME} -timeout=${TIMEOUT}
    96  # Now run serialized tests
    97  	./ginkgo -failFast -v -focus "\[Serial Test\]" -skip "${SKIP}" \
    98  		./integration/docker/ -- -runtime=${RUNTIME} -timeout=${TIMEOUT}
    99  	bash sanity/check_sanity.sh
   100  endif
   101  
   102  crio:
   103  	bash .ci/install_bats.sh
   104  	./integration/cri-o/cri-o.sh
   105  
   106  docker-stability:
   107  	systemctl is-active --quiet docker || sudo systemctl start docker
   108  	cd integration/stability && \
   109  	export ITERATIONS=2 && export MAX_CONTAINERS=20 && ./soak_parallel_rm.sh
   110  	cd integration/stability && ./hypervisor_stability_kill_test.sh
   111  
   112  ksm:
   113  	bash -f integration/ksm/ksm_test.sh
   114  
   115  kubernetes:
   116  	bash -f .ci/install_bats.sh
   117  	bash -f integration/kubernetes/run_kubernetes_tests.sh
   118  
   119  kubernetes-e2e:
   120  	cd "integration/kubernetes/e2e_conformance" &&\
   121  	cat skipped_tests_e2e.yaml &&\
   122  	bash ./setup.sh &&\
   123  	bash ./run.sh
   124  
   125  sandbox-cgroup:
   126  	bash -f integration/sandbox_cgroup/sandbox_cgroup_test.sh
   127  
   128  stability:
   129  	cd integration/stability && \
   130  	ITERATIONS=2 MAX_CONTAINERS=20 ./soak_parallel_rm.sh
   131  	cd integration/stability && ./hypervisor_stability_kill_test.sh
   132  
   133  shimv2:
   134  	bash integration/containerd/shimv2/shimv2-tests.sh
   135  	bash integration/containerd/shimv2/shimv2-factory-tests.sh
   136  
   137  cri-containerd:
   138  	bash integration/containerd/cri/integration-tests.sh
   139  
   140  log-parser:
   141  	make -C cmd/log-parser
   142  
   143  pentest:
   144  	bash -f pentest/all.sh
   145  
   146  tracing:
   147  	bash tracing/tracing-test.sh
   148  
   149  vcpus:
   150  	bash -f integration/vcpus/default_vcpus_test.sh
   151  
   152  pmem:
   153  	bash -f integration/pmem/pmem_test.sh
   154  
   155  filesystem:
   156  	bash -f ./conformance/posixfs/fstests.sh
   157  
   158  test: ${UNION}
   159  
   160  check: checkcommits log-parser
   161  
   162  $(INSTALL_TARGETS): install-%: .ci/install_%.sh
   163  	@bash -f $<
   164  
   165  list-install-targets:
   166  	@echo $(INSTALL_TARGETS) | tr " " "\n"
   167  
   168  vfio:
   169  #	Skip: Issue: https://github.com/kata-containers/kata-containers/issues/1488
   170  #	bash -f functional/vfio/run.sh -s false -p clh -i image
   171  #	bash -f functional/vfio/run.sh -s true -p clh -i image
   172  	bash -f functional/vfio/run.sh -s false -p qemu -m q35 -i image
   173  	bash -f functional/vfio/run.sh -s true -p qemu -m q35 -i image
   174  
   175  help:
   176  	@echo Subsets of the tests can be run using the following specific make targets:
   177  	@echo " $(UNION)" | sed 's/ /\n\t/g'
   178  
   179  # PHONY in alphabetical order
   180  .PHONY: \
   181  	check \
   182  	checkcommits \
   183  	crio \
   184  	docker \
   185  	docker-stability \
   186  	filesystem \
   187  	ginkgo \
   188  	$(INSTALL_TARGETS) \
   189  	kubernetes \
   190  	list-install-targets \
   191  	log-parser \
   192  	pentest \
   193  	sandbox-cgroup \
   194  	test \
   195  	tracing \
   196  	vcpus \
   197  	vfio \
   198  	pmem