@@ -2533,6 +2533,26 @@ def execute(
25332533 ) -> Optional [tmt .utils .CommandOutput ]:
25342534 pass
25352535
2536+ @overload
2537+ def execute (
2538+ self ,
2539+ command : Union [tmt .utils .Command , tmt .utils .ShellScript ],
2540+ cwd : Optional [Path ] = None ,
2541+ environment : Optional [Environment ] = None ,
2542+ friendly_command : Optional [str ] = None ,
2543+ test_session : bool = False ,
2544+ immediately : bool = True ,
2545+ tty : bool = False ,
2546+ silent : bool = False ,
2547+ log : Optional [tmt .log .VerboseLoggingFunction ] = None ,
2548+ interactive : bool = False ,
2549+ on_process_start : Optional [OnProcessStartCallback ] = None ,
2550+ on_process_end : Optional [OnProcessEndCallback ] = None ,
2551+ sourced_files : Optional [list [Path ]] = None ,
2552+ ** kwargs : Any ,
2553+ ) -> Optional [tmt .utils .CommandOutput ]:
2554+ pass
2555+
25362556 @abc .abstractmethod
25372557 def execute (
25382558 self ,
@@ -2550,19 +2570,24 @@ def execute(
25502570 on_process_end : Optional [OnProcessEndCallback ] = None ,
25512571 sourced_files : Optional [list [Path ]] = None ,
25522572 ** kwargs : Any ,
2553- ) -> tmt .utils .CommandOutput :
2573+ ) -> Optional [ tmt .utils .CommandOutput ] :
25542574 """
25552575 Execute a command on the guest.
25562576
25572577 :param command: either a command or a shell script to execute.
2558- :param cwd: if set, execute command in this directory on the guest.
2578+ :param cwd: execute command in this directory on the guest.
25592579 :param environment: if set, set these environment variables before running the command.
25602580 :param friendly_command: nice, human-friendly representation of the command.
2581+ :param test_session: if True, this is the actual test being run.
25612582 :param immediately: if False, the command may be collected for later
25622583 batch execution on guests that support it (e.g., bootc guests).
25632584 Commands with ``immediately=True`` (default) are always executed
25642585 right away. Use ``immediately=False`` for commands that modify
25652586 system state and can be batched (e.g., package installation).
2587+ When a command is deferred, ``None`` is returned instead of
2588+ :py:class:`CommandOutput`.
2589+ :returns: command output, or ``None`` if the command was deferred
2590+ for batch execution (when ``immediately=False`` on supported guests).
25662591 """
25672592
25682593 raise NotImplementedError
@@ -3768,6 +3793,26 @@ def execute(
37683793 ) -> Optional [tmt .utils .CommandOutput ]:
37693794 pass
37703795
3796+ @overload
3797+ def execute (
3798+ self ,
3799+ command : Union [tmt .utils .Command , tmt .utils .ShellScript ],
3800+ cwd : Optional [Path ] = None ,
3801+ environment : Optional [Environment ] = None ,
3802+ friendly_command : Optional [str ] = None ,
3803+ test_session : bool = False ,
3804+ immediately : bool = True ,
3805+ tty : bool = False ,
3806+ silent : bool = False ,
3807+ log : Optional [tmt .log .VerboseLoggingFunction ] = None ,
3808+ interactive : bool = False ,
3809+ on_process_start : Optional [OnProcessStartCallback ] = None ,
3810+ on_process_end : Optional [OnProcessEndCallback ] = None ,
3811+ sourced_files : Optional [list [Path ]] = None ,
3812+ ** kwargs : Any ,
3813+ ) -> Optional [tmt .utils .CommandOutput ]:
3814+ pass
3815+
37713816 def execute (
37723817 self ,
37733818 command : Union [tmt .utils .Command , tmt .utils .ShellScript ],
0 commit comments