diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index e2c36b5..a50e63d 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -149,307 +149,307 @@ jobs: run: | ./do.sh topo rm dp - dp_py: - runs-on: ubuntu-22.04 - steps: - - name: Checkout source - uses: actions/checkout@v3 - - name: Setup docker - uses: docker-practice/actions-setup-docker@master - - name: Deploy back-to-back DP-only distribution of ixia-c - run: | - ./do.sh topo new dp - - name: Setup Python - uses: actions/setup-python@v4 - with: - python-version: ${{ env.PYTHON_VERSION }} - - name: Setup test prerequisites - run: | - ./do.sh prepytest - - name: Run Python DP-only tests - run: | - ./do.sh pytest -m dp ./feature/b2b/ - - name: Get container logs - if: always() - run: | - ./do.sh topo logs - - name: Archive logs - if: always() - uses: actions/upload-artifact@v3 - with: - name: dp_py - path: | - logs - - name: Teardown back-to-back DP-only distribution of ixia-c - run: | - ./do.sh topo rm dp + # dp_py: + # runs-on: ubuntu-22.04 + # steps: + # - name: Checkout source + # uses: actions/checkout@v3 + # - name: Setup docker + # uses: docker-practice/actions-setup-docker@master + # - name: Deploy back-to-back DP-only distribution of ixia-c + # run: | + # ./do.sh topo new dp + # - name: Setup Python + # uses: actions/setup-python@v4 + # with: + # python-version: ${{ env.PYTHON_VERSION }} + # - name: Setup test prerequisites + # run: | + # ./do.sh prepytest + # - name: Run Python DP-only tests + # run: | + # ./do.sh pytest -m dp ./feature/b2b/ + # - name: Get container logs + # if: always() + # run: | + # ./do.sh topo logs + # - name: Archive logs + # if: always() + # uses: actions/upload-artifact@v3 + # with: + # name: dp_py + # path: | + # logs + # - name: Teardown back-to-back DP-only distribution of ixia-c + # run: | + # ./do.sh topo rm dp - dp_go: - runs-on: ubuntu-22.04 - steps: - - name: Checkout source - uses: actions/checkout@v3 - - name: Setup docker - uses: docker-practice/actions-setup-docker@master - - name: Deploy back-to-back DP-only distribution of ixia-c - run: | - ./do.sh topo new dp - - name: Setup Go - uses: actions/setup-go@v3 - with: - go-version: ${{ env.GO_VERSION }} - - uses: actions/cache@v3 - with: - path: | - ~/.cache/go-build - ~/go/pkg/mod - key: dp_go_${{ hashFiles('go.sum') }} - restore-keys: | - dp_go_ - - name: Run Go DP-only tests - run: | - ./do.sh gotest -tags="dp" ./feature/b2b/... - - name: Get container logs - if: always() - run: | - ./do.sh topo logs - - name: Archive logs - if: always() - uses: actions/upload-artifact@v3 - with: - name: dp_go - path: | - logs - - name: Teardown back-to-back DP-only distribution of ixia-c - run: | - ./do.sh topo rm dp + # dp_go: + # runs-on: ubuntu-22.04 + # steps: + # - name: Checkout source + # uses: actions/checkout@v3 + # - name: Setup docker + # uses: docker-practice/actions-setup-docker@master + # - name: Deploy back-to-back DP-only distribution of ixia-c + # run: | + # ./do.sh topo new dp + # - name: Setup Go + # uses: actions/setup-go@v3 + # with: + # go-version: ${{ env.GO_VERSION }} + # - uses: actions/cache@v3 + # with: + # path: | + # ~/.cache/go-build + # ~/go/pkg/mod + # key: dp_go_${{ hashFiles('go.sum') }} + # restore-keys: | + # dp_go_ + # - name: Run Go DP-only tests + # run: | + # ./do.sh gotest -tags="dp" ./feature/b2b/... + # - name: Get container logs + # if: always() + # run: | + # ./do.sh topo logs + # - name: Archive logs + # if: always() + # uses: actions/upload-artifact@v3 + # with: + # name: dp_go + # path: | + # logs + # - name: Teardown back-to-back DP-only distribution of ixia-c + # run: | + # ./do.sh topo rm dp - cpdp_py: - runs-on: ubuntu-22.04 - steps: - - name: Checkout source - uses: actions/checkout@v3 - - name: Setup docker - uses: docker-practice/actions-setup-docker@master - - name: Deploy back-to-back CP/DP distribution of ixia-c - run: | - GITHUB_USER=${{ secrets.ENV_GITHUB_USER }} GITHUB_PAT=${{ secrets.ENV_GITHUB_PAT }} LICENSING=true ./do.sh topo new cpdp - - name: Setup Python - uses: actions/setup-python@v4 - with: - python-version: ${{ env.PYTHON_VERSION }} - - name: Setup test prerequisites - run: | - ./do.sh prepytest - - name: Run Python tests - run: | - ./do.sh pytest ./feature/b2b/ - - name: Get container logs - if: always() - run: | - ./do.sh topo logs cpdp - - name: Archive logs - if: always() - uses: actions/upload-artifact@v3 - with: - name: cpdp_py - path: | - logs - - name: Teardown back-to-back CP/DP distribution of ixia-c - run: | - LICENSING=true ./do.sh topo rm cpdp + # cpdp_py: + # runs-on: ubuntu-22.04 + # steps: + # - name: Checkout source + # uses: actions/checkout@v3 + # - name: Setup docker + # uses: docker-practice/actions-setup-docker@master + # - name: Deploy back-to-back CP/DP distribution of ixia-c + # run: | + # GITHUB_USER=${{ secrets.ENV_GITHUB_USER }} GITHUB_PAT=${{ secrets.ENV_GITHUB_PAT }} LICENSING=true ./do.sh topo new cpdp + # - name: Setup Python + # uses: actions/setup-python@v4 + # with: + # python-version: ${{ env.PYTHON_VERSION }} + # - name: Setup test prerequisites + # run: | + # ./do.sh prepytest + # - name: Run Python tests + # run: | + # ./do.sh pytest ./feature/b2b/ + # - name: Get container logs + # if: always() + # run: | + # ./do.sh topo logs cpdp + # - name: Archive logs + # if: always() + # uses: actions/upload-artifact@v3 + # with: + # name: cpdp_py + # path: | + # logs + # - name: Teardown back-to-back CP/DP distribution of ixia-c + # run: | + # LICENSING=true ./do.sh topo rm cpdp - cpdp_go: - runs-on: ubuntu-22.04 - steps: - - name: Checkout source - uses: actions/checkout@v3 - - name: Setup docker - uses: docker-practice/actions-setup-docker@master - - name: Deploy back-to-back CP/DP distribution of ixia-c - run: | - GITHUB_USER=${{ secrets.ENV_GITHUB_USER }} GITHUB_PAT=${{ secrets.ENV_GITHUB_PAT }} LICENSING=true ./do.sh topo new cpdp - - name: Setup Go - uses: actions/setup-go@v3 - with: - go-version: ${{ env.GO_VERSION }} - - uses: actions/cache@v3 - with: - path: | - ~/.cache/go-build - ~/go/pkg/mod - key: cpdp_go_${{ hashFiles('go.sum') }} - restore-keys: | - cpdp_go_ - - name: Run Go tests - run: | - ./do.sh gotest -tags=all ./feature/b2b/... - - name: Get container logs - if: always() - run: | - ./do.sh topo logs cpdp - - name: Archive logs - if: always() - uses: actions/upload-artifact@v3 - with: - name: cpdp_go - path: | - logs - - name: Teardown back-to-back CP/DP distribution of ixia-c - run: | - LICENSING=true ./do.sh topo rm cpdp + # cpdp_go: + # runs-on: ubuntu-22.04 + # steps: + # - name: Checkout source + # uses: actions/checkout@v3 + # - name: Setup docker + # uses: docker-practice/actions-setup-docker@master + # - name: Deploy back-to-back CP/DP distribution of ixia-c + # run: | + # GITHUB_USER=${{ secrets.ENV_GITHUB_USER }} GITHUB_PAT=${{ secrets.ENV_GITHUB_PAT }} LICENSING=true ./do.sh topo new cpdp + # - name: Setup Go + # uses: actions/setup-go@v3 + # with: + # go-version: ${{ env.GO_VERSION }} + # - uses: actions/cache@v3 + # with: + # path: | + # ~/.cache/go-build + # ~/go/pkg/mod + # key: cpdp_go_${{ hashFiles('go.sum') }} + # restore-keys: | + # cpdp_go_ + # - name: Run Go tests + # run: | + # ./do.sh gotest -tags=all ./feature/b2b/... + # - name: Get container logs + # if: always() + # run: | + # ./do.sh topo logs cpdp + # - name: Archive logs + # if: always() + # uses: actions/upload-artifact@v3 + # with: + # name: cpdp_go + # path: | + # logs + # - name: Teardown back-to-back CP/DP distribution of ixia-c + # run: | + # LICENSING=true ./do.sh topo rm cpdp - cpdp_ipv6_py: - runs-on: ubuntu-22.04 - steps: - - name: Checkout source - uses: actions/checkout@v3 - - name: Setup docker - uses: docker-practice/actions-setup-docker@master - - name: Deploy back-to-back CP/DP distribution of ixia-c - run: | - GITHUB_USER=${{ secrets.ENV_GITHUB_USER }} GITHUB_PAT=${{ secrets.ENV_GITHUB_PAT }} LICENSING=true ./do.sh topo new cpdp ipv6 - - name: Setup Python - uses: actions/setup-python@v4 - with: - python-version: ${{ env.PYTHON_VERSION }} - - name: Setup test prerequisites - run: | - ./do.sh prepytest - - name: Run Python tests - run: | - ./do.sh pytest ./feature/b2b/ - - name: Get container logs - if: always() - run: | - ./do.sh topo logs cpdp - - name: Archive logs - if: always() - uses: actions/upload-artifact@v3 - with: - name: cpdp_ipv6_py - path: | - logs - - name: Teardown back-to-back CP/DP distribution of ixia-c - run: | - LICENSING=true ./do.sh topo rm cpdp + # cpdp_ipv6_py: + # runs-on: ubuntu-22.04 + # steps: + # - name: Checkout source + # uses: actions/checkout@v3 + # - name: Setup docker + # uses: docker-practice/actions-setup-docker@master + # - name: Deploy back-to-back CP/DP distribution of ixia-c + # run: | + # GITHUB_USER=${{ secrets.ENV_GITHUB_USER }} GITHUB_PAT=${{ secrets.ENV_GITHUB_PAT }} LICENSING=true ./do.sh topo new cpdp ipv6 + # - name: Setup Python + # uses: actions/setup-python@v4 + # with: + # python-version: ${{ env.PYTHON_VERSION }} + # - name: Setup test prerequisites + # run: | + # ./do.sh prepytest + # - name: Run Python tests + # run: | + # ./do.sh pytest ./feature/b2b/ + # - name: Get container logs + # if: always() + # run: | + # ./do.sh topo logs cpdp + # - name: Archive logs + # if: always() + # uses: actions/upload-artifact@v3 + # with: + # name: cpdp_ipv6_py + # path: | + # logs + # - name: Teardown back-to-back CP/DP distribution of ixia-c + # run: | + # LICENSING=true ./do.sh topo rm cpdp - cpdp_ipv6_go: - runs-on: ubuntu-22.04 - steps: - - name: Checkout source - uses: actions/checkout@v3 - - name: Setup docker - uses: docker-practice/actions-setup-docker@master - - name: Deploy back-to-back CP/DP distribution of ixia-c - run: | - GITHUB_USER=${{ secrets.ENV_GITHUB_USER }} GITHUB_PAT=${{ secrets.ENV_GITHUB_PAT }} LICENSING=true ./do.sh topo new cpdp ipv6 - - name: Setup Go - uses: actions/setup-go@v3 - with: - go-version: ${{ env.GO_VERSION }} - - uses: actions/cache@v3 - with: - path: | - ~/.cache/go-build - ~/go/pkg/mod - key: cpdp_ipv6_go_${{ hashFiles('go.sum') }} - restore-keys: | - cpdp_ipv6_go_ - - name: Run Go tests - run: | - ./do.sh gotest -tags=all ./feature/b2b/... - - name: Get container logs - if: always() - run: | - ./do.sh topo logs cpdp - - name: Archive logs - if: always() - uses: actions/upload-artifact@v3 - with: - name: cpdp_ipv6_go - path: | - logs - - name: Teardown back-to-back CP/DP distribution of ixia-c - run: | - LICENSING=true ./do.sh topo rm cpdp + # cpdp_ipv6_go: + # runs-on: ubuntu-22.04 + # steps: + # - name: Checkout source + # uses: actions/checkout@v3 + # - name: Setup docker + # uses: docker-practice/actions-setup-docker@master + # - name: Deploy back-to-back CP/DP distribution of ixia-c + # run: | + # GITHUB_USER=${{ secrets.ENV_GITHUB_USER }} GITHUB_PAT=${{ secrets.ENV_GITHUB_PAT }} LICENSING=true ./do.sh topo new cpdp ipv6 + # - name: Setup Go + # uses: actions/setup-go@v3 + # with: + # go-version: ${{ env.GO_VERSION }} + # - uses: actions/cache@v3 + # with: + # path: | + # ~/.cache/go-build + # ~/go/pkg/mod + # key: cpdp_ipv6_go_${{ hashFiles('go.sum') }} + # restore-keys: | + # cpdp_ipv6_go_ + # - name: Run Go tests + # run: | + # ./do.sh gotest -tags=all ./feature/b2b/... + # - name: Get container logs + # if: always() + # run: | + # ./do.sh topo logs cpdp + # - name: Archive logs + # if: always() + # uses: actions/upload-artifact@v3 + # with: + # name: cpdp_ipv6_go + # path: | + # logs + # - name: Teardown back-to-back CP/DP distribution of ixia-c + # run: | + # LICENSING=true ./do.sh topo rm cpdp - kne_b2b_py: - runs-on: ubuntu-22.04 - steps: - - name: Checkout source - uses: actions/checkout@v3 - - name: Setup docker - uses: docker-practice/actions-setup-docker@master - - name: Setup Go - uses: actions/setup-go@v3 - with: - go-version: ${{ env.GO_VERSION }} - - name: Setup KNE cluster - run: | - GITHUB_USER=${{ secrets.ENV_GITHUB_USER }} GITHUB_PAT=${{ secrets.ENV_GITHUB_PAT }} LICENSING=true ./do.sh new_k8s_cluster kne - - name: Deploy KNE OTG back-to-back topology - run: | - GITHUB_USER=${{ secrets.ENV_GITHUB_USER }} GITHUB_PAT=${{ secrets.ENV_GITHUB_PAT }} LICENSING=true ./do.sh topo new kneb2b - - name: Setup Python - uses: actions/setup-python@v4 - with: - python-version: ${{ env.PYTHON_VERSION }} - - name: Setup test prerequisites - run: | - ./do.sh prepytest - - name: Run Python tests - run: | - ./do.sh pytest ./feature/b2b/ - - name: Archive logs - if: always() - uses: actions/upload-artifact@v3 - with: - name: kne_b2b_py - path: | - logs - - name: Teardown KNE OTG back-to-back topology - run: | - LICENSING=true ./do.sh topo rm kneb2b + # kne_b2b_py: + # runs-on: ubuntu-22.04 + # steps: + # - name: Checkout source + # uses: actions/checkout@v3 + # - name: Setup docker + # uses: docker-practice/actions-setup-docker@master + # - name: Setup Go + # uses: actions/setup-go@v3 + # with: + # go-version: ${{ env.GO_VERSION }} + # - name: Setup KNE cluster + # run: | + # GITHUB_USER=${{ secrets.ENV_GITHUB_USER }} GITHUB_PAT=${{ secrets.ENV_GITHUB_PAT }} LICENSING=true ./do.sh new_k8s_cluster kne + # - name: Deploy KNE OTG back-to-back topology + # run: | + # GITHUB_USER=${{ secrets.ENV_GITHUB_USER }} GITHUB_PAT=${{ secrets.ENV_GITHUB_PAT }} LICENSING=true ./do.sh topo new kneb2b + # - name: Setup Python + # uses: actions/setup-python@v4 + # with: + # python-version: ${{ env.PYTHON_VERSION }} + # - name: Setup test prerequisites + # run: | + # ./do.sh prepytest + # - name: Run Python tests + # run: | + # ./do.sh pytest ./feature/b2b/ + # - name: Archive logs + # if: always() + # uses: actions/upload-artifact@v3 + # with: + # name: kne_b2b_py + # path: | + # logs + # - name: Teardown KNE OTG back-to-back topology + # run: | + # LICENSING=true ./do.sh topo rm kneb2b - kne_b2b_go: - runs-on: ubuntu-22.04 - steps: - - name: Checkout source - uses: actions/checkout@v3 - - name: Setup docker - uses: docker-practice/actions-setup-docker@master - - name: Setup Go - uses: actions/setup-go@v3 - with: - go-version: ${{ env.GO_VERSION }} - - uses: actions/cache@v3 - with: - path: | - ~/.cache/go-build - ~/go/pkg/mod - key: kne_b2b_go_${{ hashFiles('go.sum') }} - restore-keys: | - kne_b2b_go_ - - name: Setup KNE cluster - run: | - GITHUB_USER=${{ secrets.ENV_GITHUB_USER }} GITHUB_PAT=${{ secrets.ENV_GITHUB_PAT }} LICENSING=true ./do.sh new_k8s_cluster kne - - name: Deploy KNE OTG back-to-back topology - run: | - GITHUB_USER=${{ secrets.ENV_GITHUB_USER }} GITHUB_PAT=${{ secrets.ENV_GITHUB_PAT }} LICENSING=true ./do.sh topo new kneb2b - - name: Run Go tests - run: | - ./do.sh gotest -tags=all ./feature/b2b/... - - name: Archive logs - if: always() - uses: actions/upload-artifact@v3 - with: - name: kne_b2b_go - path: | - logs - - name: Teardown KNE OTG back-to-back topology - run: | - LICENSING=true ./do.sh topo rm kneb2b + # kne_b2b_go: + # runs-on: ubuntu-22.04 + # steps: + # - name: Checkout source + # uses: actions/checkout@v3 + # - name: Setup docker + # uses: docker-practice/actions-setup-docker@master + # - name: Setup Go + # uses: actions/setup-go@v3 + # with: + # go-version: ${{ env.GO_VERSION }} + # - uses: actions/cache@v3 + # with: + # path: | + # ~/.cache/go-build + # ~/go/pkg/mod + # key: kne_b2b_go_${{ hashFiles('go.sum') }} + # restore-keys: | + # kne_b2b_go_ + # - name: Setup KNE cluster + # run: | + # GITHUB_USER=${{ secrets.ENV_GITHUB_USER }} GITHUB_PAT=${{ secrets.ENV_GITHUB_PAT }} LICENSING=true ./do.sh new_k8s_cluster kne + # - name: Deploy KNE OTG back-to-back topology + # run: | + # GITHUB_USER=${{ secrets.ENV_GITHUB_USER }} GITHUB_PAT=${{ secrets.ENV_GITHUB_PAT }} LICENSING=true ./do.sh topo new kneb2b + # - name: Run Go tests + # run: | + # ./do.sh gotest -tags=all ./feature/b2b/... + # - name: Archive logs + # if: always() + # uses: actions/upload-artifact@v3 + # with: + # name: kne_b2b_go + # path: | + # logs + # - name: Teardown KNE OTG back-to-back topology + # run: | + # LICENSING=true ./do.sh topo rm kneb2b kne_pdp_arista_go: runs-on: ubuntu-22.04 @@ -529,45 +529,45 @@ jobs: run: | LICENSING=true ./do.sh topo rm k8seth0 - b2blag: - runs-on: ubuntu-22.04 - steps: - - name: Checkout source - uses: actions/checkout@v3 - - name: Setup docker - uses: docker-practice/actions-setup-docker@master - - name: Deploy back-to-back LAG CP/DP distribution of ixia-c - run: | - GITHUB_USER=${{ secrets.ENV_GITHUB_USER }} GITHUB_PAT=${{ secrets.ENV_GITHUB_PAT }} LICENSING=true ./do.sh topo new b2blag - - name: Setup Go - uses: actions/setup-go@v3 - with: - go-version: ${{ env.GO_VERSION }} - - uses: actions/cache@v3 - with: - path: | - ~/.cache/go-build - ~/go/pkg/mod - key: b2blag_${{ hashFiles('go.sum') }} - restore-keys: | - b2blag_ - - name: Run Go LAG tests - run: | - ./do.sh gotest -tags="all" ./feature/b2blag/3p3p/... - - name: Get container logs - if: always() - run: | - ./do.sh topo logs cpdp - - name: Archive logs - if: always() - uses: actions/upload-artifact@v3 - with: - name: b2blag - path: | - logs - - name: Teardown back-to-back LAG CP/DP distribution of ixia-c - run: | - LICENSING=true ./do.sh topo rm b2blag + # b2blag: + # runs-on: ubuntu-22.04 + # steps: + # - name: Checkout source + # uses: actions/checkout@v3 + # - name: Setup docker + # uses: docker-practice/actions-setup-docker@master + # - name: Deploy back-to-back LAG CP/DP distribution of ixia-c + # run: | + # GITHUB_USER=${{ secrets.ENV_GITHUB_USER }} GITHUB_PAT=${{ secrets.ENV_GITHUB_PAT }} LICENSING=true ./do.sh topo new b2blag + # - name: Setup Go + # uses: actions/setup-go@v3 + # with: + # go-version: ${{ env.GO_VERSION }} + # - uses: actions/cache@v3 + # with: + # path: | + # ~/.cache/go-build + # ~/go/pkg/mod + # key: b2blag_${{ hashFiles('go.sum') }} + # restore-keys: | + # b2blag_ + # - name: Run Go LAG tests + # run: | + # ./do.sh gotest -tags="all" ./feature/b2blag/3p3p/... + # - name: Get container logs + # if: always() + # run: | + # ./do.sh topo logs cpdp + # - name: Archive logs + # if: always() + # uses: actions/upload-artifact@v3 + # with: + # name: b2blag + # path: | + # logs + # - name: Teardown back-to-back LAG CP/DP distribution of ixia-c + # run: | + # LICENSING=true ./do.sh topo rm b2blag client_perf_py: runs-on: ubuntu-22.04 diff --git a/.gitignore b/.gitignore index 2eeb6b8..74092de 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,5 @@ logs/ /deployments/k8s/meshnet-cni /deployments/k8s/mod.yaml /etc +/deployments/.ixia-c-config.yaml +/deployments/k8s/manifests/.ixia-c-b2b-eth0.yaml \ No newline at end of file diff --git a/deployments/ixia-c-config.yaml b/deployments/ixia-c-config.yaml deleted file mode 100644 index dbb5100..0000000 --- a/deployments/ixia-c-config.yaml +++ /dev/null @@ -1,40 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: ixiatg-release-config - namespace: ixiatg-op-system -data: - versions: | - { - "release": "local", - "images": [ - { - "name": "controller", - "path": "ghcr.io/open-traffic-generator/keng-controller", - "tag": "1.6.2-1", - "env": { - "TRACE": "true" - } - }, - { - "name": "gnmi-server", - "path": "ghcr.io/open-traffic-generator/otg-gnmi-server", - "tag": "1.14.4" - }, - { - "name": "traffic-engine", - "path": "ghcr.io/open-traffic-generator/ixia-c-traffic-engine", - "tag": "1.8.0.12" - }, - { - "name": "protocol-engine", - "path": "ghcr.io/open-traffic-generator/ixia-c-protocol-engine", - "tag": "1.00.0.390" - }, - { - "name": "ixhw-server", - "path": "ghcr.io/open-traffic-generator/keng-layer23-hw-server", - "tag": "1.6.2-1" - } - ] - } diff --git a/deployments/ixia-c-licensed-config.yaml b/deployments/ixia-c-licensed-config.yaml deleted file mode 100644 index 8794be9..0000000 --- a/deployments/ixia-c-licensed-config.yaml +++ /dev/null @@ -1,45 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: ixiatg-release-config - namespace: ixiatg-op-system -data: - versions: | - { - "release": "local", - "images": [ - { - "name": "controller", - "path": "ghcr.io/open-traffic-generator/keng-controller", - "tag": "1.6.2-1", - "env": { - "TRACE": "true" - } - }, - { - "name": "gnmi-server", - "path": "ghcr.io/open-traffic-generator/otg-gnmi-server", - "tag": "1.14.4" - }, - { - "name": "traffic-engine", - "path": "ghcr.io/open-traffic-generator/ixia-c-traffic-engine", - "tag": "1.8.0.12" - }, - { - "name": "protocol-engine", - "path": "ghcr.io/open-traffic-generator/ixia-c-protocol-engine", - "tag": "1.00.0.390" - }, - { - "name": "ixhw-server", - "path": "ghcr.io/open-traffic-generator/keng-layer23-hw-server", - "tag": "1.6.2-1" - }, - { - "name": "license-server", - "path": "ghcr.io/open-traffic-generator/licensed/keng-license-server", - "tag": "latest" - } - ] - } diff --git a/deployments/k8s/kne-manifests/ixia-c-b2b.yaml b/deployments/k8s/kne-manifests/ixia-c-b2b.yaml index 93c1891..dcdff17 100644 --- a/deployments/k8s/kne-manifests/ixia-c-b2b.yaml +++ b/deployments/k8s/kne-manifests/ixia-c-b2b.yaml @@ -18,3 +18,4 @@ links: a_int: eth1 z_node: otg z_int: eth2 + diff --git a/deployments/k8s/manifests/ixia-c-b2b-eth0.yaml b/deployments/k8s/manifests/ixia-c-b2b-eth0.yaml index c01ddc0..ee4d4a8 100644 --- a/deployments/k8s/manifests/ixia-c-b2b-eth0.yaml +++ b/deployments/k8s/manifests/ixia-c-b2b-eth0.yaml @@ -34,7 +34,7 @@ items: - args: - --accept-eula - --debug - image: ghcr.io/open-traffic-generator/keng-controller:local + image: $(configq .images[0].path):$(configq .images[0].tag) imagePullPolicy: IfNotPresent name: keng-controller volumeMounts: @@ -45,7 +45,7 @@ items: - -http-server - https://localhost:8443 - --debug - image: ghcr.io/open-traffic-generator/otg-gnmi-server:local + image: $(configq .images[1].path):$(configq .images[1].tag) imagePullPolicy: IfNotPresent name: otg-gnmi-server ports: @@ -77,7 +77,7 @@ items: value: "5555" - name: ARG_CORE_LIST value: 1 1 1 - image: ghcr.io/open-traffic-generator/ixia-c-traffic-engine:local + image: $(configq .images[2].path):$(configq .images[2].tag) imagePullPolicy: IfNotPresent name: otg-port-eth1-traffic-engine securityContext: @@ -85,7 +85,7 @@ items: - env: - name: INTF_LIST value: eth0 - image: ghcr.io/open-traffic-generator/ixia-c-protocol-engine:local + image: $(configq .images[3].path):$(configq .images[3].tag) imagePullPolicy: IfNotPresent name: otg-port-eth1-protocol-engine securityContext: @@ -110,7 +110,7 @@ items: value: "5555" - name: ARG_CORE_LIST value: 1 1 1 - image: ghcr.io/open-traffic-generator/ixia-c-traffic-engine:local + image: $(configq .images[2].path):$(configq .images[2].tag) imagePullPolicy: IfNotPresent name: otg-port-eth2-traffic-engine securityContext: @@ -118,7 +118,7 @@ items: - env: - name: INTF_LIST value: eth0 - image: ghcr.io/open-traffic-generator/ixia-c-protocol-engine:local + image: $(configq .images[3].path):$(configq .images[3].tag) imagePullPolicy: IfNotPresent name: otg-port-eth2-protocol-engine securityContext: diff --git a/deployments/template-ixia-c-config.yaml b/deployments/template-ixia-c-config.yaml new file mode 100644 index 0000000..5027abc --- /dev/null +++ b/deployments/template-ixia-c-config.yaml @@ -0,0 +1,33 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: ixiatg-release-config + namespace: ixiatg-op-system +data: + versions: | + { + "release": "local", + "images": [ + { + "name": "controller", + "path": "$(configq .images[0].path)", + "tag": "$(configq .images[0].tag)" + }, + { + "name": "gnmi-server", + "path": "$(configq .images[1].path)", + "tag": "$(configq .images[1].tag)" + }, + { + "name": "traffic-engine", + "path": "$(configq .images[2].path)", + "tag": "$(configq .images[2].tag)" + }, + { + "name": "protocol-engine", + "path": "$(configq .images[3].path)", + "tag": "$(configq .images[3].tag)" + } + ] + } + diff --git a/do.sh b/do.sh index 3c5b031..d516297 100755 --- a/do.sh +++ b/do.sh @@ -33,12 +33,49 @@ OPENCONFIG_MODELS_COMMIT=5ca6a36 TIMEOUT_SECONDS=300 APT_GET_UPDATE=true - -IXIA_C_CONFIG_MAP="deployments/ixia-c-config.yaml" -if [ "${LICENSING}" = "true" ] -then - IXIA_C_CONFIG_MAP="deployments/ixia-c-licensed-config.yaml" -fi +IXIA_C_CONFIG_MAP_TEMP="deployments/template-ixia-c-config.yaml" +IXIA_C_CONFIG_MAP="deployments/.ixia-c-config.yaml" + +YQ_RELEASE="v4.34.1" +YQ_SOURCE="github.com/mikefarah/yq/v4@${YQ_RELEASE}" +get_yq() { + echo "Getting yq ..." + echo "Installing yq ${YQ_SOURCE} ..." + go install "${YQ_SOURCE}" + echo "Successfully installed yq !" +} + +configq() { + # echo is needed to further evaluate the + # contents extracted from configuration + eval echo $(yq "${@}" versions.yaml) +} + +eval_config_map() { + get_yq \ + && rm -rf ${IXIA_C_CONFIG_MAP} + + # avoid splitting based on whitespace + IFS='' + # mix of cat and echo is used to ensure the input file has + # at least one newline before EOF, otherwise read will not + # provide last line + { cat ${IXIA_C_CONFIG_MAP_TEMP}; echo; } | while read line; do + # replace all double-quotes with single quotes + line=$(echo "${line}" | sed s#\"#\'#g) + # and revert them back to double-quotes post eval; + # this will result in converting all single-quotes + # to double-quotes regardless of whether they were + # originally double-quotes, but hopefully this won't + # be an issue + # this workaround was put in place because eval gets + # rid of double-quotes + eval echo \"$line\" | sed s#\'#\"#g >> ${IXIA_C_CONFIG_MAP} + done + # restore default IFS + unset IFS + cat ${IXIA_C_CONFIG_MAP} +} apt_update() { if [ "${APT_UPDATE}" = "true" ] @@ -418,9 +455,10 @@ gen_config_kne() { } gen_config_k8s() { + pwd ADDR=$(kubectl get service -n ixia-c service-otg-controller -o jsonpath='{.status.loadBalancer.ingress[0].ip}') - ETH1=$(grep "location:" deployments/k8s/manifests/${1}.yaml -m 2 | head -n1 | cut -d\: -f2 | cut -d\ -f2) - ETH2=$(grep "location:" deployments/k8s/manifests/${1}.yaml -m 2 | tail -n1 | cut -d\: -f2 | cut -d\ -f2) + ETH1=$(grep "location:" deployments/k8s/manifests/.${1}.yaml -m 2 | head -n1 | cut -d\: -f2 | cut -d\ -f2) + ETH2=$(grep "location:" deployments/k8s/manifests/.${1}.yaml -m 2 | tail -n1 | cut -d\: -f2 | cut -d\ -f2) yml="otg_host: https://${ADDR}:8443 otg_ports: - ${ETH1} @@ -625,13 +663,7 @@ create_ixia_c_b2b_cpdp() { --accept-eula \ --trace \ --disable-app-usage-reporter \ - --license-servers localhost \ - && docker run -d \ - --net=container:keng-controller \ - --name=keng-license-server \ - $(keng_license_server_img) \ - --accept-eula \ - --debug + --license-servers localhost else docker run -d \ --name=keng-controller \ @@ -682,11 +714,6 @@ rm_ixia_c_b2b_cpdp() { echo "Tearing down back-to-back with CP/DP distribution of ixia-c ..." docker stop keng-controller && docker rm keng-controller - if [ "${LICENSING}" = "true" ] - then - docker stop keng-license-server && docker rm keng-license-server - fi - docker stop ixia-c-traffic-engine-${VETH_A} docker stop ixia-c-protocol-engine-${VETH_A} docker rm ixia-c-traffic-engine-${VETH_A} @@ -713,13 +740,7 @@ create_ixia_c_b2b_lag() { --accept-eula \ --trace \ --disable-app-usage-reporter \ - --license-servers localhost \ - && docker run -d \ - --net=container:keng-controller \ - --name=keng-license-server \ - $(keng_license_server_img) \ - --accept-eula \ - --debug + --license-servers localhost else docker run -d \ --name=keng-controller \ @@ -997,10 +1018,6 @@ load_ixia_c_images() { echo "Loading ixia-c images in cluster ..." login_ghcr names="controller gnmi-server traffic-engine protocol-engine" - if [ "${LICENSING}" = "true" ] - then - names="$names license-server" - fi for name in $names do p=$(ixia_c_image_path ${name}) @@ -1066,6 +1083,8 @@ new_k8s_cluster() { common_install \ && setup_kind_cluster \ && setup_k8s_plugins ${1} ${2} \ + && eval_config_map \ + && eval_yaml deployments/k8s/manifests/${1}.yaml \ && load_ixia_c_images } @@ -1093,7 +1112,8 @@ create_ixia_c_kne() { echo "Creating KNE ${1} ${2} topology ..." ns=$(kne_namespace ${1} ${2}) topo=$(kne_topo_file ${1} ${2}) - kubectl apply -f $IXIA_C_CONFIG_MAP \ + eval_config_map \ + && kubectl apply -f $IXIA_C_CONFIG_MAP \ && kne create ${topo} \ && wait_for_pods ${ns} \ && kubectl get pods -A \ @@ -1114,10 +1134,38 @@ k8s_namespace() { grep namespace deployments/k8s/manifests/${1}.yaml -m 1 | cut -d \: -f2 | cut -d \ -f 2 } +eval_yaml() { + get_yq + new_yaml=$(dirname ${1})/.$(basename ${1}) + rm -rf ${new_yaml} + + # avoid splitting based on whitespace + IFS='' + # mix of cat and echo is used to ensure the input file has + # at least one newline before EOF, otherwise read will not + # provide last line + { cat ${1}; echo; } | while read line; do + # replace all double-quotes with single quotes + line=$(echo "${line}" | sed s#\"#\'#g) + # and revert them back to double-quotes post eval; + # this will result in converting all single-quotes + # to double-quotes regardless of whether they were + # originally double-quotes, but hopefully this won't + # be an issue + # this workaround was put in place because eval gets + # rid of double-quotes + eval echo \"$line\" | sed s#\'#\"#g >> ${new_yaml} + done + # restore default IFS + unset IFS + echo ${new_yaml} +} + create_ixia_c_k8s() { echo "Creating K8S ${1} topology ..." ns=$(k8s_namespace ${1}) - kubectl apply -f deployments/k8s/manifests/${1}.yaml \ + eval_yaml deployments/k8s/manifests/${1}.yaml \ + && kubectl apply -f deployments/k8s/manifests/.${1}.yaml \ && wait_for_pods ${ns} \ && kubectl get pods -A \ && kubectl get services -A \ @@ -1126,9 +1174,9 @@ create_ixia_c_k8s() { } rm_ixia_c_k8s() { - echo "Removing K8S ${1} topology ..." - ns=$(k8s_namespace ${1}) - kubectl delete -f deployments/k8s/manifests/${1}.yaml \ + echo "Removing K8S .${1}.yaml topology ..." + ns=$(k8s_namespace deployments/k8s/manifests/.${1}.yaml) + kubectl delete -f deployments/k8s/manifests/.${1}.yaml \ && wait_for_no_namespace ${ns} } diff --git a/helpers/dut/gnmi.go b/helpers/dut/gnmi.go index 9cfead1..6e2f90a 100644 --- a/helpers/dut/gnmi.go +++ b/helpers/dut/gnmi.go @@ -42,7 +42,7 @@ func NewGnmiClient(d *DutApi) (*GnmiClient, error) { location := fmt.Sprintf("%s:%d", d.dutConfig.Host, d.dutConfig.GnmiPort) d.t.Logf("Creating gNMI client for server %s ...\n", location) - grpcConn, err := grpc.Dial( + grpcConn, err := grpc.NewClient( location, grpc.WithTransportCredentials(credentials.NewTLS(&tls.Config{InsecureSkipVerify: true})), grpc.WithPerRPCCredentials(&grpcPassCred{ @@ -50,6 +50,7 @@ func NewGnmiClient(d *DutApi) (*GnmiClient, error) { password: d.dutConfig.GnmiPassword, }), ) + if err != nil { return nil, fmt.Errorf("failed to dial gRPC for location %s: %v", location, err) } diff --git a/requirements.txt b/requirements.txt index 6f256b4..b542347 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,7 @@ -pytest black; python_version > '3.6' flake8 pypcapfile==0.12.0 snappi==1.6.2 +pytest == 6.2.5 +pytest-html +pytest-metadata == 1.11.0 diff --git a/versions.yaml b/versions.yaml index 2be1e2a..875312e 100644 --- a/versions.yaml +++ b/versions.yaml @@ -3,12 +3,12 @@ images: - name: controller path: ghcr.io/open-traffic-generator/keng-controller tag: 1.6.2-1 + - name: gnmi-server + path: ghcr.io/open-traffic-generator/otg-gnmi-server + tag: 1.14.4 - name: traffic-engine path: ghcr.io/open-traffic-generator/ixia-c-traffic-engine tag: 1.8.0.12 - name: protocol-engine path: ghcr.io/open-traffic-generator/ixia-c-protocol-engine tag: 1.00.0.390 - - name: license-server - path: ghcr.io/open-traffic-generator/licensed/keng-license-server - tag: latest