Write regression scripts which should work in two modes:
- Baseline generation mode (with
--baseline flag)
- Regression testing mode (without
--baseline flag)
In baseline generation mode, it should process all SMBIOS dumps in data directory and generate exported data in YAML format. If these files already exist, they should be overwritten. Upon completion, a new or updated file data/<vendor>/<model>.yml should exist for each data/<vendor>/<model>.bin source file. Basic implementation of dump scanning and exporting can be largely adapted from tools/reindex-data.py, except for OpenDMI binary flags (reindex-data reads data from stdout, but in regression script and file output path should be specified).
In regression testing mode, it should read SMBIOS dump into memory exactly as reindex-data does, then read related YAML files from baseline, compare them (by traversing loaded data objects) and print differences from baseline to stdout. Notable differences are:
- An entity in a dump, which doesn't exist in baseline or an entity in the baseline, which doesn't exist in a dump
- Different entity type identifiers or codes in baseline/dump (e.g. dump reports type-code "ami-221" when baseline reports the same entity as "unknown" or "oem-defined")
- Different attribute sets for the same entity
- Different attribute values for the same entity
Please note that you should disable auto-parsing of dates in yaml.SafeLoader as it was done in reindex-data. This is necessary as SMBIOS dump frequently contains invalid dates like '1986-00-35'.
Use tools/regress.py as a skeleton, extend it in any necessary way.
Write regression scripts which should work in two modes:
--baselineflag)--baselineflag)In baseline generation mode, it should process all SMBIOS dumps in data directory and generate exported data in YAML format. If these files already exist, they should be overwritten. Upon completion, a new or updated file
data/<vendor>/<model>.ymlshould exist for eachdata/<vendor>/<model>.binsource file. Basic implementation of dump scanning and exporting can be largely adapted fromtools/reindex-data.py, except for OpenDMI binary flags (reindex-datareads data from stdout, but in regression script and file output path should be specified).In regression testing mode, it should read SMBIOS dump into memory exactly as
reindex-datadoes, then read related YAML files from baseline, compare them (by traversing loaded data objects) and print differences from baseline to stdout. Notable differences are:Please note that you should disable auto-parsing of dates in yaml.SafeLoader as it was done in
reindex-data. This is necessary as SMBIOS dump frequently contains invalid dates like '1986-00-35'.Use
tools/regress.pyas a skeleton, extend it in any necessary way.