tests: Re-factor PD and connection flows in P2PS tests