linux_old1/tools/testing/selftests/efivarfs
Po-Hsu Lin dff6d2ae56 selftests/efivarfs: clean up test files from test_create*()
Test files created by test_create() and test_create_empty() tests will
stay in the $efivarfs_mount directory until the system was rebooted.

When the tester tries to run this efivarfs test again on the same
system, the immutable characteristics in that directory will cause some
"Operation not permitted" noises, and a false-positve test result as the
file was created in previous run.
    --------------------
    running test_create
    --------------------
    ./efivarfs.sh: line 59: /sys/firmware/efi/efivars/test_create-210be57c-9849-4fc7-a635-e6382d1aec27: Operation not permitted
      [PASS]
    --------------------
    running test_create_empty
    --------------------
    ./efivarfs.sh: line 78: /sys/firmware/efi/efivars/test_create_empty-210be57c-9849-4fc7-a635-e6382d1aec27: Operation not permitted
     [PASS]
    --------------------

Create a file_cleanup() to remove those test files in the end of each
test to solve this issue.

For the test_create_read, we can move the clean up task to the end of
the test to ensure the system is clean.

Also, use this function to replace the existing file removal code.

Signed-off-by: Po-Hsu Lin <po-hsu.lin@canonical.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2019-04-19 17:17:19 -06:00
..
.gitignore selftests: add .gitignore for efivarfs 2015-10-15 20:00:32 -06:00
Makefile selftests: remove duplicated all and clean target 2017-01-05 13:41:35 -07:00
config selftests/efivarfs: add required kernel configs 2018-09-05 10:58:07 -06:00
create-read.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
efivarfs.sh selftests/efivarfs: clean up test files from test_create*() 2019-04-19 17:17:19 -06:00
open-unlink.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00