Merge pull request #73190 from flokli/ceph-tests-python
WIP: nixos/ceph: port tests to python
This commit is contained in:
@@ -290,10 +290,15 @@ class Machine:
|
||||
|
||||
def wait_for_monitor_prompt(self) -> str:
|
||||
assert self.monitor is not None
|
||||
answer = ""
|
||||
while True:
|
||||
answer = self.monitor.recv(1024).decode()
|
||||
undecoded_answer = self.monitor.recv(1024)
|
||||
if not undecoded_answer:
|
||||
break
|
||||
answer += undecoded_answer.decode()
|
||||
if answer.endswith("(qemu) "):
|
||||
return answer
|
||||
break
|
||||
return answer
|
||||
|
||||
def send_monitor_command(self, command: str) -> str:
|
||||
message = ("{}\n".format(command)).encode()
|
||||
@@ -606,12 +611,15 @@ class Machine:
|
||||
+ os.environ.get("QEMU_OPTS", "")
|
||||
)
|
||||
|
||||
environment = {
|
||||
"QEMU_OPTS": qemu_options,
|
||||
"SHARED_DIR": self.shared_dir,
|
||||
"USE_TMPDIR": "1",
|
||||
}
|
||||
environment.update(dict(os.environ))
|
||||
environment = dict(os.environ)
|
||||
environment.update(
|
||||
{
|
||||
"TMPDIR": self.state_dir,
|
||||
"SHARED_DIR": self.shared_dir,
|
||||
"USE_TMPDIR": "1",
|
||||
"QEMU_OPTS": qemu_options,
|
||||
}
|
||||
)
|
||||
|
||||
self.process = subprocess.Popen(
|
||||
self.script,
|
||||
|
||||
Reference in New Issue
Block a user