diff options
author | Eli Halych <illia.halych@t-mobile.pl> | 2020-11-25 10:52:03 +0000 |
---|---|---|
committer | Eli Halych <illia.halych@t-mobile.pl> | 2020-12-14 15:14:25 +0000 |
commit | 95843eb0910fc9a0f05fc680160c5dec2aba1ba2 (patch) | |
tree | 645100af5ba0713b5116c4a30ec1e2d955907818 /src/onaptests/steps/simulator/pnf/pnf_instantiate.py | |
parent | a6fe8be6c1d1eb9e7293ed1c3bb63a76646fe22c (diff) |
Add PNF simulator execution and cleanup as a BaseStep
1. The simulator is the masspnfsim from integration project. Added as a git submodule.
2. The flow: build image, bootstrap simulator, run simulator, stop simulator,
remove simulator, remove image (only simulator).
3. Additionally trigger (sending a message to VES) is handled in pnf/utils.py. To send a request to VES,
vesip in settings.PNF_VES_CONFIG should be set to the one accessible from simulator container. Default one
(172.17.0.1) communicates with the machine the simulator runs at.
4. commonEventHeader's fields can be overridden in settings.py (here sourceName, reportingEntityName)
Issue-ID: TEST-278
Signed-off-by: Eli Halych <illia.halych@t-mobile.pl>
Change-Id: Id77dc8c517a30458abd81f2aadc416204be522b5
Diffstat (limited to 'src/onaptests/steps/simulator/pnf/pnf_instantiate.py')
-rw-r--r-- | src/onaptests/steps/simulator/pnf/pnf_instantiate.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/onaptests/steps/simulator/pnf/pnf_instantiate.py b/src/onaptests/steps/simulator/pnf/pnf_instantiate.py new file mode 100644 index 0000000..31ea6bf --- /dev/null +++ b/src/onaptests/steps/simulator/pnf/pnf_instantiate.py @@ -0,0 +1,30 @@ +"""Base step that runs a PNF simulator.""" +from onaptests.steps.simulator.pnf import utils +from onaptests.steps.base import BaseStep + +class PNFInstanceStep(BaseStep): + """Run PNF simulator containers.""" + + @property + def description(self) -> str: + """Step description.""" + return "Run PNF simulator containers." + + @property + def component(self) -> str: + """Component name.""" + return "Environment" + + @BaseStep.store_state + def execute(self) -> None: + """Run PNF simulator containers.""" + utils.build_image() + utils.bootstrap_simulator() + utils.run_container() + + @BaseStep.store_state + def cleanup(self) -> None: + """Remove containers and images.""" + utils.stop_container() + utils.remove_simulator() + utils.remove_image() |