diff --git a/.github/workflows/branchtest.yml b/.github/workflows/branchtest.yml index 9806bba..7dab7a1 100644 --- a/.github/workflows/branchtest.yml +++ b/.github/workflows/branchtest.yml @@ -51,37 +51,37 @@ jobs: run: | curl -L ${{ inputs.api }}/api/users/adm/createsuperadmin -d '{"username":"${{ secrets.NM_USER }}","password":"${{ secrets.NM_PASSWORD }}"}' - clean: - name: remove all gateways - runs-on: ubuntu-latest - steps: - - name: get binary - run: | - mkdir bin - wget -O bin/test fileserver.clustercat.com/testing/test - - name: run tests - id: clean - run: | - chmod +x bin/test - bin/test clean - env: - DIGITALOCEAN_TOKEN: ${{ secrets.TESTING_DO_TOKEN }} - KEY: ${{ secrets.TESTING_SSH_KEY }} - TAG: ${{ inputs.tag }} - NETWORK: ${{ inputs.network}} - MASTERKEY: ${{ inputs.masterkey }} - API: ${{ inputs.api }} - - name: save logs - if: success() || failure() - uses: actions/upload-artifact@v3 - with: - name: clean - path: /tmp/clean.log - retention-days: 3 + # clean: + # name: remove all gateways + # runs-on: ubuntu-latest + # steps: + # - name: get binary + # run: | + # mkdir bin + # wget -O bin/test fileserver.clustercat.com/testing/test + # - name: run tests + # id: clean + # run: | + # chmod +x bin/test + # bin/test clean + # env: + # DIGITALOCEAN_TOKEN: ${{ secrets.TESTING_DO_TOKEN }} + # KEY: ${{ secrets.TESTING_SSH_KEY }} + # TAG: ${{ inputs.tag }} + # NETWORK: ${{ inputs.network}} + # MASTERKEY: ${{ inputs.masterkey }} + # API: ${{ inputs.api }} + # - name: save logs + # if: success() || failure() + # uses: actions/upload-artifact@v3 + # with: + # name: clean + # path: /tmp/clean.log + # retention-days: 3 initial-ping: - needs: [clean] + # needs: [clean] name: initial ping runs-on: ubuntu-latest steps: @@ -111,7 +111,7 @@ jobs: retention-days: 3 tests: - needs: [initial-ping, clean] + needs: [initial-ping] name: tests runs-on: ubuntu-latest steps: @@ -125,8 +125,7 @@ jobs: bin/test peerUpdate -s ${{ inputs.server }} bin/test ingress bin/test egress - bin/test relay - bin/test internetGateway + env: DIGITALOCEAN_TOKEN: ${{ secrets.TESTING_DO_TOKEN }} KEY: ${{ secrets.TESTING_SSH_KEY }} @@ -173,7 +172,7 @@ jobs: results: if: success() || failure() - needs: [clean, initial-ping, tests, final-ping] + needs: [initial-ping, tests, final-ping] name: sumarize results runs-on: ubuntu-latest steps: @@ -188,7 +187,7 @@ jobs: path: /tmp - name: generate results run: | - test/scripts/results.sh + test/scripts/branchresults.sh - name: upload results uses: actions/upload-artifact@v3 with: diff --git a/.github/workflows/testdeploybranch.yml b/.github/workflows/testdeploybranch.yml index 80ba568..9320eec 100644 --- a/.github/workflows/testdeploybranch.yml +++ b/.github/workflows/testdeploybranch.yml @@ -110,7 +110,7 @@ jobs: testbranch: needs: [getserver, terraform, masterkey] - uses: gravitl/devops/.github/workflows/branchtest.yml@NET-1485-b + uses: ./.github/workflows/branchtest.yml with: tag: ${{ inputs.tag }} network: netmaker diff --git a/netmaker/gateways.go b/netmaker/gateways.go index f6110aa..25cb3b4 100644 --- a/netmaker/gateways.go +++ b/netmaker/gateways.go @@ -23,11 +23,12 @@ func CreateExtClient(client Netclient, network string) string { "devops": "road-warrior", "devops4": "road-warrior2", "devopsv6": "road-warrior3", + "netmaker": "road-warrior4", } slog.Info("creating ext client", clients[network], network) clientID, exists := clients[network] if !exists { - slog.Error("No client ID found for network '%s'\n", network) + slog.Error("No client ID found for network", network) return "" } diff --git a/test/scripts/branchresults.sh b/test/scripts/branchresults.sh new file mode 100755 index 0000000..0feec58 --- /dev/null +++ b/test/scripts/branchresults.sh @@ -0,0 +1,97 @@ +#! /bin/bash +if [ -f /tmp/clean/clean.log ] +then + grep ERROR /tmp/clean/clean.log >> /tmp/errors.log + if [ $? -eq 0 ] + then + echo "removing gateways: FAILED" >> /tmp/results.log + else + echo "removing gateways: PASSED" >> /tmp/results.log + fi +else + echo "removing gateways: NOT RUN" >> /tmp/results.log +fi + +if [ -f /tmp/ping/ping.log ] +then + grep ERROR /tmp/ping/ping.log >> /tmp/errors.log + if [ $? -eq 0 ] + then + echo "initial ping: FAILED" >> /tmp/results.log + else + echo "initial ping: PASSED" >> /tmp/results.log + fi +else + echo "initial ping: NOT RUN" >> /tmp/results.log +fi + +if [ -f /tmp/tests/peerupdate.log ] +then + grep ERROR /tmp/tests/peerupdate.log >> /tmp/errors.log + if [ $? -eq 0 ] + then + echo "peerupdate: FAILED" >> /tmp/results.log + else + echo "peerupdate: PASSED" >> /tmp/results.log + fi +else + echo "peerupdate: NOT RUN" >> /tmp/results.log +fi + +if [ -f /tmp/tests/ingress.log ] +then + grep ERROR /tmp/tests/ingress.log >> /tmp/errors.log + if [ $? -eq 0 ] + then + echo "ingress: FAILED" >> /tmp/results.log + else + echo "ingress: PASSED" >> /tmp/results.log + fi +else + echo "ingress: NOT RUN" >> /tmp/results.log +fi + +if [ -f /tmp/tests/egress.log ] +then + grep ERROR /tmp/tests/egress.log >> /tmp/errors.log + if [ $? -eq 0 ] + then + echo "egress: FAILED" >> /tmp/results.log + else + echo "egress: PASSED" >> /tmp/results.log + fi +else + echo "egress: NOT RUN" >> /tmp/results.log +fi + +if [ -f /tmp/tests/relay.log ] +then + grep ERROR /tmp/tests/relay.log >> /tmp/errors.log + if [ $? -eq 0 ] + then + echo "relay: FAILED" >> /tmp/results.log + else + grep "WARN" /tmp/tests/relay.log + if [ $? -eq 0 ] + then + echo "relay: SKIPPED" >> /tmp/results.log + else + echo "relay: PASSED" >> /tmp/results.log + fi + fi +else + echo "relay: NOT RUN" >> /tmp/results.log +fi + +if [ -f /tmp/ping2/ping.log ] +then + grep ERROR /tmp/ping2/ping.log >> /tmp/errors.log + if [ $? -eq 0 ] + then + echo "final ping: FAILED" >> /tmp/results.log + else + echo "final ping: PASSED" >> /tmp/results.log + fi +else + echo "final ping: NOT RUN" >> /tmp/results.log +fi \ No newline at end of file