Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion lisa/microsoft/testsuites/cvm/cvm_attestation_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,24 @@ def _clone_repo(self) -> None:

def _install(self) -> bool:
self._clone_repo()
# install.sh runs apt via its own inner `sudo`, which resets the
# environment and drops NEEDRESTART_MODE/DEBIAN_FRONTEND. On Ubuntu
# 22.04+ that makes needrestart show the interactive "Which services
# should be restarted?" dialog, hanging the install until it times out.
# Force needrestart into automatic mode by appending the setting to the
# end of its config file (last assignment wins in the perl config);
# this is read from disk and so survives the inner sudo.
needrestart_conf = "/etc/needrestart/needrestart.conf"
self.node.execute(
"sudo ./install.sh",
f"test -f {needrestart_conf} && "
f"echo '$nrconf{{restart}} = \"a\";' >> {needrestart_conf} || true",
shell=True,
Comment on lines +112 to 116
sudo=True,
)
self.node.execute(
"./install.sh",
shell=True,
sudo=True,
cwd=self.attestation_dir,
)
return self._check_exists()
Expand Down
Loading