tests: Add test of shadow connecting during dumping metadata

Change-Id: I0863c0758282931661196ec683dddcb525672dd9