Add write_fake_ring helper to test.unit

... and some tests to use it.

Change-Id: I570d10af5011edcf8279605f8cd0fd1b3fd16bfa
Merge "Add write_fake_ring helper to test.unit" into feature/ec