fiano icon indicating copy to clipboard operation
fiano copied to clipboard

Run visitor tests on ROMs other than OVMF

Open rjoleary opened this issue 7 years ago • 3 comments

rjoleary avatar Sep 17 '18 01:09 rjoleary

At the present the integration test performs the following:

  1. Extract OVMF image to folder A
  2. Assembly A to image X
  3. Extract X to folder B
  4. Assert diff --recursive A B == 0

The OVMF image and image X cannot be compared directly because they likely use different compression schemes. The integration test solves this problem by comparing the comparing the extracted (decompressed) files and their metadata.

This works fine for the OVMF image checked into the UTK source tree, but we found for some other images (such as the Tyan image publicly available on their downloads page) have a Firmware Volume which expands in size when the image is re-compressed in step 2. This causes the FV metadata and headers to differ between A and B. The difference causes the test to fail.

rjoleary avatar Nov 02 '18 18:11 rjoleary

One possibility is to have a regression test. Essentially, the test would compare the metadata contained in the "summary.json" file to the "summary.json" file generated by the image in the previous commit. Each object in "summary.json" can contain a hash of the Buf to represent the file contents. Any new changes, intentional or unintentional, would have to be manually signed off at each commit.

rjoleary avatar Nov 02 '18 18:11 rjoleary

I like the hash idea! That's a good idea, we can hash only extracted file contents, skipping the headers.

GanShun avatar Nov 02 '18 18:11 GanShun