u-boot/test
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
..
cmd test: cmd: Add a basic test for 'addrmap' command 2021-03-05 10:25:43 +05:30
dm fastboot: Allow u-boot-style partitions 2021-02-26 15:30:55 +01:00
env env: Allow returning errors from hdelete_r() 2020-12-04 16:09:06 -05:00
fs Consistently use nproc for counting the CPUs 2020-01-30 13:30:35 -05:00
image test: Update test-imagetools.sh to match new syntax 2019-03-08 11:31:44 -05:00
lib common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
log common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
optee common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
overlay common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
py test: Don't unmount not (yet) mounted system 2021-03-31 07:50:17 -04:00
stdint Remove <inttypes.h> includes and PRI* usages in printf() entirely 2018-09-10 20:48:17 -04:00
trace SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
bloblist.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
bootm.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
cmd_ut.c test: cmd: Add a basic test for 'addrmap' command 2021-03-05 10:25:43 +05:30
command_ut.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
common.sh Consistently use nproc for counting the CPUs 2020-01-30 13:30:35 -05:00
compression.c test: Use ut_asserteq_mem() where possible 2020-05-19 14:01:47 -04:00
Kconfig test: linking test/compression.c fails 2020-11-05 09:11:31 -07:00
Makefile test: inconsistent bootm tests 2021-01-29 10:36:49 -05:00
nokia_rx51_test.sh Nokia RX-51: Add test for U-Boot serial console 2021-01-12 10:59:04 +05:30
print_ut.c dm: test: Always include command.h for print_ut 2021-03-28 17:30:35 -04:00
run test: Run SPL unit tests 2020-10-29 14:42:18 -06:00
str_ut.c test: correct the test prefix in ut str 2021-01-16 14:49:09 -05:00
time_ut.c common: Drop linux/delay.h from common header 2020-05-18 21:19:23 -04:00
unicode_ut.c lib/charset: UTF-8 stream conversion 2021-03-07 17:37:13 +01:00
ut.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00