diff --git a/spinnaker_testbase/root_test_case.py b/spinnaker_testbase/root_test_case.py index af23567..fc48696 100644 --- a/spinnaker_testbase/root_test_case.py +++ b/spinnaker_testbase/root_test_case.py @@ -126,3 +126,28 @@ def runsafe(self, method: Callable, retry_delay: float = 3.0, print("==========================================================") print("") time.sleep(retry_delay) + + def check_binary_used(self, binary: str) -> None: + """ + Checks if the binary is used since the last call to start + + :param binary: Name of the file (no path) to check + :raises AssertionError: If the binary is not used + """ + self.check_binaries_used([binary]) + + def check_binaries_used(self, binaries: List[str]) -> None: + """ + Checks if the binaries are used since the last call to start + + :param binaries: List of names of the file (no path) to check + :raises AssertionError: If any binary is not used + """ + targets = FecDataView.get_executable_targets() + files = set() + for target in targets.binaries: + _, file = os.path.split(target) + files.add(file) + for binary in binaries: + self.assertIn(binary, files) + print(files)