user add/delete: add unit tests

This commit adds the test infrastructure such that we are able to
manipulate groups and users inside the unit test container.

To make it happen, the following changes are made:
1. executeCmd was moved to header
2. made the two userDelete and userAdd function virtual; this is needed
since on BMC the daemon is run as root by default; however on unit test
container, it's run as the current user on VMs. Thus in the unit test,
these two functions are overridden to dummy commands.

It can be shown that the unit test coverage increases a lot.

Tested: unit test pasesd

Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: I7be636d8acd487242831d1c74941e848e508b8f9
3 files changed