dm: core: Create a function to get a live tree in a test