Skip to content

Instantly share code, notes, and snippets.

@iainlane
Last active February 17, 2021 09:33
Show Gist options
  • Save iainlane/346718134a2f6fa2624d9373e07fe623 to your computer and use it in GitHub Desktop.
Save iainlane/346718134a2f6fa2624d9373e07fe623 to your computer and use it in GitHub Desktop.
#!/usr/bin/python3
import lzma
import urllib.request
import yaml
SERIES = "hirsute"
URL = "https://people.canonical.com/~ubuntu-archive/proposed-migration/update_excuses.yaml.xz"
with lzma.LZMAFile(urllib.request.urlopen(URL)) as resp:
y = yaml.load(resp, Loader=yaml.CSafeLoader)
for source in y["sources"]:
try:
if source["policy_info"]["age"]["current-age"] < 5:
continue
tests = source["policy_info"]["autopkgtest"]
for test in tests:
if test == "verdict":
continue
for arch in tests[test]:
if tests[test][arch][0] in (
"RUNNING",
"RUNNING-ALWAYSFAIL",
):
print(f"run-autopkgtest -s {SERIES} -a {arch} --trigger={source['item-name']}/{source['new-version']} {test.split('/')[0]}")
except KeyError:
continue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment