Run a subprocess with the specified command. Args: command: The command line arguments to use. Return: The output log (stdout) split into lines.
(self, command: list[str])
| 99 | assert False, 'Missing subclass implementation' |
| 100 | |
| 101 | def execute(self, command: list[str]) -> list[str]: |
| 102 | ''' |
| 103 | Run a subprocess with the specified command. |
| 104 | |
| 105 | Args: |
| 106 | command: The command line arguments to use. |
| 107 | |
| 108 | Return: |
| 109 | The output log (stdout) split into lines. |
| 110 | ''' |
| 111 | try: |
| 112 | result = sp.run(command, stdout=sp.PIPE, stderr=sp.PIPE, |
| 113 | check=True, text=True) |
| 114 | |
| 115 | except (OSError, sp.CalledProcessError): |
| 116 | print(f' + {" ".join(command)}') |
| 117 | assert False, 'ERROR: Test run failed' |
| 118 | |
| 119 | return result.stdout.splitlines() |
| 120 | |
| 121 | def parse_output(self, image: TestImage, output: list[str]) -> RunResult: |
| 122 | ''' |