Skip to content

Commit

Permalink
Improves route control script (#710)
Browse files Browse the repository at this point in the history
* Initial modifications

* General improvements of route_control.py script
Breaks it into classes
Adds type hints and docstrings
Adds error handling
Adds logging

* Removes comments

* Adds initial unit tests

* Adding more tests

* Fixes styling and adds new tests
Adds new test cases
Fixes lint and static issues

* Adds github workflow file

* Addresses review comments
Renames constants
Small changes in the design
Extracts arg parsing

* Adds new test cases

* Addresses review comments
Moves and renames constatns

* Updates unit tests to follow latest changes

* Improves logging

* Addresses review comments
Makes some variables private
Fixes typo in py-workflow.yml

* Adds licensing

* Minor fixes
Fixes test location in workflow file
Fixes licensing

* Uses correct path to import and patch route_control

* Addresses review comments
Fixes mac_to_hex function
Removes unnecessary int conversion

* Addresses review comments, fixes tests
Removes patches of private functions
Uses MAX_GATES-1 as gate index for default routes

* Fixes gate_idx computation when adding a new neighbor

---------

Co-authored-by: gab-arrobo <gabriel.arrobo@intel.com>
  • Loading branch information
saltiyazan and gab-arrobo committed Oct 19, 2023
1 parent 4594093 commit 7018518
Show file tree
Hide file tree
Showing 5 changed files with 1,314 additions and 468 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/py-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright 2023 Canonical Ltd.

name: Python Lint and Test

on: [push, pull_request]

jobs:
route-control-tests:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.11'

- name: Create virtual environment
run: python -m venv venv

- name: Install dependencies
run: |
source ./venv/bin/activate
pip install -r ./conf/test-requirements.txt
- name: Run tests
run: |
source ./venv/bin/activate
python -m unittest ./conf/test_route_control.py
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright 2019 Intel Corporation
# Copyright 2023 Canonical Ltd.

.idea/
.coverage/
*.pyc
Expand All @@ -8,3 +10,4 @@ output
dpdk-devbind.py
dpdk-hugepages.py
dictionary.dic
venv/

0 comments on commit 7018518

Please sign in to comment.