Add integration test to test agent generation with -usedb

@kheradmand @yzhang90 @xiaohe27 Please review