14 lines
1.3 KiB
Python
14 lines
1.3 KiB
Python
import re,json,hashlib,urllib.request,zipfile
|
|
from pathlib import Path
|
|
ROOT=Path(__file__).resolve().parent;BASE=re.search(r'Now listening on: (http://127.0.0.1:\d+)',Path('/tmp/mx-ui-final-host.log').read_text()).group(1);rows=[]
|
|
for name,version,files in [('Theme','1.0.1',['css/theme.css','css/layout.css','fonts/ibm-plex-sans-400.woff2','fonts/ibm-plex-sans-600.woff2','fonts/ibm-plex-mono-500.woff2']),('Secrets.Ui','1.0.1',['js/secrets-dialog.js','js/secrets-reveal.js']),('Secrets.Abstractions','0.6.6',[])]:
|
|
id='ZB.MOM.WW.'+name;cache=Path.home()/'.nuget/packages'/id.lower()/version
|
|
with zipfile.ZipFile(cache/(id.lower()+'.'+version+'.nupkg')) as z:
|
|
dll=Path('/tmp/mx-ui-final-artifacts/bin/MxUiCanary/release')/(id+'.dll');assert dll.read_bytes()==z.read('lib/net10.0/'+id+'.dll')
|
|
rows.append({'runtimeAssembly':id,'version':version,'bytesMatchOfficialPackage':True})
|
|
for path in files:
|
|
url=BASE+'/_content/'+id+'/'+path
|
|
with urllib.request.urlopen(url) as r:data=r.read();assert r.status==200
|
|
assert data==z.read('staticwebassets/'+path);rows.append({'asset':path,'package':id,'http':200,'sha256':hashlib.sha256(data).hexdigest()})
|
|
(ROOT/'evidence/mx-final/served-assets.json').write_text(json.dumps(rows,indent=2));print('3 runtime assemblies and7 served assets equal accepted official packages')
|