Thanks Zhe Zhang.
The test code simulates older version edit by creating EditLogFileOutputStream with the prior version. However, the FSEditLogOp's writeFields implementation doesn't distinguish different versions and always write with the latest features.
For example, if this patch is applied directly on the top of the 2.6 release where CURRENT_LAYOUT_VERSION is set to -60, the test will fail because even though EditLogFileOutputStream is created with version -59, OP_ADD's writeFields will add storagePolicyId to the edit. During the edit loading, it will skip the reading of storagePolicyId given it has version -59 and thus cause checksum error.
To simulates old edit for test purpose, it seems we need to have FSEditLogOp support writing optional data depending on the version requested. So in this case, if the version is set to -59, it shouldn't write storagePolicyId. This functionality seems only useful for testing upgrade scenario.