Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tests/conftest.py]: new API runcmd_interactive. #1424

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 13 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,19 @@ def runcmd(self, cmd: str) -> Tuple[int, str]:

return (exitcode, out)

def runcmd_interactive(self, cmd):
res = self.ctn.exec_run(cmd, socket=True, stdout=True, stdin=True, tty=True)
try:
exitcode = res.exit_code
out = res.output
except AttributeError:
exitcode = None
out = res
if exitcode is not None:
print "-----rc={} for cmd {}-----".format(exitcode, cmd)

return (exitcode, out)

# used in buildimage tests, do not delete
def copy_file(self, path: str, filename: str) -> None:
tarstr = io.BytesIO()
Expand Down