Remove lots of code duplication in tests

Test: atest statsd_test
Change-Id: Ib7d2415abf45de2810fda7fc54cd126e2f526e6b
1 file changed