Make topo-generation more flexible 22/14222/1
authorMartin Skorupski <martin.skorupski@highstreet-technologies.com>
Fri, 7 Mar 2025 15:32:47 +0000 (16:32 +0100)
committerMartin Skorupski <martin.skorupski@highstreet-technologies.com>
Fri, 7 Mar 2025 15:32:53 +0000 (16:32 +0100)
- improve readme
- adopt test case

IssueID: OAM-440
Change-Id: I8d3c2fa2cfabd850f57002f4fc64a14287fe6a53
Signed-off-by: Martin Skorupski <martin.skorupski@highstreet-technologies.com>
code/container-analysis/README.md
code/network-generator/README.md
code/network-generator/tests/test_o_ran_termination_point.py

index 8675c53..c14f491 100644 (file)
@@ -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
index e61d347..83ba777 100644 (file)
@@ -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
 
 ```
index 7a08b4e..1d54210 100644 (file)
@@ -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(
         {