Add more tests for magnum/common

Test cases were ported from Nova and Ironic.

Implements: blueprint increase-test-coverage
Change-Id: Ibd262ac84af3167077c9d2c4fd6c1ea872b9b303