diff --git a/avocado/utils/process.py b/avocado/utils/process.py index 16bc87e4c3c325d760c2a600216b845540ffc271..e1d733b75d965bd7109fd77274eb3a95958f7750 100644 --- a/avocado/utils/process.py +++ b/avocado/utils/process.py @@ -531,6 +531,7 @@ class SubProcess(object): else: stderr = subprocess.PIPE self._popen = subprocess.Popen(cmd, + stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=stderr, shell=self.shell, @@ -701,6 +702,16 @@ class SubProcess(object): self._fill_results(rc) return rc + def stdin_write(self, value, flush=False): + """ + Call the subprocess stdin.write() method for any input to subprocess + Optionally flush the input buffer + """ + self._init_subprocess() + self._popen.stdin.write(value) + if flush: + self._popen.stdin.flush() + def stop(self): """ Stop background subprocess.