add unit test for daemon