Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add novus 10g ci #566

Open
wants to merge 52 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
60e8713
Worked on following issues:
desaimg1 May 29, 2023
15b5740
Comment from vibaswan addressed
desaimg1 Jun 26, 2023
a48c3e4
Added backward compatabilty code back
desaimg1 Jun 26, 2023
46cf92a
updated snappi-ixnetwork version
desaimg1 Jun 26, 2023
7fa925e
updated runner details
ashutshkumr Jul 25, 2023
6602e43
updated runner details
ashutshkumr Jul 25, 2023
ef483b9
removed support for python2
ashutshkumr Jul 25, 2023
4200ce6
update python binary path
ashutshkumr Jul 25, 2023
4bf13af
updated python to point to virtualenv
ashutshkumr Jul 25, 2023
d7f728b
removed bad chars
ashutshkumr Jul 25, 2023
e075606
trying to correct tests
vhowdhur Jul 25, 2023
19f3538
modify test
vhowdhur Jul 25, 2023
04a3233
exposing username and password
vhowdhur Jul 25, 2023
0fa37a5
bug fix
vhowdhur Jul 25, 2023
3c7881e
bug fix
vhowdhur Jul 25, 2023
0819f54
bug fix
vhowdhur Jul 25, 2023
3186ea5
bug fix
vhowdhur Jul 25, 2023
25c639e
bug fix
vhowdhur Jul 25, 2023
ce17e1e
bug fix
vhowdhur Jul 25, 2023
e95b5c8
trying by disabling shell
vhowdhur Jul 25, 2023
0f1dd17
trying by disabling shell
vhowdhur Jul 25, 2023
22e81bd
change back to original
vhowdhur Jul 25, 2023
3162c8a
bug fix
vhowdhur Jul 25, 2023
4821866
bug fix
vhowdhur Jul 25, 2023
4291e47
bug fix
vhowdhur Jul 25, 2023
f8e08a6
enabling whole test
vhowdhur Jul 25, 2023
dc46671
linting python code and handling snappi_convergence
vhowdhur Jul 25, 2023
75b1048
rectifying snappi convergence
vhowdhur Jul 25, 2023
7dc2b3a
trying to make the password generic
vhowdhur Jul 26, 2023
07fd53c
bug fix
vhowdhur Jul 26, 2023
b99a31a
bug fix
vhowdhur Jul 26, 2023
d36fbbb
add support for new runner with novus10g
vhowdhur Jul 26, 2023
764a7bb
bug fix
vhowdhur Jul 26, 2023
14197b5
Adding backward compatibility for ping test
desaimg1 Jul 27, 2023
62e8e0f
Merge branch 'correct_tests' into add_novus_10g_CI
vhowdhur Jul 27, 2023
cf33cc9
modified failed cases
desaimg1 Jul 28, 2023
204996c
Merge branch 'correct_tests' into add_novus_10g_CI
vhowdhur Jul 28, 2023
d9a8156
updating latest model code
desaimg1 Jul 28, 2023
b72186a
committing imix e2e tc files
desaimg1 Aug 1, 2023
9058f23
Merge branch 'correct_tests' into add_novus_10g_CI
vhowdhur Aug 1, 2023
f988436
Update publish.yml
Vibaswan Aug 5, 2024
6531d63
Run only 10g
indraniBh Aug 7, 2024
2ce1745
Run only 10g
indraniBh Aug 7, 2024
764a704
Run only 10g
indraniBh Aug 7, 2024
869e493
revert changes
indraniBh Aug 7, 2024
e712e36
Run only 10g
indraniBh Aug 7, 2024
b8ca8ce
Allow unsecure version
indraniBh Aug 7, 2024
ce9be9c
indentation fix
indraniBh Aug 7, 2024
be1e54b
dummy change
indraniBh Aug 14, 2024
2aa1aeb
Test fix
indraniBh Aug 14, 2024
3cccef9
Fixed workflow for publish artifacts
indraniBh Aug 14, 2024
7341d3e
Update Test
indraniBh Aug 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 75 additions & 22 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,45 @@ name: cicd

on:
push:
branches: [main]
# branches: [main]
pull_request:

env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true

