test/py: Move U-Boot building into a function

This is a lot of code in a function that is too long. Split out the
building code.

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