Exemplo n.º 1
0
def clear_etos_lib_configurations():
    """Make sure that etos library configuration is cleared after each test."""
    config = Config()
    debug = Debug()
    yield
    config.reset()
    debug.events_received.clear()
    debug.events_published.clear()
Exemplo n.º 2
0
 def setUp(self):
     """Create a script file."""
     script = ["#!/bin/bash", "echo Hello $1 > $(pwd)/output"]
     with open(self.script, "w", encoding="utf-8") as scriptfile:
         for line in script:
             scriptfile.write(f"{line}\n")
     self.config = Config()
     self.files = [self.script, Path.cwd().joinpath("output")]
Exemplo n.º 3
0
    def __init__(self, iut):
        """Initialize monitoring.

        :param iut: IUT object to monitor.
        :type iut: :obj:`etr.lib.iut.Iut`
        """
        self.iut = iut
        self.config = Config()
Exemplo n.º 4
0
    def __init__(self, product):
        """Initialize.

        :param product: Dictionary to set attributes from.
                        Should be the response from pool plugin list.
        :type product: dict
        """
        self.test_runner = {}
        self.config = Config()
        self.config.set("scripts", [])
        self.steps = {
            "environment": self.load_environment,
            "commands": self.commands
        }

        product["identity"] = PackageURL.from_string(product["identity"])
        for key, value in product.items():
            setattr(self, key, value)
        self._product_dict = product
        self.jsontas = JsonTas()
        self.jsontas.dataset.add("iut", self._product_dict)
        self.prepare()
Exemplo n.º 5
0
 def setUp(self):
     os.environ["ETOS_CONFIGMAP"] = self.etos_configmap
     os.environ["SUITE_RUNNER"] = self.suite_runner
     Config().reset()