[PATCH 1/5] test/py: Refactor extlinux-image creation into a function