jobs:
cicd:
runs-on: [self-hosted, Linux, Ubuntu, x64]
strategy:
max-parallel: 1
matrix:
python-version: [python27, python38]
# test_novus_100g:
# runs-on: [snappi-ixn-ci-novus100g]
# steps:
# - name: Checkout source
# uses: actions/checkout@v2
# with:
# ref: ${{ env.BASE_BRANCH }}
# # ref: ${{ github.head_ref }}
# submodules: recursive
# - name: Set python path
# id: path
# run: echo "::set-output name=pythonv::/home/github-runner/pyenv/.env/bin/python"
# - name: Install dependencies
# run: |
# rm -rf .env
# ${{steps.path.outputs.pythonv}} do.py setup
# ${{steps.path.outputs.pythonv}} do.py init
# - name: Build distribution
# run: |
# ${{steps.path.outputs.pythonv}} do.py dist
# - name: Install package on clean env
# run: |
# rm -rf .env
# ${{steps.path.outputs.pythonv}} do.py setup
# ${{steps.path.outputs.pythonv}} do.py install
# ${{steps.path.outputs.pythonv}} do.py init
# - name: Run tests
# run: |
# TEST_USERNAME=${{secrets.TEST_USERNAME}} TEST_PASSWORD='${{secrets.TEST_PASSWORD}}' ${{steps.path.outputs.pythonv}} do.py test

test_novus_10g:
runs-on: [snappi-ixn-ci-novus10g]
steps:
- name: Checkout source
uses: actions/checkout@v2
Expand All @@ -22,7 +50,7 @@ jobs:
submodules: recursive
- name: Set python path
id: path
run: echo "::set-output name=pythonv::/home/otg/${{matrix.python-version}}/bin/python"
run: echo "::set-output name=pythonv::/home/github-runner/pyenv/.env/bin/python"
- name: Install dependencies
run: |
rm -rf .env
Expand All @@ -39,7 +67,31 @@ jobs:
${{steps.path.outputs.pythonv}} do.py init
- name: Run tests
run: |
${{steps.path.outputs.pythonv}} do.py test
TEST_USERNAME=${{secrets.TEST_USERNAME}} ${{steps.path.outputs.pythonv}} do.py test novus10g

publish_artifacts:
# runs-on: [snappi-ixn-ci-novus100g]
runs-on: [snappi-ixn-ci-novus10g]
needs: [test_novus_10g]
# needs: [test_novus_100g, test_novus_10g]
steps:
- name: Checkout source
uses: actions/checkout@v2
with:
ref: ${{ env.BASE_BRANCH }}
# ref: ${{ github.head_ref }}
submodules: recursive
- name: Set python path
id: path
run: echo "::set-output name=pythonv::/home/github-runner/pyenv/.env/bin/python"
- name: Install dependencies
run: |
rm -rf .env
${{steps.path.outputs.pythonv}} do.py setup
${{steps.path.outputs.pythonv}} do.py init
- name: Build distribution
run: |
${{steps.path.outputs.pythonv}} do.py dist
- name: Get package version
id: get_version
run: |
Expand Down Expand Up @@ -74,16 +126,17 @@ jobs:
run: |
${{steps.path.outputs.pythonv}} do.py install_requests ${{steps.path.outputs.pythonv}}
${{steps.path.outputs.pythonv}} do.py check_release_flag ${{ steps.release.outputs.release_flag }} ${{ steps.get_version.outputs.version }}
cicd_snappitest:
runs-on: [self-hosted, Linux, Ubuntu, x64]
needs: cicd
steps:
- name: Trigger CI/CD snappi-tests
run: |
git clone https://github.com/open-traffic-generator/snappi-tests.git
mv version.txt snappi-tests
cd snappi-tests
git add version.txt
git commit --allow-empty -m "Trigger Snappi test from snappi-ixnetwork"
git remote set-url origin https://${{secrets.CI_TOKEN}}@github.com/open-traffic-generator/snappi-tests.git
git push origin main

# cicd_snappitest:
# runs-on: [snappi-ixn-ci-novus100g]
# needs: test_novus_100g
# steps:
# - name: Trigger CI/CD snappi-tests
# run: |
# git clone https://github.com/open-traffic-generator/snappi-tests.git
# mv version.txt snappi-tests
# cd snappi-tests
# git add version.txt
# git commit --allow-empty -m "Trigger Snappi test from snappi-ixnetwork"
# git remote set-url origin https://${{secrets.CI_TOKEN}}@github.com/open-traffic-generator/snappi-tests.git
# git push origin main
64 changes: 39 additions & 25 deletions do.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,35 +35,47 @@ def lint():
)


