All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Schmitt via Grub-devel <grub-devel@gnu.org>
To: dkiper@net-space.pl
Cc: Thomas Schmitt <scdbackup@gmx.net>,
	phcoder@gmail.com, development@efficientek.com,
	grub-devel@gnu.org
Subject: Re: [PATCH] tests: Let grub_cmd_cryptomount by default operate in /tmp rather than in /
Date: Sun, 18 Aug 2024 22:09:32 +0200	[thread overview]
Message-ID: <1633330877280052563@scdbackup.webframe.org> (raw)
In-Reply-To: <20240814115432.e52bcpw3qtaznhe2@tomti.i.net-space.pl>

Hi,

the submission of v2 is hampered by the fact that the artful composition
of TMPDIR in tests/grub_cmd_cryptomount.in does not influence the worker
tests/util/grub-shell-luks-tester.in because TMPDIR is not exported.

So grub-shell-luks-tester creates its workdirectory directly in /tmp
rather than in /tmp/1724008906.LUKS1_test_key_file_with_offset_and_size/ .

More problems show up:
-------------------------------------------------------------------------

grub-shell-luks-tester does _not_ clean up.
That's because in a run of
  make check TESTS=grub_cmd_cryptomount
the situation in function cleanup() of grub-shell-luks-tester is:

  lukstestdir='/tmp/grub-shell-luks-tester.S2rhmuJJlf'
  debug=''
  RET=''
  {RET:-1}='1'

So the condition in the following if-clause is false because [ 1 -eq 0 ]:

  if [ -z "$debug" ] && [ "${RET:-1}" -eq 0 ]; then
      rm -rf "$lukstestdir" || :
  fi

and no rm -rf happens.

I riddle from where RET shall get its expected content 0.

-------------------------------------------------------------------------

After each make check round, another single directory is left:

  /tmp/tmp.yp1z11pq2w

of the same age as the grub-shell-luks-tester directories.
It stems from this gesture in grub-shell-luks-tester.in:

  # Add good password to second slot and change first slot to unchecked password
  csscript=`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` || exit 99

I proved this by changing "tmp.XXXXXXXXXX" to "tmp_css.XXXXXXXXXX" and
then getting  /tmp/tmp_css.5wRYh4CUaL .

-------------------------------------------------------------------------

Another problem is that the test leaves empty directories of the form

  /tmp/grub-shell.2jWNHEhpA2

(which also end up in TMPDIR if it is exported).

-------------------------------------------------------------------------

So i will have to investigate more ... and would not mind if others
would take this issue out of my hands.


Have a nice day :)

Thomas


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

  reply	other threads:[~2024-08-18 20:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-24 16:48 [PATCH] tests: Let grub_cmd_cryptomount by default operate in /tmp rather than in / Thomas Schmitt via Grub-devel
2024-08-13 13:59 ` Daniel Kiper
2024-08-13 15:11   ` Thomas Schmitt via Grub-devel
2024-08-14 11:50     ` Daniel Kiper
2024-08-13 16:14   ` Thomas Schmitt via Grub-devel
2024-08-14 11:54     ` Daniel Kiper
2024-08-18 20:09       ` Thomas Schmitt via Grub-devel [this message]
2024-08-18 21:41         ` Thomas Schmitt via Grub-devel
2024-09-23  5:57           ` Glenn Washburn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1633330877280052563@scdbackup.webframe.org \
    --to=grub-devel@gnu.org \
    --cc=development@efficientek.com \
    --cc=dkiper@net-space.pl \
    --cc=phcoder@gmail.com \
    --cc=scdbackup@gmx.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.