pastebin - collaborative debugging tool
rovema.kpaste.net RSS


msnfs41client: Tests for TMPDIR/TEMP/TMP on NFS filesystem, 2025-04-12
Posted by Anonymous on Sat 12th Apr 2025 20:41
raw | new post

  1. From cafe196707de8c678a65e29086e34c24ddea74f4 Mon Sep 17 00:00:00 2001
  2. From: Roland Mainz <roland.mainz@nrubsig.org>
  3. Date: Sat, 12 Apr 2025 20:13:22 +0200
  4. Subject: [PATCH 1/2] tests: nfsbuildtest.ksh93 should set TMPDIR/TEMP/TMP to
  5.  subdir on NFS filesystem
  6.  
  7. nfsbuildtest.ksh93 should set TMPDIR/TEMP/TMP to subdir on NFS filesystem,
  8. the bugs with using TMPDIR/TEMP/TMP access issues have been long fixed
  9. (e.g. see https://cygwin.com/pipermail/cygwin/2024-March/255625.html)
  10.  
  11. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  12. ---
  13. tests/nfsbuildtest/nfsbuildtest.ksh93 | 54 ++++++++++++++++-----------
  14.  1 file changed, 33 insertions(+), 21 deletions(-)
  15.  
  16. diff --git a/tests/nfsbuildtest/nfsbuildtest.ksh93 b/tests/nfsbuildtest/nfsbuildtest.ksh93
  17. index d4e7d7a..a12967d 100644
  18. --- a/tests/nfsbuildtest/nfsbuildtest.ksh93
  19. +++ b/tests/nfsbuildtest/nfsbuildtest.ksh93
  20. @@ -77,13 +77,17 @@ function gcc_build
  21.         # temp dir setup
  22.         #
  23.  
  24. -       # fixme: Does not work with NFSv4.1 filesystem from exported Linux tmpfs - why ?
  25. -       #tmpdir='/cygdrive/m/tmpdir'
  26. -       #mkdir -p "$tmpdir"
  27. -       #chmod a=rwxt "$tmpdir"
  28. -       #if [[ -d "$tmpdir" && -w "$tmpdir" ]] ; then
  29. -       #       export TMPDIR="$tmpdir"
  30. -       #fi
  31. +       tmpdir="$PWD/tmpdir"
  32. +       mkdir -p "$tmpdir"
  33. +       if [[ -d "$tmpdir" && -w "$tmpdir" ]] ; then
  34. +               printf '#### Using temp dir %q\n' "$tmpdir"
  35. +               export TMPDIR="$tmpdir"
  36. +               export TEMP="$tmpdir"
  37. +               export TMP="$tmpdir"
  38. +       else
  39. +               print -u2 -f "TEMPDIR %q on NFS filesystem does not work.\n" "$tmpdir"
  40. +               return 1
  41. +       fi
  42.  
  43.         #
  44.         # print user info
  45. @@ -249,13 +253,17 @@ function bash_build
  46.         # temp dir setup
  47.         #
  48.  
  49. -       # fixme: Does not work with NFSv4.1 filesystem from exported Linux tmpfs - why ?
  50. -       #tmpdir='/cygdrive/m/tmpdir'
  51. -       #mkdir -p "$tmpdir"
  52. -       #chmod a=rwxt "$tmpdir"
  53. -       #if [[ -d "$tmpdir" && -w "$tmpdir" ]] ; then
  54. -       #       export TMPDIR="$tmpdir"
  55. -       #fi
  56. +       tmpdir="$PWD/tmpdir"
  57. +       mkdir -p "$tmpdir"
  58. +       if [[ -d "$tmpdir" && -w "$tmpdir" ]] ; then
  59. +               printf '#### Using temp dir %q\n' "$tmpdir"
  60. +               export TMPDIR="$tmpdir"
  61. +               export TEMP="$tmpdir"
  62. +               export TMP="$tmpdir"
  63. +       else
  64. +               print -u2 -f "TEMPDIR %q on NFS filesystem does not work.\n" "$tmpdir"
  65. +               return 1
  66. +       fi
  67.  
  68.         #
  69.         # print user info
  70. @@ -413,13 +421,17 @@ function msnfs41client_build
  71.         # temp dir setup
  72.         #
  73.  
  74. -       # fixme: Does not work with NFSv4.1 filesystem from exported Linux tmpfs - why ?
  75. -       #tmpdir='/cygdrive/m/tmpdir'
  76. -       #mkdir -p "$tmpdir"
  77. -       #chmod a=rwxt "$tmpdir"
  78. -       #if [[ -d "$tmpdir" && -w "$tmpdir" ]] ; then
  79. -       #       export TMPDIR="$tmpdir"
  80. -       #fi
  81. +       tmpdir="$PWD/tmpdir"
  82. +       mkdir -p "$tmpdir"
  83. +       if [[ -d "$tmpdir" && -w "$tmpdir" ]] ; then
  84. +               printf '#### Using temp dir %q\n' "$tmpdir"
  85. +               export TMPDIR="$tmpdir"
  86. +               export TEMP="$tmpdir"
  87. +               export TMP="$tmpdir"
  88. +       else
  89. +               print -u2 -f "TEMPDIR %q on NFS filesystem does not work.\n" "$tmpdir"
  90. +               return 1
  91. +       fi
  92.  
  93.         #
  94.         # print user info
  95. --
  96. 2.45.1
  97.  
  98. From 1ecf4a5a05201ec6e84693775bbee92e0d42c12e Mon Sep 17 00:00:00 2001
  99. From: Roland Mainz <roland.mainz@nrubsig.org>
  100. Date: Sat, 12 Apr 2025 21:34:01 +0200
  101. Subject: [PATCH 2/2] tests: Add manual test whether TMPDIR/TEMP/TMP can be on
  102.  a NFS filesystem
  103.  
  104. Add manual test whether TMPDIR/TEMP/TMP can be on a NFS filesystem.
  105.  
  106. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  107. ---
  108. tests/manual_testing.txt | 10 +++++++++-
  109.  1 file changed, 9 insertions(+), 1 deletion(-)
  110.  
  111. diff --git a/tests/manual_testing.txt b/tests/manual_testing.txt
  112. index 0141a80..ed124ff 100644
  113. --- a/tests/manual_testing.txt
  114. +++ b/tests/manual_testing.txt
  115. @@ -1,5 +1,5 @@
  116.  #
  117. -# ms-nfs41-client manual testing sequence, 2025-04-08
  118. +# ms-nfs41-client manual testing sequence, 2025-04-12
  119.  #
  120.  # Draft version, needs to be turned into automated tests
  121.  # if possible
  122. @@ -456,6 +456,14 @@ $ runat "x1" "ls -la"
  123.  $ bash -c 'cd -@ "x1" && ls -la'
  124.  
  125.  
  126. +#
  127. +# Test whether TMPDIR, TEMP, TMP can be on a NFS filesystem
  128. +#
  129. +One-liner, should print two times lines with "test OK", stderr should be empty
  130. +---- snip ----
  131. +$ time ksh93 -c 'rm -Rf nfstmp1 gcc.x.strace.log x.c x.exe && mkdir nfstmp1 ; export TMPDIR="$PWD/nfstmp1" TEMP="$PWD/nfstmp1" TMP="$PWD/nfstmp1"; rm -f x.c x.exe && printf "#include <stdio.h>\n#include <stdlib.h>\nint main(int ac, char *av[]) { puts(\"hello world\"); return EXIT_SUCCESS;}\n" >x.c && strace -b $((512*1024)) -m syscall -o gcc.x.strace.log gcc x.c -o x.exe && ./x.exe && echo "# Compile Test OK" ; n="$(grep -E "/nfstmp1/.+\.o" gcc.x.strace.log | wc -l)" ; if (( n > 0 )) ; then echo "# Temp usage test OK: used by *.o files" ; else echo "# Test *.o FAILED" ; fi'
  132. +---- snip ---
  133. +
  134.  #
  135.  # ksh93 (ast-ksh)
  136.  #
  137. --
  138. 2.45.1

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at