def test():
def test(card="novus100g"):
coverage_threshold = 67
# args = [
# '--location="https://10.39.71.97:443"',
# (
# '--ports="10.39.65.230;6;1 10.39.65.230;6;2 10.39.65.230;6;3'
# ' 10.39.65.230;6;4"'
# ),
# '--media="fiber"',
# "tests",
# '-m "not e2e and not l1_manual"',
# '--cov=./snappi_ixnetwork --cov-report term'
# ' --cov-report html:cov_report',
# ]
args = [
'--location="https://otg-novus100g.lbj.is.keysight.com:5000"',
(
'--ports="otg-novus100g.lbj.is.keysight.com;1;1'
" otg-novus100g.lbj.is.keysight.com;1;2"
" otg-novus100g.lbj.is.keysight.com;1;5"
' otg-novus100g.lbj.is.keysight.com;1;6"'
),
username = os.environ.get("TEST_USERNAME", "admin")
psd = os.environ.get("TEST_PASSWORD", "admin")

if card == "novus100g":
args = [
'--location="https://snappi-ixn-ci-novus100g.lbj.is.keysight.com:5000"',
(
'--ports="snappi-ixn-ci-novus100g.lbj.is.keysight.com;1;1'
" snappi-ixn-ci-novus100g.lbj.is.keysight.com;1;2"
" snappi-ixn-ci-novus100g.lbj.is.keysight.com;1;5"
' snappi-ixn-ci-novus100g.lbj.is.keysight.com;1;6"'
),
"--speed=speed_100_gbps",
]
elif card == "novus10g":
args = [
'--location="https://novus1-715849.ccu.is.keysight.com:5000"',
(
'--ports="novus1-715849.ccu.is.keysight.com;1;1'
" novus1-715849.ccu.is.keysight.com;1;2"
" novus1-715849.ccu.is.keysight.com;1;5"
' novus1-715849.ccu.is.keysight.com;1;6"'
),
"--speed=speed_10_gbps",
]
else:
raise Exception("card %s is not supported for testing" % card)

args += [
"--ext=ixnetwork",
"--speed=speed_100_gbps",
"--username=" + username,
"--psd='" + psd + "'",
"tests",
'-m "not e2e and not l1_manual and not uhd"',
"--cov=./snappi_ixnetwork --cov-report term"
" --cov-report html:cov_report",
]
print(args)

run(
[
py() + " -m pip install pytest-cov",
Expand Down Expand Up @@ -244,11 +256,13 @@ def get_workflow_id():


def check_release_flag(release_flag=None, release_version=None):
if release_flag == '1':
if release_flag == "1":
with open("setup.py") as f:
out = f.read()
snappi_convergence = re.findall(r"\"snappi_convergence==(.+)\"",out)[0]
release_version = release_version.replace('v', "")
snappi_convergence = re.findall(
r"\"snappi_convergence==(.+)\"", out
)[0]
release_version = release_version.replace("v", "")
with open("version.txt", "w+") as f:
f.write("version: {}\n".format(release_version))
f.write("snappi_convergence: {}\n".format(snappi_convergence))
Expand Down
3 changes: 2 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# snappi Extension for IxNetwork

[![license](https://img.shields.io/badge/license-MIT-green.svg)](https://en.wikipedia.org/wiki/MIT_License)
[![Project Status: Active The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
[![Project Status: Active - The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
[![Build](https://github.com/open-traffic-generator/snappi-ixnetwork/workflows/Build/badge.svg)](https://github.com/open-traffic-generator/snappi-ixnetwork/actions)
[![pypi](https://img.shields.io/pypi/v/snappi_ixnetwork.svg)](https://pypi.org/project/snappi_ixnetwork)
[![python](https://img.shields.io/pypi/pyversions/snappi_ixnetwork.svg)](https://pypi.python.org/pypi/snappi_ixnetwork)
Expand Down Expand Up @@ -78,3 +78,4 @@ while True:
if all([m.frames_tx == 10000 == m.frames_rx for m in res.flow_metrics]):
break
```

4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import setuptools

pkg_name = "snappi_ixnetwork"
version = "0.9.1"
version = "0.11.5"

# read long description from readme.md
base_dir = os.path.abspath(os.path.dirname(__file__))
Expand Down Expand Up @@ -37,7 +37,7 @@
install_requires=["ixnetwork-restpy>=1.0.52"],
extras_require={
"testing": [
"snappi==0.9.1",
"snappi==0.11.5",
"snappi_convergence==0.4.1",
"pytest",
"mock",
Expand Down
6 changes: 4 additions & 2 deletions snappi_ixnetwork/capture.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ def config(self):
imports.append(capture)
for capture_item in self._api.snappi_config.captures:
if capture_item.format == "pcap":
self._api.warning("pcap format is not supported for IxNetwork, setting capture format to pcapng")
self._api.warning(
"pcap format is not supported for IxNetwork, setting capture format to pcapng"
)
capture_item.format = "pcapng"
if capture_item.port_names is None:
continue
Expand Down Expand Up @@ -348,7 +350,7 @@ def results(self, request):
self._api._request("POST", url, payload)

path = "%s/capture" % self._api._ixnetwork.Globals.PersistencePath
#Todo: Revert dc to merged capture after fix is available in 9.20
# Todo: Revert dc to merged capture after fix is available in 9.20
url = "%s/files?absolute=%s&filename=%s" % (
self._api._ixnetwork.href,
path,
Expand Down
Loading
Loading