Backport some v3 aggregate API unittest to v2 API

This patch add some v3 aggregate API unittest into V2 API to improve
V2 API unittesting.

Change-Id: Id4d533e74b462b55b155b4e4ad7d94e018d35726
Merge "Backport some v3 aggregate API unittest to v2 API"