Thomas Schmitt proposed variations on these fixes[1]. I've broken his
patch into several patches with improvements.

Glenn

[1] https://lore.kernel.org/all/9956308756800479...@scdbackup.webframe.org/

v2:
 * Add patch #2 to allow grub-shell-luks-tester to cleanup properly on expected
   failure.
 * Add patch #5 to remove empty directories left by the cryptomount tests.

Glenn Washburn (5):
  tests/util/grub-shell-luks-tester: Add missing line to create RET
    variable in cleanup
  tests: Cleanup generated files on expected failure in
    grub_cmd_cryptomount
  tests/grub_cmd_cryptomount: Cleanup the cryptsetup script unless debug
    is enabled
  tests/grub_cmd_cryptomount: Default TMPDIR to /tmp
  tests/util/grub-shell: Remove the work directory on successful run and
    debug is not on

Thomas Schmitt (1):
  tests/grub_cmd_cryptomount: Remove temporary directories if successful
    and debug is not on

 tests/grub_cmd_cryptomount.in        | 18 ++++++++++++++++--
 tests/util/grub-shell-luks-tester.in |  7 ++++++-
 tests/util/grub-shell.in             |  1 +
 3 files changed, 23 insertions(+), 3 deletions(-)

Range-diff against v1:
1:  50ea280aa138 = 1:  e686c1848ab1 tests/util/grub-shell-luks-tester: Add 
missing line to create RET variable in cleanup
-:  ------------ > 2:  f94ebf9f040e tests: Cleanup generated files on expected 
failure in grub_cmd_cryptomount
2:  4d8fca393bfd ! 3:  1d1faee928cf tests: Cleaup the cryptsetup script in 
grub_cmd_cryptomount unless debug is enabled
    @@ Metadata
     Author: Glenn Washburn <developm...@efficientek.com>
     
      ## Commit message ##
    -    tests: Cleaup the cryptsetup script in grub_cmd_cryptomount unless 
debug is enabled
    +    tests/grub_cmd_cryptomount: Cleanup the cryptsetup script unless debug 
is enabled
     
         This fixes an issue where the grub_cmd_cryptomount test leaves a file
         with an ambiguous name in the / directory when TMPDIR is not set.
3:  e32175b06be6 ! 4:  5f1b424919b2 tests: Default TMPDIR to /tmp in 
grub_cmd_cryptomount tests
    @@ Metadata
     Author: Glenn Washburn <developm...@efficientek.com>
     
      ## Commit message ##
    -    tests: Default TMPDIR to /tmp in grub_cmd_cryptomount tests
    +    tests/grub_cmd_cryptomount: Default TMPDIR to /tmp
     
         This fixes behavior where grub_cmd_cryptomount temporary files, which 
are
         some times not cleaned up, are left in the / directory. Set TMPDIR if 
your
    @@ tests/grub_cmd_cryptomount.in: _testcase() {
     +    TMPDIR=${_TMPDIR}/`echo -n "$(date +%s).${LOGPREFIX}" | sed -e 's,[ 
/],_,g' -e 's,:$,,g'`
     +    export TMPDIR
          mkdir -p "$TMPDIR"
    +     set -- "$@" $([ "${EXPECTEDRES}" -eq 1 ] && echo "--xfail")
      
    -     output=`"$@" 2>&1` || res=$?
-:  ------------ > 5:  779233064126 tests/grub_cmd_cryptomount: Remove 
temporary directories if successful and debug is not on
4:  6ef75566e50b = 6:  e9fc44e07539 tests/util/grub-shell: Remove the work 
directory on successful run and debug is not on
-- 
2.34.1


_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to