Add some v2 agents API tests

On most APIs, the unit test coverage of v3 is better than the one of v2.
This patch ports v3 agents API tests to v2 tests for improving v2 agent
API tests.

Change-Id: I045c8fa64eb4cd2bf5852d4656d1067ec12a8564
Merge "Add some v2 agents API tests"