diff --git a/.github/workflows/go.yml b/.github/workflows/test.yml similarity index 62% rename from .github/workflows/go.yml rename to .github/workflows/test.yml index d3e7d9b96..1ff07eed9 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/test.yml @@ -1,7 +1,11 @@ -name: Go +name: Test SR-IOV Operator on: [push, pull_request] +concurrency: + group: ${{ github.head_ref || github.run_id }} + cancel-in-progress: true + jobs: build: @@ -88,3 +92,56 @@ jobs: with: github-token: ${{ secrets.GITHUB_TOKEN }} path-to-lcov: lcov.out + + virtual-k8s-cluster: + name: k8s + needs: [ + build, + test, + golangci, + ] + runs-on: [ sriov ] + steps: + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + + - name: Set up Go 1.20 + uses: actions/setup-go@v3 + with: + go-version: 1.20.x + + - name: run test + run: make test-e2e-conformance-virtual-k8s-cluster-ci + + - uses: actions/upload-artifact@v3 + if: always() + with: + name: k8s-artifact + path: ./k8s-artifacts + + virtual-ocp: + name: ocp + needs: [ + build, + test, + golangci, + ] + + runs-on: [ ocp ] + steps: + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + + - name: Set up Go 1.20 + uses: actions/setup-go@v3 + with: + go-version: 1.20.x + + - name: run test + run: make test-e2e-conformance-virtual-ocp-cluster-ci + + - uses: actions/upload-artifact@v3 + if: always() + with: + name: ocp-artifact + path: ./ocp-artifacts diff --git a/.github/workflows/virtual-cluster.yml b/.github/workflows/virtual-cluster.yml deleted file mode 100644 index 0d288e5c1..000000000 --- a/.github/workflows/virtual-cluster.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: sriov-operator-test -on: [pull_request] - -jobs: - virtual-k8s-cluster: - name: k8s - runs-on: [sriov] - steps: - - name: Check out code into the Go module directory - uses: actions/checkout@v2 - - - name: Set up Go 1.20 - uses: actions/setup-go@v3 - with: - go-version: 1.20.x - - - name: run test - run: make test-e2e-conformance-virtual-k8s-cluster-ci - - - uses: actions/upload-artifact@v3 - if: always() - with: - name: artifact - path: ./artifacts.tar.gz - - virtual-ocp: - name: ocp - runs-on: [ ocp ] - steps: - - name: Check out code into the Go module directory - uses: actions/checkout@v2 - - - name: Set up Go 1.20 - uses: actions/setup-go@v3 - with: - go-version: 1.20.x - - - name: run test - run: make test-e2e-conformance-virtual-ocp-cluster-ci - - - uses: actions/upload-artifact@v3 - if: always() - with: - name: artifact - path: ./artifacts.tar.gz diff --git a/hack/run-e2e-conformance-virtual-cluster.sh b/hack/run-e2e-conformance-virtual-cluster.sh index d7a2e4373..8f9f2c440 100755 --- a/hack/run-e2e-conformance-virtual-cluster.sh +++ b/hack/run-e2e-conformance-virtual-cluster.sh @@ -126,24 +126,38 @@ cat << EOF > /etc/containers/registries.conf.d/003-${cluster_name}.conf $insecure_registry EOF -kcli ssh $cluster_name-ctlplane-0 << EOF +function update_host() { + node_name=$1 + kcli ssh $node_name << EOF sudo su echo '$insecure_registry' > /etc/containers/registries.conf.d/003-internal.conf systemctl restart crio -EOF -kcli ssh $cluster_name-worker-0 << EOF -sudo su -echo '$insecure_registry' > /etc/containers/registries.conf.d/003-internal.conf -systemctl restart crio -EOF +echo '[connection] +id=multi +type=ethernet +[ethernet] +[match] +driver=igbvf; +[ipv4] +method=disabled +[ipv6] +addr-gen-mode=default +method=disabled +[proxy]' > /etc/NetworkManager/system-connections/multi.nmconnection + +chmod 600 /etc/NetworkManager/system-connections/multi.nmconnection +systemctl restart NetworkManager -kcli ssh $cluster_name-worker-1 << EOF -sudo su -echo '$insecure_registry' > /etc/containers/registries.conf.d/003-internal.conf -systemctl restart crio EOF +} + +update_host $cluster_name-ctlplane-0 +update_host $cluster_name-worker-0 +update_host $cluster_name-worker-1 + + kubectl create namespace container-registry echo "## deploy internal registry" @@ -347,6 +361,5 @@ hack/deploy-wait.sh if [ -z $SKIP_TEST ]; then echo "## run sriov e2e conformance tests" - SUITE=./test/conformance JUNIT_OUTPUT=`pwd`/artifacts hack/run-e2e-conformance.sh - tar -zcvf artifacts.tar.gz ./artifacts + SUITE=./test/conformance JUNIT_OUTPUT=`pwd`/k8s-artifacts hack/run-e2e-conformance.sh fi diff --git a/hack/run-e2e-conformance-virtual-ocp.sh b/hack/run-e2e-conformance-virtual-ocp.sh index 0cfb16875..a23410b04 100755 --- a/hack/run-e2e-conformance-virtual-ocp.sh +++ b/hack/run-e2e-conformance-virtual-ocp.sh @@ -235,6 +235,5 @@ hack/deploy-wait.sh if [ -z $SKIP_TEST ]; then echo "## run sriov e2e conformance tests" - SUITE=./test/conformance JUNIT_OUTPUT=`pwd`/artifacts hack/run-e2e-conformance.sh - tar -zcvf artifacts.tar.gz `pwd`/artifacts + SUITE=./test/conformance JUNIT_OUTPUT=`pwd`/ocp-artifacts hack/run-e2e-conformance.sh fi