Skip to content

Instantly share code, notes, and snippets.

@NickZ
Last active March 1, 2020 04:20
Show Gist options
  • Save NickZ/58e87d6beaf6473a61da6856802154da to your computer and use it in GitHub Desktop.
Save NickZ/58e87d6beaf6473a61da6856802154da to your computer and use it in GitHub Desktop.
import subprocess
import time
import sys
#takes an argument with the vmname. Use a guest using the 18.04 image, not the 16.04 image.
#like `python trigger_1170.py intrigued-stag`
#otherwise uses primary
vmname = "primary"
if len(sys.argv) < 2:
print("Using primary")
else:
vmname = sys.argv[1]
# This command does not trigger the bug
#command = ['multipass', 'exec', str(vmname), '--', 'echo', 'hello']
# This does!
command = ['multipass', 'exec', str(vmname), '--', 'sudo', '-i', 'env', 'printenv', 'HOME']
# This may take a few iterations, but the bug will eventually be triggered
while True:
print("testing output...")
print(str(subprocess.check_output(command)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment