From 17e28584bd48cfac7bd44d8059b6f158c168f451 Mon Sep 17 00:00:00 2001 From: Martin Skorupski Date: Fri, 7 Mar 2025 16:32:47 +0100 Subject: [PATCH] Make topo-generation more flexible - improve readme - adopt test case IssueID: OAM-440 Change-Id: I8d3c2fa2cfabd850f57002f4fc64a14287fe6a53 Signed-off-by: Martin Skorupski --- code/container-analysis/README.md | 6 ++--- code/network-generator/README.md | 26 ++++++++++++++++++++++ .../tests/test_o_ran_termination_point.py | 2 +- 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/code/container-analysis/README.md b/code/container-analysis/README.md index 8675c53..c14f491 100644 --- a/code/container-analysis/README.md +++ b/code/container-analysis/README.md @@ -9,13 +9,13 @@ The script depend on the [Syft](https://github.com/anchore/syft) project and the ### Installing syft ``` -curl -sSfL https://raw.githubusercontent.com/anchore/syft/main/install.sh | sh -s -- -b /usr/local/bin +curl -sSfL https://raw.githubusercontent.com/anchore/syft/main/install.sh | sudo sh -s -- -b /usr/local/bin ``` ### Installing grype -``` -curl -sSfL https://raw.githubusercontent.com/anchore/grype/main/install.sh | sh -s -- -b /usr/local/bin +```cd +curl -sSfL https://raw.githubusercontent.com/anchore/grype/main/install.sh | sudo sh -s -- -b /usr/local/bin ``` ## Usage diff --git a/code/network-generator/README.md b/code/network-generator/README.md index e61d347..83ba777 100644 --- a/code/network-generator/README.md +++ b/code/network-generator/README.md @@ -25,11 +25,23 @@ Python 3.10.12 For validation purposes libyang is recommended. Please follow the libyang [installation instructions](https://github.com/CESNET/libyang). +## Installation + +``` +make virtual_env_4_oam +source .oam/bin/activate + +pip install -r requirements.txt +pip install -r requirements-test.txt +``` + + ## Usage ``` make virtual_env_4_oam source .oam/bin/activate + python3 -m network_generation config.json ``` @@ -41,6 +53,20 @@ By default the generated files can be found in the 'output' folder: - [o-ran-network.svg](output/o-ran-network.svg) - [o-ran-network.kml](output/o-ran-network.kml) +## yang validation + +``` +pyang --lint \ +-p network_generation/model/yang \ +network_generation/model/yang/o-ran-sc-*.yang +``` + +``` +yanglint \ +-p network_generation/model/yang \ +network_generation/model/yang/o-ran-sc-*.yang +``` + ## Output validation ``` diff --git a/code/network-generator/tests/test_o_ran_termination_point.py b/code/network-generator/tests/test_o_ran_termination_point.py index 7a08b4e..1d54210 100644 --- a/code/network-generator/tests/test_o_ran_termination_point.py +++ b/code/network-generator/tests/test_o_ran_termination_point.py @@ -29,7 +29,7 @@ def test_o_ran_termination_point() -> None: assert o_ran_termination_point.name == "my-name" assert o_ran_termination_point.administrativeState.value == "locked" assert o_ran_termination_point.supporter == "my-supporter" - assert len(str(o_ran_termination_point)) == 357 + assert len(str(o_ran_termination_point)) == 328 o_ran_termination_point = ORanTerminationPoint( { -- 2.16.6