AspeedTech-BMC / socsec

MIT License
9 stars 11 forks source link

Regression test coverage of `otptool` and `socsec` #2

Closed amboar closed 3 years ago

amboar commented 3 years ago

Hello,

The PR adds a high-level regression test suite by capturing a set of reference outputs from the otptool and socsec scripts.

There's no attempt to validate the reference binaries against the intent of the input configurations, rather the reference binaries exist to identify changes in behaviour as the scripts evolve over time. This allows us to more freely make changes to the code, because we know if we cause an unintended change in behaviour it should be caught by the regression tests.

In developing the tests I encountered the issue described in #1. This pull-request includes the fix suggested in the issue.

I've also patched socsec to act in a deterministic way so we get binary outputs that are bit-for-bit equivalent to the reference binaries. This mainly involved fixing the source of IV data.

Please review!

Andrew

johnydhuang commented 3 years ago

It looks nice, I merge it into the develop branch.