Skip to content

Commit

Permalink
Search for commands to run in framework folder
Browse files Browse the repository at this point in the history
With this patch it's possible tot execute tests which are inside the
framework path by using the --run-command option.
  • Loading branch information
acerv committed Nov 1, 2023
1 parent d79f5a9 commit 445f7c3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 5 additions & 1 deletion libkirk/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,13 @@ async def _exec_command(self, command: str) -> None:
try:
await libkirk.events.fire("run_cmd_start", command)

test = await self._framework.find_command(self._sut, command)

ret = await asyncio.wait_for(
self._sut.run_command(
command,
test.full_command,
cwd=test.cwd,
env=test.env,
iobuffer=RedirectSUTStdout(self._sut, True)),
timeout=self._exec_timeout
)
Expand Down
3 changes: 3 additions & 0 deletions libkirk/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ def config_help(self) -> dict:
async def get_suites(self, sut: SUT) -> list:
return ["suite01", "suite02", "sleep", "environ", "kernel_panic"]

async def find_command(self, sut: SUT, command: str) -> Test:
return Test(command, command)

async def find_suite(self, sut: SUT, name: str) -> Suite:
if name in "suite01":
test0 = Test(
Expand Down

0 comments on commit 445f7c3

Please sign in to comment.