u-boot/test/py/tests
Andy Shevchenko 1ba21bb06b test: Don't unmount not (yet) mounted system
When test suite tries to create a file for a new filesystem test case and fails,
the clean up of the exception tries to unmount the image, that has not yet been
mounted. When it happens, the fuse_mounted global variable is set to False and
inconveniently the test case tries to use sudo, so without this change the
admin of the machine gets an (annoying) email:

  Subject: *** SECURITY information for example.com ***

  example.com : Feb  5 19:43:47 : ... COMMAND=/bin/umount .../build-sandbox/persistent-data/mnt

and second run of the test cases on uncleaned build folder will ask for sudo
which is not what expected.

Besides that there is a double unmount calls during successfully run test case.

All of these due to over engineered Python try-except clause and people didn't
get it properly at all. The rule of thumb is that don't use more keywords than
try-except in the exception handling code. Nevertheless, here we adjust code
to be less intrusive to the initial logic behind that complex and unclear
constructions in the test case, although it adds a lot of lines of the code,
i.e. splits one exception handler to three, so on each step we know what
cleanup shall perform.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2021-03-31 07:50:17 -04:00
..
test_android
test_efi_capsule efi_loader: correct uboot_bin_env.its file format 2021-03-07 17:37:26 +01:00
test_efi_secboot
test_fs test: Don't unmount not (yet) mounted system 2021-03-31 07:50:17 -04:00
vboot
test_000_version.py
test_bind.py
test_button.py
test_dfu.py
test_dm.py
test_efi_fit.py
test_efi_loader.py
test_efi_selftest.py
test_env.py test: Include /sbin to the PATH when creating ext4 disk image 2021-03-17 12:50:19 -04:00
test_fit.py fit: Don't allow verification of images with @ nodes 2021-02-15 19:17:25 -05:00
test_fpga.py
test_gpio.py
test_gpt.py
test_handoff.py
test_help.py
test_hush_if_test.py
test_log.py test: add test for dropped trace before log_init 2021-01-15 14:36:11 -05:00
test_lsblk.py
test_md.py
test_mmc_rd.py
test_mmc_wr.py
test_net.py
test_ofplatdata.py test: test_ofplatdata: Mark as sandbox specific 2021-01-29 10:34:34 -05:00
test_part.py
test_pinmux.py
test_pstore.py
test_pstore_data_console.hex
test_pstore_data_panic1.hex
test_pstore_data_panic2.hex
test_sandbox_exit.py test: unit test for exception command 2020-12-13 07:58:17 -07:00
test_sf.py
test_shell_basics.py
test_sleep.py
test_spl.py
test_tpm2.py
test_ums.py
test_unknown_cmd.py
test_ut.py
test_vboot.py image: Check for unit addresses in FITs 2021-02-15 22:31:54 -05:00
vboot_evil.py test: Add vboot_evil implementation 2021-02-15 19:17:29 -05:00
vboot_forge.py fit: Don't allow verification of images with @ nodes 2021-02-15 19:17:25 -05:00