test_ut.py has accumulated a setup_*_image() helper for each image that
the bootflow tests want to boot. Each one is mostly shell script and
partition layout, so the file is large and the test logic is hidden
among image-creation details.

Move each setup function to its own module under test/py/img/, with a
shared common.py for mkdir_cond(), copy_partition() and the
make_extlinux_disk() helper. Each patch moves one image at a time so
reviewers can see the relocation cleanly. The modules are named after
the bootmeth or feature they exercise rather than the distribution they
are modelled on.

While here, also redirect the generated disk images to the
persistent-data directory instead of writing them under the source
tree. The sandbox mmc, scsi and usb-flash drivers now look there first.

Further improvements are planned, such as using the context manager
when creating partitions.

Changes in v2:
- Rename the setup_extlinux_image() helper to make_extlinux_disk()
- Rename the module to extlinux and the function to
  setup_extlinux_image(), naming it after the bootmeth it tests rather
  than the Fedora distribution it is modelled on
- Rename the module to script and the function to setup_script_image(),
  naming it after the bootmeth it tests rather than the Armbian
  distribution it is modelled on
- Reword to drop the per-OS naming, since the modules are now named
  after the bootmeth or feature they test

Simon Glass (11):
  test: Create a common file for image utilities
  test: Move extlinux image-creation to its own file
  test: Move script image-creation to its own file
  test: Move ChromeOS image-creation to its own file
  test: Move Android image-creation to its own file
  test: Move EFI image-creation to its own file
  test: Move the configuration-editor setup to its own file
  test: Add Args docstrings to img setup functions
  test: Reformat line wraps in img setup functions
  sandbox: Find disk images in the persistent-data directory
  test: Move disk images to persistent-data directory

 MAINTAINERS                      |   5 +
 drivers/mmc/sandbox_mmc.c        |  13 +-
 drivers/scsi/sandbox_scsi.c      |  15 +-
 drivers/usb/emul/sandbox_flash.c |  14 +-
 test/py/img/android.py           | 143 ++++++++
 test/py/img/cedit.py             |  24 ++
 test/py/img/chromeos.py          | 153 +++++++++
 test/py/img/common.py            |  86 +++++
 test/py/img/efi.py               |  37 +++
 test/py/img/extlinux.py          |  36 ++
 test/py/img/script.py            | 132 ++++++++
 test/py/tests/test_ut.py         | 541 +------------------------------
 12 files changed, 666 insertions(+), 533 deletions(-)
 create mode 100644 test/py/img/android.py
 create mode 100644 test/py/img/cedit.py
 create mode 100644 test/py/img/chromeos.py
 create mode 100644 test/py/img/common.py
 create mode 100644 test/py/img/efi.py
 create mode 100644 test/py/img/extlinux.py
 create mode 100644 test/py/img/script.py

---
base-commit: bacf09599a133f0274bc9fb8e67bfb444f057c16
branch: testc-us2

-- 
2.43.0

Reply via email to