[V2] add functional test for #test_connection

rebased #765.