Fix tests
Add integration test to agent registration process.