58 lines
1.8 KiB
Python
58 lines
1.8 KiB
Python
"""Exercise the three named control groups using qualified release copies."""
|
|
import os
|
|
from pathlib import Path
|
|
import subprocess
|
|
import tempfile
|
|
|
|
import menus
|
|
import social
|
|
import store
|
|
import test_menus
|
|
import test_social
|
|
import test_store
|
|
from stage import PROJECT, file_ids
|
|
|
|
|
|
def paths():
|
|
return ({menus.ADDONS + suffix for suffix in menus.PARENTS}
|
|
| set(social.PINS) | set(store.PINS) | {test_store.EXPORT})
|
|
|
|
|
|
def verify(original, candidate):
|
|
test_menus.verify(original, candidate)
|
|
test_social.verify(original, candidate)
|
|
test_store.verify(original, candidate)
|
|
|
|
|
|
def run(directory):
|
|
original = {name:(directory / name).read_bytes() for name in paths()}
|
|
candidate = {**original, **store.transform(original), **menus.transform(original),
|
|
**social.transform(original)}
|
|
verify(original, candidate)
|
|
|
|
|
|
def main():
|
|
supplied = os.environ.get('GW_TEST_WEB_CONTROLS_UI')
|
|
if supplied:
|
|
run(Path(supplied))
|
|
return
|
|
tool = PROJECT / 'tools/casc-tool/build/casc-tool'
|
|
storage = PROJECT / 'release-20261127/OctoWoW'
|
|
listfile = PROJECT / 'listfiles/community-listfile.csv'
|
|
if not (tool.is_file() and (storage / '.build.info').is_file() and listfile.is_file()):
|
|
print('Named release storage, casc-tool or interface listfile unavailable')
|
|
raise SystemExit(77)
|
|
with tempfile.TemporaryDirectory(prefix='web-control-ui-') as tmp:
|
|
work = Path(tmp)
|
|
source = work / 'decoded'
|
|
ids = file_ids(listfile, paths())
|
|
id_path = work / 'ids.txt'
|
|
id_path.write_text(''.join(f'{fid}\n' for fid in sorted(ids)))
|
|
subprocess.run([tool,'extract-batch','--strict-encrypted','--from-list',id_path,source,
|
|
'--storage',storage,'--locale','enus','--listfile',listfile],check=True)
|
|
run(source)
|
|
|
|
|
|
if __name__ == '__main__':
|
|
main()
|