user exist: simplify expression, add unit test

Simplified two boolean expression and added unit tests. The unit test
container has the root user by default and can be leveraged in the unit
test.

Tested: unit test passed.

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