lxd - Add a test case; Refactor; implement, make it pass
Refactor