Move error handling out of the test code to make the actual test better visible. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>