dm: test: Move test running code into a separate function

We want to run the same test on flat and live trees. In preparation for
this, create a new function which handles running a test.

Signed-off-by: Simon Glass <sjg@chromium.org>
1 file changed