aboutsummaryrefslogtreecommitdiffstats
path: root/src/onaptests/steps/simulator/pnf/pnf_instantiate.py
blob: 31ea6bf60f03d1a0fa65127ced6a1e2917b95e25 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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()