From 321a5b687d05b1d6666a9182b0b48e2f62f97dac Mon Sep 17 00:00:00 2001 From: karampok Date: Mon, 23 Dec 2019 11:06:39 +0100 Subject: [PATCH] ci: add go integration tests with supervisord --- .buildkite/pipeline_buildlint.yml | 39 +++++++++++++++++++++++-------- scion.sh | 13 ----------- 2 files changed, 29 insertions(+), 23 deletions(-) diff --git a/.buildkite/pipeline_buildlint.yml b/.buildkite/pipeline_buildlint.yml index 65b1c02209..67a044a14e 100644 --- a/.buildkite/pipeline_buildlint.yml +++ b/.buildkite/pipeline_buildlint.yml @@ -21,14 +21,14 @@ steps: timeout_in_minutes: 10 - label: "Check generated go_deps.bzl file is up to date with go.mod" command: - - "rm -rf /tmp/$BUILDKITE_STEP_ID/" - - "mkdir -p /tmp/$BUILDKITE_STEP_ID/" - - "cp go.mod go.sum go_deps.bzl /tmp/$BUILDKITE_STEP_ID/" + - "rm -rf /tmp/${BUILDKITE_STEP_ID:-local}/" + - "mkdir -p /tmp/${BUILDKITE_STEP_ID:-local}/" + - "cp go.mod go.sum go_deps.bzl /tmp/${BUILDKITE_STEP_ID:-local}/" - "make godeps -B" - "bazel-${BUILDKITE_PIPELINE_SLUG}/external/go_sdk/bin/go mod tidy" - - "diff -u /tmp/$BUILDKITE_STEP_ID/go.mod go.mod" - - "diff -u /tmp/$BUILDKITE_STEP_ID/go.sum go.sum" - - "diff -u /tmp/$BUILDKITE_STEP_ID/go_deps.bzl go_deps.bzl" + - "diff -u /tmp/${BUILDKITE_STEP_ID:-local}/go.mod go.mod" + - "diff -u /tmp/${BUILDKITE_STEP_ID:-local}/go.sum go.sum" + - "diff -u /tmp/${BUILDKITE_STEP_ID:-local}/go_deps.bzl go_deps.bzl" key: go_deps_lint retry: automatic: @@ -36,11 +36,11 @@ steps: - exit_status: 255 # Forced agent shutdown - label: "Check generated go/proto files in git" command: - - "rm -rf /tmp/$BUILDKITE_STEP_ID/" - - "mkdir -p /tmp/$BUILDKITE_STEP_ID/" - - "cp -R go/proto/ /tmp/$BUILDKITE_STEP_ID/" + - "rm -rf /tmp/${BUILDKITE_STEP_ID:-local}/" + - "mkdir -p /tmp/${BUILDKITE_STEP_ID:-local}/" + - "cp -R go/proto/ /tmp/${BUILDKITE_STEP_ID:-local}/" - "make gogen" - - "diff -ur /tmp/$BUILDKITE_STEP_ID/proto/ go/proto/" + - "diff -ur /tmp/${BUILDKITE_STEP_ID:-local}/proto/ go/proto/" key: go_gen_lint retry: automatic: @@ -53,3 +53,22 @@ steps: automatic: - exit_status: -1 # Agent was lost - exit_status: 255 # Forced agent shutdown + - label: "Integration: {cert_req,pp,end2end,scmp}_integration" + command: + - bazel --bazelrc=.bazelrc_ci build //:scion //:scion-ci >/dev/null 2>&1 + - tar -kxf bazel-bin/scion.tar -C bin --overwrite + - tar -kxf bazel-bin/scion-ci.tar -C bin --overwrite + - ./scion.sh topology nobuild + - ./scion.sh run nobuild && sleep 10 + - ./bin/cert_req_integration -log.console warn -log.dir logs + - ./bin/pp_integration -log.console warn -log.dir logs + - ./bin/scmp_integration -log.console warn -log.dir logs + - ./bin/end2end_integration -log.console warn -log.dir logs + artifact_paths: + - "artifacts.out/**/*" + timeout_in_minutes: 5 + key: integration_tests + retry: + automatic: + - exit_status: -1 # Agent was lost + - exit_status: 255 # Forced agent shutdown diff --git a/scion.sh b/scion.sh index e8ee6dea18..2efb5a3da9 100755 --- a/scion.sh +++ b/scion.sh @@ -66,7 +66,6 @@ cmd_run() { ./tools/quiet ./docker.sh tester fi fi - run_setup echo "Running the network..." # Start dispatcher first, as it is requrired by the border routers. ./tools/quiet ./scion.sh mstart '*disp*' @@ -104,7 +103,6 @@ stop_jaeger() { } cmd_mstart() { - run_setup # Run with docker-compose or supervisor if is_docker_be; then services="$(glob_docker "$@")" @@ -115,17 +113,6 @@ cmd_mstart() { fi } -run_setup() { - python/integration/set_ipv6_addr.py -a - # Create dispatcher and sciond dirs or change owner - local disp_dir="/run/shm/dispatcher" - [ -d "$disp_dir" ] || mkdir "$disp_dir" - [ $(stat -c "%U" "$disp_dir") == "$LOGNAME" ] || { sudo -p "Fixing ownership of $disp_dir - [sudo] password for %p: " chown $LOGNAME: "$disp_dir"; } - local sciond_dir="/run/shm/sciond" - [ -d "$sciond_dir" ] || mkdir "$sciond_dir" - [ $(stat -c "%U" "$sciond_dir") == "$LOGNAME" ] || { sudo -p "Fixing ownership of $sciond_dir - [sudo] password for %p: " chown $LOGNAME: "$sciond_dir"; } -} - cmd_stop() { echo "Terminating this run of the SCION infrastructure" if is_docker_be; then