From 2b0e6cdd4214098faf1bcc3bf52f71b0def7a0ed Mon Sep 17 00:00:00 2001 From: Davanum Srinivas Date: Thu, 22 Apr 2021 07:10:24 -0400 Subject: [PATCH 1/2] Separate jobs for build and test for openlab/arm64 Signed-off-by: Davanum Srinivas --- .zuul.yaml | 10 ++++++++++ .zuul/playbooks/containerd-build/run.yaml | 1 - .../playbooks/containerd-build/unit-test.yaml | 20 +++++++++++++++++++ 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 .zuul/playbooks/containerd-build/unit-test.yaml diff --git a/.zuul.yaml b/.zuul.yaml index dd47ffe76..33d4d820f 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -4,6 +4,7 @@ check: jobs: - containerd-build-arm64 + - containerd-test-arm64 - job: name: containerd-build-arm64 @@ -13,3 +14,12 @@ run: .zuul/playbooks/containerd-build/run.yaml nodeset: ubuntu-xenial-arm64-openlab voting: false + +- job: + name: containerd-test-arm64 + parent: init-test + description: | + Containerd unit tests in openlab cluster. + run: .zuul/playbooks/containerd-build/unit-test.yaml + nodeset: ubuntu-xenial-arm64-openlab + voting: false diff --git a/.zuul/playbooks/containerd-build/run.yaml b/.zuul/playbooks/containerd-build/run.yaml index 913824327..ee78847d6 100644 --- a/.zuul/playbooks/containerd-build/run.yaml +++ b/.zuul/playbooks/containerd-build/run.yaml @@ -15,7 +15,6 @@ go version make | tee $LOGS_PATH/make.txt - make test | tee $LOGS_PATH/make_test.txt cp -r ./bin $RESULTS_PATH chdir: '{{ zuul.project.src_dir }}' diff --git a/.zuul/playbooks/containerd-build/unit-test.yaml b/.zuul/playbooks/containerd-build/unit-test.yaml new file mode 100644 index 000000000..03f8b67f4 --- /dev/null +++ b/.zuul/playbooks/containerd-build/unit-test.yaml @@ -0,0 +1,20 @@ +- hosts: all + become: yes + roles: + - role: config-golang + go_version: '1.16.3' + arch: arm64 + tasks: + - name: Build and test containerd + shell: + cmd: | + set -xe + set -o pipefail + apt-get update + apt-get install -y btrfs-tools libseccomp-dev git pkg-config + + go version + make build test | tee $LOGS_PATH/make_test.txt + chdir: '{{ zuul.project.src_dir }}' + executable: /bin/bash + environment: '{{ global_env }}' From 78e52972740e4ad8e441af5255f44e0e15ee4315 Mon Sep 17 00:00:00 2001 From: Davanum Srinivas Date: Thu, 22 Apr 2021 09:19:32 -0400 Subject: [PATCH 2/2] add integration tests Signed-off-by: Davanum Srinivas --- .zuul.yaml | 10 ++ .../containerd-build/integration-test.yaml | 96 +++++++++++++++++++ 2 files changed, 106 insertions(+) create mode 100644 .zuul/playbooks/containerd-build/integration-test.yaml diff --git a/.zuul.yaml b/.zuul.yaml index 33d4d820f..8c845725a 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -5,6 +5,7 @@ jobs: - containerd-build-arm64 - containerd-test-arm64 + - containerd-integration-test-arm64 - job: name: containerd-build-arm64 @@ -23,3 +24,12 @@ run: .zuul/playbooks/containerd-build/unit-test.yaml nodeset: ubuntu-xenial-arm64-openlab voting: false + +- job: + name: containerd-integration-test-arm64 + parent: init-test + description: | + Containerd unit tests in openlab cluster. + run: .zuul/playbooks/containerd-build/integration-test.yaml + nodeset: ubuntu-xenial-arm64-openlab + voting: false diff --git a/.zuul/playbooks/containerd-build/integration-test.yaml b/.zuul/playbooks/containerd-build/integration-test.yaml new file mode 100644 index 000000000..a070afc6b --- /dev/null +++ b/.zuul/playbooks/containerd-build/integration-test.yaml @@ -0,0 +1,96 @@ +- hosts: all + become: yes + roles: + - role: config-golang + go_version: '1.16.3' + arch: arm64 + tasks: + - name: Install pre-requisites + shell: + cmd: | + set -xe + set -o pipefail + apt-get update + apt-get install -y btrfs-tools libseccomp-dev git pkg-config + + go version + chdir: '{{ zuul.project.src_dir }}' + executable: /bin/bash + environment: '{{ global_env }}' + - name: Install containerd and cri dependencies + shell: + cmd: | + set -xe + make install-deps + chdir: '{{ zuul.project.src_dir }}' + executable: /bin/bash + environment: '{{ global_env }}' + - name: Install criu + shell: + cmd: | + set -xe + apt-get install -y \ + libprotobuf-dev \ + libprotobuf-c-dev \ + protobuf-c-compiler \ + protobuf-compiler \ + python-protobuf \ + libnl-3-dev \ + libnet-dev \ + libcap-dev \ + python-future + wget https://github.com/checkpoint-restore/criu/archive/v3.13.tar.gz -O criu.tar.gz + tar -zxf criu.tar.gz + cd criu-3.13 + make install-criu + chdir: '{{ zuul.project.src_dir }}' + executable: /bin/bash + environment: '{{ global_env }}' + - name: Install containerd + shell: + cmd: | + set -xe + make binaries + make install | tee $LOGS_PATH/make_install.log + chdir: '{{ zuul.project.src_dir }}' + executable: /bin/bash + environment: '{{ global_env }}' + - name: Tests + shell: + cmd: | + make test | tee $LOGS_PATH/make_test.log + make root-test | tee $LOGS_PATH/make_root-test.log + chdir: '{{ zuul.project.src_dir }}' + executable: /bin/bash + environment: '{{ global_env }}' + - name: Integration 1 + shell: + cmd: | + make integration EXTRA_TESTFLAGS=-no-criu TESTFLAGS_RACE=-race | tee $LOGS_PATH/make_integration-test.log + chdir: '{{ zuul.project.src_dir }}' + executable: /bin/bash + environment: '{{ global_env }}' + - name: Integration 2 + shell: + cmd: | + TESTFLAGS_PARALLEL=1 make integration EXTRA_TESTFLAGS=-no-criu | tee $LOGS_PATH/make_integration-test.log + chdir: '{{ zuul.project.src_dir }}' + executable: /bin/bash + environment: '{{ global_env }}' + - name: CRI Integration Test + shell: + cmd: | + CONTAINERD_RUNTIME="io.containerd.runc.v2" make cri-integration | tee $LOGS_PATH/make_cri-integration-test.log + chdir: '{{ zuul.project.src_dir }}' + executable: /bin/bash + environment: '{{ global_env }}' + - name: CRI Integration Test + shell: + cmd: | + if grep -q "FAIL:" $LOGS_PATH/*.log; then + echo "FAILURE" + exit 1 + fi + chdir: '{{ zuul.project.src_dir }}' + executable: /bin/bash + environment: '{{ global_env }}'