factor out test-trigger from reudable test code