pastebin - collaborative debugging tool
rovema.kpaste.net RSS


msnfs41client: Patch for GNU patch |chgrp()| failure, big tests update+misc, 2025-02-18
Posted by Anonymous on Tue 18th Feb 2025 17:10
raw | new post

  1. From 7760d99106b9c89b07899ae8888a0a36987081ea Mon Sep 17 00:00:00 2001
  2. From: Roland Mainz <roland.mainz@nrubsig.org>
  3. Date: Tue, 18 Feb 2025 14:03:05 +0100
  4. Subject: [PATCH 1/6] tests: winfsinfo: "nfs3attr" subcmd output cannot be read
  5.  by ksh93 read -C
  6.  
  7. winfsinfo: "nfs3attr" subcmd output cannot be read by ksh93 read -C
  8.  
  9. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  10. ---
  11. tests/winfsinfo1/winfsinfo.c | 6 +++---
  12.  1 file changed, 3 insertions(+), 3 deletions(-)
  13.  
  14. diff --git a/tests/winfsinfo1/winfsinfo.c b/tests/winfsinfo1/winfsinfo.c
  15. index 3a6c26a..4705ab5 100644
  16. --- a/tests/winfsinfo1/winfsinfo.c
  17. +++ b/tests/winfsinfo1/winfsinfo.c
  18. @@ -825,9 +825,9 @@ bool get_nfs3attr(const char *progname, const char *filename)
  19.          "\tsize=%lld\n\tused=%lld\n"
  20.          "\trdev=( specdata1=0x%x specdata2=0x%x )\n"
  21.          "\tfsid=0x%llx\n\tfileid=0x%llx\n"
  22. -        "\tatime=(tv_sec=%ld,tv_nsec=%lu)\n"
  23. -        "\tmtime=(tv_sec=%ld,tv_nsec=%lu)\n"
  24. -        "\tctime=(tv_sec=%ld,tv_nsec=%lu)\n"
  25. +        "\tatime=( tv_sec=%ld tv_nsec=%lu )\n"
  26. +        "\tmtime=( tv_sec=%ld tv_nsec=%lu )\n"
  27. +        "\tctime=( tv_sec=%ld tv_nsec=%lu )\n"
  28.          ")\n",
  29.          filename,
  30.          (int)n3a->type,
  31. --
  32. 2.45.1
  33.  
  34. From dea5fe7273111fc22c88aed18c31e73176191682 Mon Sep 17 00:00:00 2001
  35. From: Roland Mainz <roland.mainz@nrubsig.org>
  36. Date: Tue, 18 Feb 2025 14:48:39 +0100
  37. Subject: [PATCH 2/6] tests: winfsinfo: Output should be POSIX sh compatible
  38.  (no <cr>)
  39.  
  40. winfsinfo: Output should be POSIX sh compatible (no <cr>),
  41. otherwise we would need dos2unix each time we want to read
  42. the output with bash/ksh93 etc.
  43.  
  44. Reported-by: Martin Wege <martin.l.wege@gmail.com>
  45. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  46. ---
  47. tests/winfsinfo1/winfsinfo.c | 11 +++++++++++
  48.  1 file changed, 11 insertions(+)
  49.  
  50. diff --git a/tests/winfsinfo1/winfsinfo.c b/tests/winfsinfo1/winfsinfo.c
  51. index 4705ab5..0b2962c 100644
  52. --- a/tests/winfsinfo1/winfsinfo.c
  53. +++ b/tests/winfsinfo1/winfsinfo.c
  54. @@ -32,6 +32,8 @@
  55.  #define UNICODE 1
  56.  #define _UNICODE 1
  57.  
  58. +#include <io.h>
  59. +#include <fcntl.h>
  60.  #include <stdio.h>
  61.  #include <windows.h>
  62.  #include <stdlib.h>
  63. @@ -993,6 +995,15 @@ int main(int ac, char *av[])
  64.  {
  65.      const char *subcmd;
  66.  
  67. +    /*
  68. +     * Force |O_BINARY| mode for stdio so we do not set <CR> to be
  69. +     * UNIX/POSIX-compatible, otherwise we would need dos2unix each
  70. +     * time to make our output compatble to POSIX sh shell scripts
  71. +     */
  72. +    (void)_setmode(fileno(stdin), O_BINARY);
  73. +    (void)_setmode(fileno(stdout), O_BINARY);
  74. +    (void)_setmode(fileno(stderr), O_BINARY);
  75. +
  76.      if (ac < 3) {
  77.          usage();
  78.          return 2;
  79. --
  80. 2.45.1
  81.  
  82. From 5019fd9b4b156ba03876256984f148cdfa19db75 Mon Sep 17 00:00:00 2001
  83. From: Roland Mainz <roland.mainz@nrubsig.org>
  84. Date: Tue, 18 Feb 2025 15:11:07 +0100
  85. Subject: [PATCH 3/6] tests: winfsinfo should use typeset -A for flag fields
  86.  
  87. winfsinfo should use typeset -A for flag fields, so scripts can
  88. use [[ -v varname }} to test whether a flag is set or not.
  89.  
  90. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  91. ---
  92. tests/winfsinfo1/winfsinfo.c | 68 +++++++++++++++++++++---------------
  93.  1 file changed, 39 insertions(+), 29 deletions(-)
  94.  
  95. diff --git a/tests/winfsinfo1/winfsinfo.c b/tests/winfsinfo1/winfsinfo.c
  96. index 0b2962c..c7d87a9 100644
  97. --- a/tests/winfsinfo1/winfsinfo.c
  98. +++ b/tests/winfsinfo1/winfsinfo.c
  99. @@ -89,11 +89,11 @@ bool getvolumeinfo(const char *progname, const char *filename)
  100.  
  101.      (void)printf("(\n");
  102.      (void)printf("\tfilename='%s'\n", filename);
  103. -    (void)printf("\ttypeset -a volumeflags=(\n");
  104. +    (void)printf("\ttypeset -A volumeflags=(\n");
  105.  
  106.  #define TESTVOLFLAG(s) \
  107.      if (volumeFlags & (s)) { \
  108. -        (void)puts("\t\t"#s); \
  109. +        (void)printf("\t\t['%s']=0x%lx\n", (#s), (unsigned long)(s)); \
  110.          volumeFlags &= ~(s); \
  111.      }
  112.  
  113. @@ -133,15 +133,18 @@ bool getvolumeinfo(const char *progname, const char *filename)
  114.      TESTVOLFLAG(FILE_SUPPORTS_GHOSTING);
  115.  #endif
  116.  
  117. -    (void)printf("\t)\n");
  118.  
  119.      /*
  120.       * print any leftover flags not covered by |TESTVOLFLAG(FILE_*)|
  121.       * above
  122.       */
  123.      if (volumeFlags) {
  124. -        (void)printf("\tattr=0x%lx\n", (long)volumeFlags);
  125. +        (void)printf("\t\t['remainingflags']=0x%lx\n",
  126. +            (unsigned long)volumeFlags);
  127.      }
  128. +
  129. +    (void)printf("\t)\n");
  130. +
  131.      (void)printf(")\n");
  132.      res = EXIT_SUCCESS;
  133.  
  134. @@ -225,11 +228,11 @@ bool getfilefssectorsizeinformation(const char *progname, const char *filename)
  135.  
  136.      DWORD fssiflags = ffssi.Flags;
  137.  
  138. -    (void)printf("\ttypeset -a Flags=(\n");
  139. +    (void)printf("\ttypeset -A Flags=(\n");
  140.  
  141.  #define TESTFSSI(s) \
  142.      if (fssiflags & (s)) { \
  143. -        (void)puts("\t\t"#s); \
  144. +        (void)printf("\t\t['%s']=0x%lx\n", (#s), (unsigned long)(s)); \
  145.          fssiflags &= ~(s); \
  146.      }
  147.      TESTFSSI(SSINFO_FLAGS_ALIGNED_DEVICE);
  148. @@ -238,16 +241,16 @@ bool getfilefssectorsizeinformation(const char *progname, const char *filename)
  149.      TESTFSSI(SSINFO_FLAGS_TRIM_ENABLED);
  150.      TESTFSSI(SSINFO_FLAGS_BYTE_ADDRESSABLE);
  151.  
  152. -    (void)printf("\t)\n");
  153. -
  154.      /*
  155.       * print any leftover flags not covered by |TESTFBIA(FILE_*)|
  156.       * above
  157.       */
  158.      if (fssiflags) {
  159. -        (void)printf("\tFlags=0x%lx\n", (long)fssiflags);
  160. +        (void)printf("\t\t['remainingflags']=0x%lx\n", (unsigned long)fssiflags);
  161.      }
  162.  
  163. +    (void)printf("\t)\n");
  164. +
  165.      (void)printf("\tByteOffsetForSectorAlignment=%lu\n",
  166.          (unsigned long)ffssi.ByteOffsetForSectorAlignment);
  167.      (void)printf("\tByteOffsetForPartitionAlignment=%lu\n",
  168. @@ -304,11 +307,11 @@ bool get_file_basic_info(const char *progname, const char *filename)
  169.      (void)printf("\tChangeTime=%lld\n", (long long)finfo.ChangeTime.QuadPart);
  170.      DWORD fattr = finfo.FileAttributes;
  171.  
  172. -    (void)printf("\ttypeset -a FileAttributes=(\n");
  173. +    (void)printf("\ttypeset -A FileAttributes=(\n");
  174.  
  175.  #define TESTFBIA(s) \
  176.      if (fattr & (s)) { \
  177. -        (void)puts("\t\t"#s); \
  178. +        (void)printf("\t\t['%s']=0x%lx\n", (#s), (unsigned long)(s)); \
  179.          fattr &= ~(s); \
  180.      }
  181.      TESTFBIA(FILE_ATTRIBUTE_READONLY);
  182. @@ -334,15 +337,17 @@ bool get_file_basic_info(const char *progname, const char *filename)
  183.      TESTFBIA(FILE_ATTRIBUTE_RECALL_ON_OPEN);
  184.      TESTFBIA(FILE_ATTRIBUTE_RECALL_ON_DATA_ACCESS);
  185.  
  186. -    (void)printf("\t)\n");
  187. -
  188.      /*
  189.       * print any leftover flags not covered by |TESTFBIA(FILE_*)|
  190.       * above
  191.       */
  192.      if (fattr) {
  193. -        (void)printf("\tfattr=0x%lx\n", (long)fattr);
  194. +        (void)printf("\t\t['remainingflags']=0x%lx\n",
  195. +            (unsigned long)fattr);
  196.      }
  197. +
  198. +    (void)printf("\t)\n");
  199. +
  200.      (void)printf(")\n");
  201.      res = EXIT_SUCCESS;
  202.  
  203. @@ -400,11 +405,11 @@ bool get_fileexinfostandard(const char *progname, const char *filename)
  204.  
  205.      DWORD fattr = finfo.dwFileAttributes;
  206.  
  207. -    (void)printf("\ttypeset -a dwFileAttributes=(\n");
  208. +    (void)printf("\ttypeset -A dwFileAttributes=(\n");
  209.  
  210.  #define TESTFEIS(s) \
  211.      if (fattr & (s)) { \
  212. -        (void)puts("\t\t"#s); \
  213. +        (void)printf("\t\t['%s']=0x%lx\n", (#s), (unsigned long)(s)); \
  214.          fattr &= ~(s); \
  215.      }
  216.      TESTFEIS(FILE_ATTRIBUTE_READONLY);
  217. @@ -430,15 +435,17 @@ bool get_fileexinfostandard(const char *progname, const char *filename)
  218.      TESTFEIS(FILE_ATTRIBUTE_RECALL_ON_OPEN);
  219.      TESTFEIS(FILE_ATTRIBUTE_RECALL_ON_DATA_ACCESS);
  220.  
  221. -    (void)printf("\t)\n");
  222. -
  223.      /*
  224.       * print any leftover flags not covered by |TESTFNOI(FILE_*)|
  225.       * above
  226.       */
  227.      if (fattr) {
  228. -        (void)printf("\tfattr=0x%lx\n", (long)fattr);
  229. +        (void)printf("\t\t['remainingflags']=0x%lx\n",
  230. +            (unsigned long)fattr);
  231.      }
  232. +
  233. +    (void)printf("\t)\n");
  234. +
  235.      (void)printf(")\n");
  236.      res = EXIT_SUCCESS;
  237.  
  238. @@ -652,25 +659,27 @@ bool get_filecasesensitiveinfo(const char *progname, const char *filename)
  239.      (void)printf("(\n");
  240.      (void)printf("\tfilename='%s'\n", filename);
  241.  
  242. -    (void)printf("\ttypeset -a Flags=(\n");
  243. +    (void)printf("\ttypeset -A Flags=(\n");
  244.  
  245.      ULONG fcsi_flags = finfo.Flags;
  246.  #define TESTFCSI(s) \
  247.      if (fcsi_flags & (s)) { \
  248. -        (void)puts("\t\t"#s); \
  249. +        (void)printf("\t\t['%s']=0x%lx\n", (#s), (unsigned long)(s)); \
  250.          fcsi_flags &= ~(s); \
  251.      }
  252.      TESTFCSI(FILE_CS_FLAG_CASE_SENSITIVE_DIR);
  253.  
  254. -    (void)printf("\t)\n");
  255. -
  256.      /*
  257.       * print any leftover flags not covered by |TESTFCSI(FILE_*)|
  258.       * above
  259.       */
  260.      if (fcsi_flags) {
  261. -        (void)printf("\ffcsi_flags=0x%lx\n", (long)fcsi_flags);
  262. +        (void)printf("\t\t['remainingflags']=0x%lx\n",
  263. +            (unsigned long)fcsi_flags);
  264.      }
  265. +
  266. +    (void)printf("\t)\n");
  267. +
  268.      (void)printf(")\n");
  269.      res = EXIT_SUCCESS;
  270.  
  271. @@ -904,11 +913,11 @@ bool get_file_remote_protocol_info(const char *progname, const char *filename)
  272.      (void)printf("\tReserved=0x%x\n",
  273.          (unsigned int)frpi.Reserved);
  274.  
  275. -    (void)printf("\ttypeset -a Flags=(\n");
  276. +    (void)printf("\ttypeset -A Flags=(\n");
  277.  
  278.  #define TESTREMOTEPROTOCOLFLAG(s) \
  279.      if (frpi.Flags & (s)) { \
  280. -        (void)puts("\t\t"#s); \
  281. +        (void)printf("\t\t['%s']=0x%lx\n", (#s), (unsigned long)(s)); \
  282.          frpi.Flags &= ~(s); \
  283.      }
  284.  
  285. @@ -919,16 +928,17 @@ bool get_file_remote_protocol_info(const char *progname, const char *filename)
  286.      TESTREMOTEPROTOCOLFLAG(REMOTE_PROTOCOL_FLAG_INTEGRITY);
  287.      TESTREMOTEPROTOCOLFLAG(REMOTE_PROTOCOL_FLAG_MUTUAL_AUTH);
  288.  
  289. -    (void)printf("\t)\n");
  290. -
  291.      /*
  292.       * print any leftover flags not covered by
  293.       * |TESTREMOTEPROTOCOLFLAG()| above
  294.       */
  295.      if (frpi.Flags) {
  296. -        (void)printf("\tattr=0x%lx\n", (long)frpi.Flags);
  297. +        (void)printf("\t\t['remainingflags']=0x%lx\n",
  298. +            (unsigned long)frpi.Flags);
  299.      }
  300.  
  301. +    (void)printf("\t)\n");
  302. +
  303.      /* GenericReserved */
  304.      (void)printf("\tcompound GenericReserved=(\n");
  305.      (void)printf("\t\ttypeset -a Reserved=(\n");
  306. --
  307. 2.45.1
  308.  
  309. From 7f39520007dff4a4ebf401346499253d6f61d96a Mon Sep 17 00:00:00 2001
  310. From: Roland Mainz <roland.mainz@nrubsig.org>
  311. Date: Tue, 18 Feb 2025 15:13:15 +0100
  312. Subject: [PATCH 4/6] tests: winfsinfo: Cast |CloseHandle()| return code to
  313.  |void|
  314.  
  315. winfsinfo: Cleanup: Cast |CloseHandle()| return code to |void|.
  316.  
  317. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  318. ---
  319. tests/winfsinfo1/winfsinfo.c | 8 ++++----
  320.  1 file changed, 4 insertions(+), 4 deletions(-)
  321.  
  322. diff --git a/tests/winfsinfo1/winfsinfo.c b/tests/winfsinfo1/winfsinfo.c
  323. index c7d87a9..4772428 100644
  324. --- a/tests/winfsinfo1/winfsinfo.c
  325. +++ b/tests/winfsinfo1/winfsinfo.c
  326. @@ -149,7 +149,7 @@ bool getvolumeinfo(const char *progname, const char *filename)
  327.      res = EXIT_SUCCESS;
  328.  
  329.  done:
  330. -    CloseHandle(fileHandle);
  331. +    (void)CloseHandle(fileHandle);
  332.      return res;
  333.  }
  334.  
  335. @@ -352,7 +352,7 @@ bool get_file_basic_info(const char *progname, const char *filename)
  336.      res = EXIT_SUCCESS;
  337.  
  338.  done:
  339. -    CloseHandle(fileHandle);
  340. +    (void)CloseHandle(fileHandle);
  341.      return res;
  342.  }
  343.  
  344. @@ -498,7 +498,7 @@ bool get_file_standard_info(const char *progname, const char *filename)
  345.      res = EXIT_SUCCESS;
  346.  
  347.  done:
  348. -    CloseHandle(fileHandle);
  349. +    (void)CloseHandle(fileHandle);
  350.      return res;
  351.  }
  352.  
  353. @@ -618,7 +618,7 @@ bool get_filenormalizednameinfo(const char *progname, const char *filename)
  354.      res = EXIT_SUCCESS;
  355.  
  356.  done:
  357. -    CloseHandle(fileHandle);
  358. +    (void)CloseHandle(fileHandle);
  359.      return res;
  360.  }
  361.  
  362. --
  363. 2.45.1
  364.  
  365. From 9d5b712a522c29314452364ec9e16b44b4dcf762 Mon Sep 17 00:00:00 2001
  366. From: Roland Mainz <roland.mainz@nrubsig.org>
  367. Date: Tue, 18 Feb 2025 16:53:20 +0100
  368. Subject: [PATCH 5/6] daemon,tests: Fix |chgrp()| with Unix_Group+<gid> SIDs
  369.  
  370. Fix |chgrp()| with Unix_Group+<gid> SIDs
  371.  
  372. Testcase:
  373. (GNU patch usually fails with
  374. 'patch: **** Failed to set the owning group of file ./d2.oL0Iv8e : Permission denied'
  375. if |chgrp()| fails
  376. ---- snip ----
  377. $ rm -f d1 d2 d1.diff ; printf '1\n2\n' >d1 ; cp d1 d2 ; printf '3\n' >> d2 ; diff -u d1 d2 | sed 's/d1/d2/g' >d1.diff ; patch -R -p0 <d1.diff && echo "# test OK"
  378. ---- snip ----
  379. The test should print "# test OK"
  380.  
  381. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  382. ---
  383. daemon/acl.c             | 12 +++++++++---
  384.  tests/manual_testing.txt | 14 ++++++++++++++
  385.  2 files changed, 23 insertions(+), 3 deletions(-)
  386.  
  387. diff --git a/daemon/acl.c b/daemon/acl.c
  388. index 159ad1f..e69c81c 100644
  389. --- a/daemon/acl.c
  390. +++ b/daemon/acl.c
  391. @@ -1040,7 +1040,7 @@ int map_sid2nfs4ace_who(PSID sid, PSID owner_sid, PSID group_sid,
  392.                              "Unix_User+%d SID "
  393.                              "mapped to user '%s'\n",
  394.                              unixuser_uid, who_out));
  395. -                        goto no_add_domain;
  396. +                        goto add_domain;
  397.                      }
  398.  
  399.                      eprintf("map_sid2nfs4ace_who: "
  400. @@ -1061,7 +1061,7 @@ int map_sid2nfs4ace_who(PSID sid, PSID owner_sid, PSID group_sid,
  401.                              "Unix_Group+%d SID "
  402.                              "mapped to group '%s'\n",
  403.                              unixgroup_gid, who_out));
  404. -                        goto no_add_domain;
  405. +                        goto add_domain;
  406.                      }
  407.  
  408.                      eprintf("map_sid2nfs4ace_who: "
  409. @@ -1106,6 +1106,12 @@ err_none_mapped:
  410.  
  411.      (void)memcpy(who_out, who_buf, who_size);
  412.  add_domain:
  413. +    /*
  414. +     * Complain if we attempt to add a domain suffix to an UID/GID
  415. +     * value
  416. +     */
  417. +    EASSERT(!isdigit(who_out[0]));
  418. +
  419.      (void)memcpy(who_out+who_size, "@", sizeof(char));
  420.  
  421.  #ifdef NFS41_DRIVER_WS2022_HACKS
  422. @@ -1126,7 +1132,7 @@ add_domain:
  423.  #endif /* NFS41_DRIVER_WS2022_HACKS */
  424.      (void)memcpy(who_out+who_size+1, domain, strlen(domain)+1);
  425.  
  426. -no_add_domain:
  427. +/* no_add_domain: */
  428.      status = ERROR_SUCCESS;
  429.  out:
  430.      if (status) {
  431. diff --git a/tests/manual_testing.txt b/tests/manual_testing.txt
  432. index 13b82f6..065ba42 100644
  433. --- a/tests/manual_testing.txt
  434. +++ b/tests/manual_testing.txt
  435. @@ -159,6 +159,20 @@ ksh93 -c 'builtin id ; rm -f x ; touch x ; chown "$(id -u -n):$(id -g -n)" x &&
  436.  ksh93 -c 'builtin id ; rm -f x ; touch x ; chgrp "$(id -g -n)" x && print OK'
  437.  ---- snip ----
  438.  
  439. +
  440. +#
  441. +# Test for |chgrp()| used with GNU /usr/bin/patch
  442. +# (GNU patch usually fails with
  443. +# 'patch: **** Failed to set the owning group of file ./d2.oL0Iv8e : Permission denied'
  444. +# if |chgrp()| fails
  445. +#
  446. +---- snip ----
  447. +$ rm -f d1 d2 d1.diff ; printf '1\n2\n' >d1 ; cp d1 d2 ; printf '3\n' >> d2 ; diff -u d1 d2 | sed 's/d1/d2/g' >d1.diff ; patch -R -p0 <d1.diff && echo "# test OK"
  448. +---- snip ----
  449. +
  450. +The test should print "# test OK"
  451. +
  452. +
  453.  #
  454.  # Test for native mklink  && powershell New-Item -ItemType SymbolicLink
  455.  #
  456. --
  457. 2.45.1
  458.  
  459. From 92ddf547986b6ec3f0dcf288c7e1759ffde544ec Mon Sep 17 00:00:00 2001
  460. From: Roland Mainz <roland.mainz@nrubsig.org>
  461. Date: Tue, 18 Feb 2025 17:55:26 +0100
  462. Subject: [PATCH 6/6] cygwin,tests: Update cthon04 test suite+usage
  463.  instructions
  464.  
  465. Update cthon04 test suite+usage instructions to
  466. https://git.linux-nfs.org/?p=steved/cthon04.git;a=commit;h=6c9abfd6907b2b43036af111cc600ab60ef804e5
  467.  
  468. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  469. ---
  470. cygwin/README.txt                             |  22 +-
  471.  .../0001-cthon-tests.init-for-linux.patch     | 120 ----
  472.  .../cthon04/0001-tools-Cygwin-3.6-port.patch  |  61 ++
  473.  ...-for-ms-nfs41-client-POSIX-symlink-t.patch |  31 +
  474.  .../0002-cthon-fixing-tools-compilation.patch |  51 --
  475.  ...hon-fixing-locks-compilation-problem.patch |  29 -
  476.  .../0003-lock-Fix-issue-with-tlock-path.patch |  28 +
  477.  ...emoved-fwritable-strings-from-cflags.patch |  26 -
  478.  ...CK-Disable-tests-which-cannot-work-o.patch |  60 ++
  479.  ...-scripts-use-.exe-extension-dirent.h.patch | 169 -----
  480.  .../0006-cthon-fixing-op_unlk-op_ren.patch    |  72 ---
  481.  ...thon-porting-lock-tests-to-win32-api.patch | 577 ------------------
  482.  ...-disabling-test8-from-the-basic-test.patch |  26 -
  483.  ...-enabling-NATIVE64-for-special-tests.patch |  26 -
  484.  .../0010-cthon-fixes-for-64-bit-locking.patch |  60 --
  485.  ...011-cthon-setting-maxeof-to-be-64bit.patch |  26 -
  486.  ...pmapbrb-pmaptst-tests-from-tools-dir.patch |  26 -
  487.  tests/cthon04/0013-nroff-patch.patch          |  26 -
  488.  ...ng-out-symlink-test-in-special-tests.patch |  35 --
  489.  ...on-enabled-basic-test4a-5a-5b-and-7a.patch |  51 --
  490.  ...or-messages-for-newer-Cygwin-nroff-v.patch |  30 -
  491.  tests/manual_testing.txt                      |  24 +-
  492.  22 files changed, 205 insertions(+), 1371 deletions(-)
  493.  delete mode 100644 tests/cthon04/0001-cthon-tests.init-for-linux.patch
  494.  create mode 100644 tests/cthon04/0001-tools-Cygwin-3.6-port.patch
  495.  create mode 100644 tests/cthon04/0002-basic-Workaround-for-ms-nfs41-client-POSIX-symlink-t.patch
  496.  delete mode 100644 tests/cthon04/0002-cthon-fixing-tools-compilation.patch
  497.  delete mode 100644 tests/cthon04/0003-cthon-fixing-locks-compilation-problem.patch
  498.  create mode 100644 tests/cthon04/0003-lock-Fix-issue-with-tlock-path.patch
  499.  delete mode 100644 tests/cthon04/0004-cthon-removed-fwritable-strings-from-cflags.patch
  500.  create mode 100644 tests/cthon04/0004-special-tools-HACK-Disable-tests-which-cannot-work-o.patch
  501.  delete mode 100644 tests/cthon04/0005-cthon-general-scripts-use-.exe-extension-dirent.h.patch
  502.  delete mode 100644 tests/cthon04/0006-cthon-fixing-op_unlk-op_ren.patch
  503.  delete mode 100644 tests/cthon04/0007-cthon-porting-lock-tests-to-win32-api.patch
  504.  delete mode 100644 tests/cthon04/0008-cthon-disabling-test8-from-the-basic-test.patch
  505.  delete mode 100644 tests/cthon04/0009-cthon-enabling-NATIVE64-for-special-tests.patch
  506.  delete mode 100644 tests/cthon04/0010-cthon-fixes-for-64-bit-locking.patch
  507.  delete mode 100644 tests/cthon04/0011-cthon-setting-maxeof-to-be-64bit.patch
  508.  delete mode 100644 tests/cthon04/0012-removing-pmapbrb-pmaptst-tests-from-tools-dir.patch
  509.  delete mode 100644 tests/cthon04/0013-nroff-patch.patch
  510.  delete mode 100644 tests/cthon04/0014-commenting-out-symlink-test-in-special-tests.patch
  511.  delete mode 100644 tests/cthon04/0015-cthon-enabled-basic-test4a-5a-5b-and-7a.patch
  512.  delete mode 100644 tests/cthon04/0016-cthon-Handle-error-messages-for-newer-Cygwin-nroff-v.patch
  513.  
  514. diff --git a/cygwin/README.txt b/cygwin/README.txt
  515. index b3f9103..634cfcf 100644
  516. --- a/cygwin/README.txt
  517. +++ b/cygwin/README.txt
  518. @@ -136,29 +136,11 @@ bash ../cygwin/devel/msnfs41client.bash run_daemon
  519.  bash ../cygwin/devel/msnfs41client.bash mount_homedir
  520.  
  521.  
  522. -
  523.  ######## Testing:
  524. -** "cthon04" test suite:
  525. -# mount a NFSv4 filesystem, and then execute this
  526. -# on this filesystem
  527. -mkdir nfsv4cthontest1 && cd nfsv4cthontest1
  528. -git clone https://github.com/kofemann/ms-nfs41-client.git
  529. -git clone git://git.linux-nfs.org/projects/steved/cthon04.git
  530. -cd cthon04/
  531. -git config --global --add safe.directory "$PWD"
  532. -git checkout 8cefaa2ecf8d5c1240f1573530f07cfbbfc092ea
  533. -git am ../ms-nfs41-client/tests/cthon04/*.patch
  534. -make 2>&1 | tee buildlog.log
  535. -mkdir testdir1
  536. -./runtests -a -t "$PWD/testdir1" 2>&1 | tee testrun.log
  537. -
  538. -
  539. -** "winfstest" test suite:
  540. -See tests/winfstest/README.txt
  541. -
  542. +Seen tests/manual_testing.txt
  543.  
  544.  #### ToDo:
  545. -- Makefile/script support for release blob generaetion, local test installation, running cthon4 etc
  546. +- Makefile/script support for release blob generaetion, local test installation etc
  547.  - DocBook/XML based documentation
  548.  - Document how to get and build ksh93 for Cygwin
  549.  - Cygwin-specific binary release blob
  550. diff --git a/tests/cthon04/0001-cthon-tests.init-for-linux.patch b/tests/cthon04/0001-cthon-tests.init-for-linux.patch
  551. deleted file mode 100644
  552. index d292a5e..0000000
  553. --- a/tests/cthon04/0001-cthon-tests.init-for-linux.patch
  554. +++ /dev/null
  555. @@ -1,120 +0,0 @@
  556. -From 6fc1a22d9f13e3f5a0ce5357582c511e5810bd89 Mon Sep 17 00:00:00 2001
  557. -From: Casey Bodley <cbodley@citi.umich.edu>
  558. -Date: Mon, 11 Oct 2010 15:22:37 -0400
  559. -Subject: [PATCH 01/11] cthon: tests.init for linux
  560. -
  561. ----
  562. - tests.init |   36 ++++++++++++++++++------------------
  563. - 1 files changed, 18 insertions(+), 18 deletions(-)
  564. -
  565. -diff --git a/tests.init b/tests.init
  566. -index 69b51bf..e55a4aa 100644
  567. ---- a/tests.init
  568. -+++ b/tests.init
  569. -@@ -13,8 +13,8 @@ MNTPOINT="/mnt"
  570. - # Use this mount command if using:
  571. - #     SVR4
  572. - #     Solaris 2.x
  573. --MOUNTCMD='./domount -F nfs -o $MNTOPTIONS $SERVER\:$SERVPATH $MNTPOINT'
  574. --CFSMOUNTCMD='./domount -F cachefs -o $MNTOPTIONS $SERVER\:$SERVPATH $MNTPOINT'
  575. -+#MOUNTCMD='./domount -F nfs -o $MNTOPTIONS $SERVER\:$SERVPATH $MNTPOINT'
  576. -+#CFSMOUNTCMD='./domount -F cachefs -o $MNTOPTIONS $SERVER\:$SERVPATH $MNTPOINT'
  577. -
  578. - # Use this mount command if using:
  579. - #     BSD
  580. -@@ -26,22 +26,22 @@ CFSMOUNTCMD='./domount -F cachefs -o $MNTOPTIONS $SERVER\:$SERVPATH $MNTPOINT'
  581. - #     Mac OS X
  582. - # At least some BSD systems don't recognize "hard" (since that's the
  583. - # default), so you might also want to use this definition of MNTOPTIONS.
  584. --#MNTOPTIONS="rw,intr"
  585. --#MOUNTCMD='./domount -o $MNTOPTIONS $SERVER\:$SERVPATH $MNTPOINT'
  586. -+MNTOPTIONS="rw,intr"
  587. -+MOUNTCMD='./domount -o $MNTOPTIONS $SERVER\:$SERVPATH $MNTPOINT'
  588. -
  589. - # Use this mount command if using:
  590. - #     DG/UX
  591. - #MOUNTCMD='./domount -t nfs -o $MNTOPTIONS $SERVER\:$SERVPATH $MNTPOINT'
  592. -
  593. --UMOUNTCMD='./domount -u $MNTPOINT'
  594. -+#UMOUNTCMD='./domount -u $MNTPOINT'
  595. -
  596. - # Use the next two lines if using:
  597. - #     SVR3
  598. - #     SVR4
  599. - #     Solaris 2.x
  600. - #     HPUX
  601. --DASHN=
  602. --BLC=\\c
  603. -+#DASHN=
  604. -+#BLC=\\c
  605. -
  606. - # Use the next two lines if using:
  607. - #     BSD
  608. -@@ -49,12 +49,12 @@ BLC=\\c
  609. - #     Linux
  610. - #     Tru64 UNIX
  611. - #     Mac OS X
  612. --#DASHN=-n
  613. --#BLC=
  614. -+DASHN=-n
  615. -+BLC=
  616. -
  617. - # Use this path for:
  618. - #     Solaris 2.x
  619. --PATH=/opt/SUNWspro/bin:/usr/ccs/bin:/sbin:/bin:/usr/bin:/usr/ucb:/etc:.
  620. -+#PATH=/opt/SUNWspro/bin:/usr/ccs/bin:/sbin:/bin:/usr/bin:/usr/ucb:/etc:.
  621. -
  622. - # Use this path for:
  623. - #     Solaris 2.x with GCC
  624. -@@ -73,7 +73,7 @@ PATH=/opt/SUNWspro/bin:/usr/ccs/bin:/sbin:/bin:/usr/bin:/usr/ucb:/etc:.
  625. - #     Tru64 UNIX
  626. - #     SVR4
  627. - #     Linux
  628. --#PATH=/bin:/usr/bin:/usr/ucb:/usr/ccs/bin:/sbin:/usr/sbin:.
  629. -+PATH=/bin:/usr/bin:/usr/ucb:/usr/ccs/bin:/sbin:/usr/sbin:.
  630. -
  631. - # Use this path for:
  632. - #     DG/UX
  633. -@@ -130,12 +130,12 @@ LOCKTESTS=tlock
  634. -
  635. - # Use with Solaris 2.x systems.  Need the 5.0 C compiler (or later)
  636. - # for 64-bit mode.
  637. --CC=/opt/SUNWspro/bin/cc
  638. -+#CC=/opt/SUNWspro/bin/cc
  639. - # Use this with GCC
  640. - #CC=/opt/gnu/bin/gcc
  641. - # Use this through Solaris 2.6.  For Solaris 2.7 and later, use
  642. - # this for 32-bit mode applications.
  643. --CFLAGS=`echo -DSVR4 -DMMAP -DSOLARIS2X -DSTDARG`
  644. -+#CFLAGS=`echo -DSVR4 -DMMAP -DSOLARIS2X -DSTDARG`
  645. - # Use this with gcc (32-bit binaries):
  646. - #CFLAGS=`echo -DSVR4 -DMMAP -DSOLARIS2X -DSTDARG -mcpu=ultrasparc`
  647. - # For Solaris 2.7 and later, use this for 64-bit mode applications
  648. -@@ -143,7 +143,7 @@ CFLAGS=`echo -DSVR4 -DMMAP -DSOLARIS2X -DSTDARG`
  649. - #CFLAGS=`echo -DSVR4 -DMMAP -DSOLARIS2X -DSTDARG -xO0 -xarch=v9 -dalign -Xt -L/usr/lib/sparcv9`
  650. - # Use this to make 64-bit binaries with gcc (3.1 or later; untested):
  651. - #CFLAGS=`echo -DSVR4 -DMMAP -DSOLARIS2X -DSTDARG -m64`
  652. --LIBS=`echo -lsocket -lnsl`
  653. -+#LIBS=`echo -lsocket -lnsl`
  654. - # Use this through Solaris 2.5.1.
  655. - #LOCKTESTS=`echo tlock`
  656. - # Use with 2.6 and later systems, 32-bit mode.
  657. -@@ -204,11 +204,11 @@ LOCKTESTS=`echo tlocklfs tlock64`
  658. - #UMOUNT=/bin/umount
  659. -
  660. - # Use with Linux 2.4 / GNU libc 2.2
  661. --#CFLAGS=`echo -DLINUX -DGLIBC=22 -DMMAP -DSTDARG -fwritable-strings`
  662. -+CFLAGS=`echo -DLINUX -DGLIBC=22 -DMMAP -DSTDARG -fwritable-strings`
  663. - #LIBS=`echo -lnsl`
  664. --#MOUNT=/bin/mount
  665. --#UMOUNT=/bin/umount
  666. --#LOCKTESTS=`echo tlocklfs tlock64`
  667. -+MOUNT=/bin/mount
  668. -+UMOUNT=/bin/umount
  669. -+LOCKTESTS=`echo tlocklfs tlock64`
  670. -
  671. - # Use with Linux if your distro doesn't provide a "cc".
  672. - #CC=gcc
  673. ---
  674. -1.6.4.msysgit.0
  675. -
  676. diff --git a/tests/cthon04/0001-tools-Cygwin-3.6-port.patch b/tests/cthon04/0001-tools-Cygwin-3.6-port.patch
  677. new file mode 100644
  678. index 0000000..df9def9
  679. --- /dev/null
  680. +++ b/tests/cthon04/0001-tools-Cygwin-3.6-port.patch
  681. @@ -0,0 +1,61 @@
  682. +From 9279c46b92c037dc3cb9f4472a773539e0eb977d Mon Sep 17 00:00:00 2001
  683. +From: Roland Mainz <roland.mainz@nrubsig.org>
  684. +Date: Tue, 18 Feb 2025 17:11:09 +0100
  685. +Subject: [PATCH 1/4] tools: Cygwin 3.6 port
  686. +
  687. +Cygwin 3.6 port
  688. +
  689. +Signed-off-by: Roland Mainz <roland.mainz@nrubsig.org>
  690. +---
  691. + tools/dirdmp.c | 6 +++---
  692. + tools/dirprt.c | 2 +-
  693. + 2 files changed, 4 insertions(+), 4 deletions(-)
  694. +
  695. +diff --git a/tools/dirdmp.c b/tools/dirdmp.c
  696. +index 6b231a0..e8dcca3 100644
  697. +--- a/tools/dirdmp.c
  698. ++++ b/tools/dirdmp.c
  699. +@@ -7,8 +7,8 @@
  700. +
  701. + #include <sys/param.h>
  702. + #include <sys/types.h>
  703. +-#include <dirent.h>
  704. + #include <sys/stat.h>
  705. ++#include <dirent.h>
  706. + #include <fcntl.h>
  707. + #include <stdio.h>
  708. + #include <stdlib.h>
  709. +@@ -38,7 +38,7 @@ main(argc, argv)
  710. +       int argc;
  711. +       char *argv[];
  712. + {
  713. +-#if defined(LINUX) || defined (AIX)
  714. ++#if defined(LINUX) || defined(__CYGWIN__) || defined (AIX)
  715. +       fprintf(stderr, "dirdmp is not supported on this platform.\n");
  716. +       exit(1);
  717. + #else
  718. +@@ -50,7 +50,7 @@ main(argc, argv)
  719. + #endif /* LINUX || AIX */
  720. + }
  721. +
  722. +-#if !(defined(LINUX) || defined(AIX))
  723. ++#if !(defined(LINUX) || defined(__CYGWIN__) || defined(AIX))
  724. +
  725. + static void
  726. + print(dir)
  727. +diff --git a/tools/dirprt.c b/tools/dirprt.c
  728. +index a0630eb..acb9ec3 100644
  729. +--- a/tools/dirprt.c
  730. ++++ b/tools/dirprt.c
  731. +@@ -72,7 +72,7 @@ print(dir)
  732. +               return;
  733. +       }
  734. +       while ((dp = readdir(dirp)) != NULL) {
  735. +-#if defined(SVR3) || defined(SVR4) || defined(LINUX)
  736. ++#if defined(SVR3) || defined(SVR4) || defined(LINUX) || defined(__CYGWIN__)
  737. +               printf("%5ld %5ld %5d %s\n", (long)telldir(dirp),
  738. +                      (long)dp->d_ino,
  739. +                      dp->d_reclen, dp->d_name);
  740. +--
  741. +2.45.1
  742. +
  743. diff --git a/tests/cthon04/0002-basic-Workaround-for-ms-nfs41-client-POSIX-symlink-t.patch b/tests/cthon04/0002-basic-Workaround-for-ms-nfs41-client-POSIX-symlink-t.patch
  744. new file mode 100644
  745. index 0000000..007c958
  746. --- /dev/null
  747. +++ b/tests/cthon04/0002-basic-Workaround-for-ms-nfs41-client-POSIX-symlink-t.patch
  748. @@ -0,0 +1,31 @@
  749. +From 8c4799d4f3bab10be067e1074bffe043147ba7b0 Mon Sep 17 00:00:00 2001
  750. +From: Roland Mainz <roland.mainz@nrubsig.org>
  751. +Date: Tue, 18 Feb 2025 17:12:30 +0100
  752. +Subject: [PATCH 2/4] basic: Workaround for ms-nfs41-client POSIX symlink to
  753. + WinNT symlink syntax limitation
  754. +
  755. +Workaround for ms-nfs41-client POSIX symlink to WinNT symlink syntax,
  756. +WinNT does not have the concept of a global root like UNIX/POSIX,
  757. +so a symlink target currently gets rejected
  758. +
  759. +Signed-off-by: Roland Mainz <roland.mainz@nrubsig.org>
  760. +---
  761. + basic/test8.c | 2 +-
  762. + 1 file changed, 1 insertion(+), 1 deletion(-)
  763. +
  764. +diff --git a/basic/test8.c b/basic/test8.c
  765. +index d65eb3a..f993631 100644
  766. +--- a/basic/test8.c
  767. ++++ b/basic/test8.c
  768. +@@ -43,7 +43,7 @@ static int Tflag = 0;        /* print timing */
  769. + static int Fflag = 0; /* test function only;  set count to 1, negate -t */
  770. + static int Nflag = 0; /* Suppress directory operations */
  771. +
  772. +-#define SNAME "/this/is/a/symlink"    /* symlink prefix */
  773. ++#define SNAME "/dev/this/is/a/symlink"        /* symlink prefix */
  774. +
  775. + static void
  776. + usage()
  777. +--
  778. +2.45.1
  779. +
  780. diff --git a/tests/cthon04/0002-cthon-fixing-tools-compilation.patch b/tests/cthon04/0002-cthon-fixing-tools-compilation.patch
  781. deleted file mode 100644
  782. index 3c3b43f..0000000
  783. --- a/tests/cthon04/0002-cthon-fixing-tools-compilation.patch
  784. +++ /dev/null
  785. @@ -1,51 +0,0 @@
  786. -From ea26a4a5e46428dae198d11c9e07c7ce0bbcee91 Mon Sep 17 00:00:00 2001
  787. -From: Casey Bodley <cbodley@citi.umich.edu>
  788. -Date: Mon, 11 Oct 2010 15:23:38 -0400
  789. -Subject: [PATCH 02/11] cthon: fixing tools compilation
  790. -
  791. ----
  792. - tools/Makefile |    4 ++--
  793. - tools/dirprt.c |    8 ++++----
  794. - 2 files changed, 6 insertions(+), 6 deletions(-)
  795. -
  796. -diff --git a/tools/Makefile b/tools/Makefile
  797. -index ce2cbc7..ce6019f 100644
  798. ---- a/tools/Makefile
  799. -+++ b/tools/Makefile
  800. -@@ -31,9 +31,9 @@ dirdmp: dirdmp.c
  801. - dirprt: dirprt.c
  802. -       $(CC) $(CFLAGS) -o $@ $@.c $(LIBS)
  803. - pmaptst: pmaptst.c
  804. --      $(CC) $(CFLAGS) -o $@ $@.c $(LIBS)
  805. -+      $(CC) $(CFLAGS) -o $@ $@.c $(LIBS) -lrpc
  806. - pmapbrd: pmapbrd.c
  807. --      $(CC) $(CFLAGS) -o $@ $@.c $(LIBS)
  808. -+      $(CC) $(CFLAGS) -o $@ $@.c $(LIBS) -lrpc
  809. -
  810. - lint:
  811. -       lint $(CFLAGS) tcp.c
  812. -diff --git a/tools/dirprt.c b/tools/dirprt.c
  813. -index a8b50ea..6f1f4ff 100644
  814. ---- a/tools/dirprt.c
  815. -+++ b/tools/dirprt.c
  816. -@@ -70,13 +70,13 @@ print(dir)
  817. -       }
  818. -       while ((dp = readdir(dirp)) != NULL) {
  819. - #if defined(SVR3) || defined(SVR4) || defined(LINUX)
  820. --              printf("%5ld %5ld %5d %s\n", (long)telldir(dirp),
  821. -+              printf("%5ld %5ld %s\n", (long)telldir(dirp),
  822. -                      (long)dp->d_ino,
  823. --                     dp->d_reclen, dp->d_name);
  824. -+                     dp->d_name);
  825. - #else
  826. --              printf("%5ld %5d %5d %5d %s\n", (long)telldir(dirp),
  827. -+              printf("%5ld %5d %5d %s\n", (long)telldir(dirp),
  828. -                      dp->d_fileno,
  829. --                     dp->d_reclen, dp->d_namlen, dp->d_name);
  830. -+                     dp->d_namlen, dp->d_name);
  831. - #endif
  832. -       }
  833. -       closedir(dirp);
  834. ---
  835. -1.6.4.msysgit.0
  836. -
  837. diff --git a/tests/cthon04/0003-cthon-fixing-locks-compilation-problem.patch b/tests/cthon04/0003-cthon-fixing-locks-compilation-problem.patch
  838. deleted file mode 100644
  839. index 434a36d..0000000
  840. --- a/tests/cthon04/0003-cthon-fixing-locks-compilation-problem.patch
  841. +++ /dev/null
  842. @@ -1,29 +0,0 @@
  843. -From 97bc9d6416c65d7f41c43847f99ace92ac78254c Mon Sep 17 00:00:00 2001
  844. -From: Casey Bodley <cbodley@citi.umich.edu>
  845. -Date: Mon, 11 Oct 2010 15:23:53 -0400
  846. -Subject: [PATCH 03/11] cthon: fixing locks compilation problem
  847. -
  848. ----
  849. - lock/tlock.c |    2 ++
  850. - 1 files changed, 2 insertions(+), 0 deletions(-)
  851. -
  852. -diff --git a/lock/tlock.c b/lock/tlock.c
  853. -index 8a7d0cc..fe8c760 100644
  854. ---- a/lock/tlock.c
  855. -+++ b/lock/tlock.c
  856. -@@ -75,10 +75,12 @@
  857. - #include <inttypes.h>
  858. -
  859. - #if defined(LARGE_LOCKS) && !defined(_LFS64_LARGEFILE) && !defined(MACOSX)
  860. -+/*
  861. - This machine cannot compile the 64 bit version of this test using the
  862. - LARGE_LOCKS symbol.
  863. - If your machine uses native 64-bit offsets, you should not define
  864. - LARGE_LOCKS.
  865. -+*/
  866. - #endif
  867. -
  868. - #ifndef HZ
  869. ---
  870. -1.6.4.msysgit.0
  871. -
  872. diff --git a/tests/cthon04/0003-lock-Fix-issue-with-tlock-path.patch b/tests/cthon04/0003-lock-Fix-issue-with-tlock-path.patch
  873. new file mode 100644
  874. index 0000000..45dd4ee
  875. --- /dev/null
  876. +++ b/tests/cthon04/0003-lock-Fix-issue-with-tlock-path.patch
  877. @@ -0,0 +1,28 @@
  878. +From fa34ebf1b4ea266129d05e79f3d594fd70752226 Mon Sep 17 00:00:00 2001
  879. +From: Roland Mainz <roland.mainz@nrubsig.org>
  880. +Date: Tue, 18 Feb 2025 17:15:21 +0100
  881. +Subject: [PATCH 3/4] lock: Fix issue with tlock path
  882. +
  883. +Fix issue with tlock path
  884. +
  885. +Signed-off-by: Roland Mainz <roland.mainz@nrubsig.org>
  886. +---
  887. + lock/runtests | 2 +-
  888. + 1 file changed, 1 insertion(+), 1 deletion(-)
  889. +
  890. +diff --git a/lock/runtests b/lock/runtests
  891. +index 21b09a5..4db16e2 100755
  892. +--- a/lock/runtests
  893. ++++ b/lock/runtests
  894. +@@ -64,7 +64,7 @@ do
  895. +                       ;;
  896. +       esac
  897. +       echo ""
  898. +-      $i $TESTARGS $NFSTESTDIR
  899. ++      ./$i $TESTARGS $NFSTESTDIR
  900. + done
  901. +
  902. + echo "Congratulations, you passed the locking tests!"
  903. +--
  904. +2.45.1
  905. +
  906. diff --git a/tests/cthon04/0004-cthon-removed-fwritable-strings-from-cflags.patch b/tests/cthon04/0004-cthon-removed-fwritable-strings-from-cflags.patch
  907. deleted file mode 100644
  908. index 19543f0..0000000
  909. --- a/tests/cthon04/0004-cthon-removed-fwritable-strings-from-cflags.patch
  910. +++ /dev/null
  911. @@ -1,26 +0,0 @@
  912. -From 8be0e35514ff0be2c0023065000ae80dbf312a8d Mon Sep 17 00:00:00 2001
  913. -From: Casey Bodley <cbodley@citi.umich.edu>
  914. -Date: Mon, 11 Oct 2010 15:24:10 -0400
  915. -Subject: [PATCH 04/11] cthon: removed -fwritable-strings from cflags
  916. -
  917. ----
  918. - tests.init |    3 ++-
  919. - 1 files changed, 2 insertions(+), 1 deletions(-)
  920. -
  921. -diff --git a/tests.init b/tests.init
  922. -index e55a4aa..3a1ba74 100644
  923. ---- a/tests.init
  924. -+++ b/tests.init
  925. -@@ -204,7 +204,8 @@ LOCKTESTS=`echo tlocklfs tlock64`
  926. - #UMOUNT=/bin/umount
  927. -
  928. - # Use with Linux 2.4 / GNU libc 2.2
  929. --CFLAGS=`echo -DLINUX -DGLIBC=22 -DMMAP -DSTDARG -fwritable-strings`
  930. -+#CFLAGS=`echo -DLINUX -DGLIBC=22 -DMMAP -DSTDARG -fwritable-strings`
  931. -+CFLAGS=`echo -DLINUX -DGLIBC=22 -DMMAP -DSTDARG`
  932. - #LIBS=`echo -lnsl`
  933. - MOUNT=/bin/mount
  934. - UMOUNT=/bin/umount
  935. ---
  936. -1.6.4.msysgit.0
  937. -
  938. diff --git a/tests/cthon04/0004-special-tools-HACK-Disable-tests-which-cannot-work-o.patch b/tests/cthon04/0004-special-tools-HACK-Disable-tests-which-cannot-work-o.patch
  939. new file mode 100644
  940. index 0000000..6664fa4
  941. --- /dev/null
  942. +++ b/tests/cthon04/0004-special-tools-HACK-Disable-tests-which-cannot-work-o.patch
  943. @@ -0,0 +1,60 @@
  944. +From 190b1032a6dad762fdd5d015320788aa8e259672 Mon Sep 17 00:00:00 2001
  945. +From: Roland Mainz <roland.mainz@nrubsig.org>
  946. +Date: Tue, 18 Feb 2025 17:17:39 +0100
  947. +Subject: [PATCH 4/4] special,tools: HACK: Disable tests which cannot work on
  948. + Cygwin/ms-nfs41-client
  949. +
  950. +HACK: Disable tests which cannot work on Cygwin/ms-nfs41-client
  951. +
  952. +Signed-off-by: Roland Mainz <roland.mainz@nrubsig.org>
  953. +---
  954. + special/Makefile     | 4 ++--
  955. + special/runtests.wrk | 2 +-
  956. + tools/Makefile       | 2 +-
  957. + 3 files changed, 4 insertions(+), 4 deletions(-)
  958. +
  959. +diff --git a/special/Makefile b/special/Makefile
  960. +index 77215c1..36f4978 100644
  961. +--- a/special/Makefile
  962. ++++ b/special/Makefile
  963. +@@ -3,9 +3,9 @@
  964. + #     1.4 Lachman ONC Test Suite source
  965. + #
  966. +
  967. +-TESTS=op_unlk op_ren op_chmod dupreq excltest negseek rename holey \
  968. ++TESTS=op_unlk op_chmod dupreq excltest negseek rename holey \
  969. +       truncate nfsidem nstat stat stat2 touchn fstat rewind \
  970. +-      telldir bigfile bigfile2 freesp
  971. ++      telldir bigfile bigfile2 freesp
  972. + DOSRUNFILES = scripts/*.bat
  973. + DOSBUILDFILES = console/*.bat console/*.mak dos/*.bat dos/*.mak
  974. + DOSFILES = $(DOSRUNFILES) $(DOSBUILDFILES)
  975. +diff --git a/special/runtests.wrk b/special/runtests.wrk
  976. +index 8f099fa..385ac61 100644
  977. +--- a/special/runtests.wrk
  978. ++++ b/special/runtests.wrk
  979. +@@ -29,7 +29,7 @@ if [ "$CIFS" = "yes" ] && echo $MNTOPTIONS | grep -E "vers=2|vers=3" > /dev/null
  980. + then
  981. +       echo "skipping test; not supported by SMB 2.0 and higher versions"
  982. + else
  983. +-      TMPDIR= ./op_ren
  984. ++      : # TMPDIR= ./op_ren
  985. + fi
  986. +
  987. + echo ""
  988. +diff --git a/tools/Makefile b/tools/Makefile
  989. +index ce2cbc7..8cc1903 100644
  990. +--- a/tools/Makefile
  991. ++++ b/tools/Makefile
  992. +@@ -8,7 +8,7 @@
  993. + # 'make copy DESTDIR=path'      copies test programs to path
  994. + # 'make dist DESTDIR=path'      copies sources to path
  995. +
  996. +-TESTS = tcp tcpd udp udpd dirdmp dirprt pmaptst pmapbrd
  997. ++TESTS = tcp tcpd udp udpd dirdmp dirprt
  998. +
  999. + # dirdmp apparently doesn't work with Linux 2.2.  So for Linux systems,
  1000. + # comment out the above definition and use this one.
  1001. +--
  1002. +2.45.1
  1003. +
  1004. diff --git a/tests/cthon04/0005-cthon-general-scripts-use-.exe-extension-dirent.h.patch b/tests/cthon04/0005-cthon-general-scripts-use-.exe-extension-dirent.h.patch
  1005. deleted file mode 100644
  1006. index eb69b45..0000000
  1007. --- a/tests/cthon04/0005-cthon-general-scripts-use-.exe-extension-dirent.h.patch
  1008. +++ /dev/null
  1009. @@ -1,169 +0,0 @@
  1010. -From c2e26900f6631eea3b5f7e09af30b68243339162 Mon Sep 17 00:00:00 2001
  1011. -From: Casey Bodley <cbodley@citi.umich.edu>
  1012. -Date: Mon, 11 Oct 2010 15:24:29 -0400
  1013. -Subject: [PATCH 05/11] cthon: general scripts use .exe extension, dirent.h
  1014. -
  1015. -large*.c files include <dirent.h> instead of <sys/dir.h>
  1016. ----
  1017. - general/large.c      |    8 ++++----
  1018. - general/large1.c     |    8 ++++----
  1019. - general/large2.c     |    8 ++++----
  1020. - general/large3.c     |    8 ++++----
  1021. - general/large4.sh    |    2 +-
  1022. - general/runtests.wrk |   14 +++++++-------
  1023. - 6 files changed, 24 insertions(+), 24 deletions(-)
  1024. -
  1025. -diff --git a/general/large.c b/general/large.c
  1026. -index 5dd2950..1ae2e85 100644
  1027. ---- a/general/large.c
  1028. -+++ b/general/large.c
  1029. -@@ -9,11 +9,11 @@
  1030. - #include <stdio.h>
  1031. - #include <ctype.h>
  1032. - #include <signal.h>
  1033. --#ifdef SVR4
  1034. -+//#ifdef SVR4
  1035. - #include <dirent.h>
  1036. --#else
  1037. --#include <sys/dir.h>
  1038. --#endif
  1039. -+//#else
  1040. -+//#include <sys/dir.h>
  1041. -+//#endif
  1042. -
  1043. - #undef  MAXNAMLEN
  1044. - #define MAXNAMLEN     256
  1045. -diff --git a/general/large1.c b/general/large1.c
  1046. -index 5dd2950..1ae2e85 100644
  1047. ---- a/general/large1.c
  1048. -+++ b/general/large1.c
  1049. -@@ -9,11 +9,11 @@
  1050. - #include <stdio.h>
  1051. - #include <ctype.h>
  1052. - #include <signal.h>
  1053. --#ifdef SVR4
  1054. -+//#ifdef SVR4
  1055. - #include <dirent.h>
  1056. --#else
  1057. --#include <sys/dir.h>
  1058. --#endif
  1059. -+//#else
  1060. -+//#include <sys/dir.h>
  1061. -+//#endif
  1062. -
  1063. - #undef  MAXNAMLEN
  1064. - #define MAXNAMLEN     256
  1065. -diff --git a/general/large2.c b/general/large2.c
  1066. -index 5dd2950..1ae2e85 100644
  1067. ---- a/general/large2.c
  1068. -+++ b/general/large2.c
  1069. -@@ -9,11 +9,11 @@
  1070. - #include <stdio.h>
  1071. - #include <ctype.h>
  1072. - #include <signal.h>
  1073. --#ifdef SVR4
  1074. -+//#ifdef SVR4
  1075. - #include <dirent.h>
  1076. --#else
  1077. --#include <sys/dir.h>
  1078. --#endif
  1079. -+//#else
  1080. -+//#include <sys/dir.h>
  1081. -+//#endif
  1082. -
  1083. - #undef  MAXNAMLEN
  1084. - #define MAXNAMLEN     256
  1085. -diff --git a/general/large3.c b/general/large3.c
  1086. -index 5dd2950..1ae2e85 100644
  1087. ---- a/general/large3.c
  1088. -+++ b/general/large3.c
  1089. -@@ -9,11 +9,11 @@
  1090. - #include <stdio.h>
  1091. - #include <ctype.h>
  1092. - #include <signal.h>
  1093. --#ifdef SVR4
  1094. -+//#ifdef SVR4
  1095. - #include <dirent.h>
  1096. --#else
  1097. --#include <sys/dir.h>
  1098. --#endif
  1099. -+//#else
  1100. -+//#include <sys/dir.h>
  1101. -+//#endif
  1102. -
  1103. - #undef  MAXNAMLEN
  1104. - #define MAXNAMLEN     256
  1105. -diff --git a/general/large4.sh b/general/large4.sh
  1106. -index 7c3117f..954a23f 100644
  1107. ---- a/general/large4.sh
  1108. -+++ b/general/large4.sh
  1109. -@@ -10,4 +10,4 @@ $CC $CFLAGS -o large1 large1.c&
  1110. - $CC $CFLAGS -o large2 large2.c&
  1111. - $CC $CFLAGS -o large3 large3.c&
  1112. - wait
  1113. --rm large large1 large2 large3
  1114. -+rm large.exe large1.exe large2.exe large3.exe
  1115. -diff --git a/general/runtests.wrk b/general/runtests.wrk
  1116. -index 5efc091..83f3124 100644
  1117. ---- a/general/runtests.wrk
  1118. -+++ b/general/runtests.wrk
  1119. -@@ -60,7 +60,7 @@ $TIME $CC $CFLAGS -o stat stat.c -lm 2>> smcomp.time || eval $errexit
  1120. - $TIME $CC $CFLAGS -o stat stat.c -lm 2>> smcomp.time || eval $errexit
  1121. - $TIME $CC $CFLAGS -o stat stat.c -lm 2>> smcomp.time || eval $errexit
  1122. - set -e
  1123. --./stat smcomp.time
  1124. -+./stat.exe smcomp.time
  1125. - set +e
  1126. -
  1127. - echo ""
  1128. -@@ -76,7 +76,7 @@ set -e
  1129. - # versions of tbl.
  1130. - egrep -v '^tbl:.*$' <tbl.time >tbl.new
  1131. - mv -f tbl.new tbl.time
  1132. --./stat tbl.time
  1133. -+./stat.exe tbl.time
  1134. - set +e
  1135. -
  1136. - echo ""
  1137. -@@ -89,7 +89,7 @@ $TIME nroff < nroff.tbl > nroff.out 2>> nroff.time || cat nroff.time
  1138. - $TIME nroff < nroff.tbl > nroff.out 2>> nroff.time || cat nroff.time
  1139. - rm nroff.out nroff.tbl
  1140. - set -e
  1141. --./stat nroff.time
  1142. -+./stat.exe nroff.time
  1143. - set +e
  1144. -
  1145. - echo ""
  1146. -@@ -101,9 +101,9 @@ $TIME $CC $CFLAGS -o large large.c 2>> lrgcomp.time || eval $errexit
  1147. - $TIME $CC $CFLAGS -o large large.c 2>> lrgcomp.time || eval $errexit
  1148. - $TIME $CC $CFLAGS -o large large.c 2>> lrgcomp.time || eval $errexit
  1149. - $TIME $CC $CFLAGS -o large large.c 2>> lrgcomp.time || eval $errexit
  1150. --rm large
  1151. -+rm large.exe
  1152. - set -e
  1153. --./stat lrgcomp.time
  1154. -+./stat.exe lrgcomp.time
  1155. - set +e
  1156. -
  1157. - echo ""
  1158. -@@ -116,7 +116,7 @@ $TIME ./large4.sh 2>> 4lrg.time || eval $errexit
  1159. - $TIME ./large4.sh 2>> 4lrg.time || eval $errexit
  1160. - $TIME ./large4.sh 2>> 4lrg.time || eval $errexit
  1161. - set -e
  1162. --./stat 4lrg.time
  1163. -+./stat.exe 4lrg.time
  1164. - set +e
  1165. -
  1166. - echo ""
  1167. -@@ -134,7 +134,7 @@ rmdummy
  1168. - grep -iv warning: makefile.time | grep -v 'make: ' > makefile.time2
  1169. - mv makefile.time2 makefile.time
  1170. - set -e
  1171. --./stat makefile.time
  1172. -+./stat.exe makefile.time
  1173. - set +e
  1174. -
  1175. - echo ""
  1176. ---
  1177. -1.6.4.msysgit.0
  1178. -
  1179. diff --git a/tests/cthon04/0006-cthon-fixing-op_unlk-op_ren.patch b/tests/cthon04/0006-cthon-fixing-op_unlk-op_ren.patch
  1180. deleted file mode 100644
  1181. index 9e5f073..0000000
  1182. --- a/tests/cthon04/0006-cthon-fixing-op_unlk-op_ren.patch
  1183. +++ /dev/null
  1184. @@ -1,72 +0,0 @@
  1185. -From c640dc4eff98fe70732d0225d7b3f3e2b2e33e35 Mon Sep 17 00:00:00 2001
  1186. -From: Casey Bodley <cbodley@citi.umich.edu>
  1187. -Date: Mon, 11 Oct 2010 15:24:54 -0400
  1188. -Subject: [PATCH 06/11] cthon: fixing op_unlk op_ren
  1189. -
  1190. -fixing "ls" commands that unsuccessfully look for ".nfsXXXX" files instead of "nfsXXXX" files
  1191. ----
  1192. - special/op_ren.c  |    6 +++---
  1193. - special/op_unlk.c |    6 +++---
  1194. - 2 files changed, 6 insertions(+), 6 deletions(-)
  1195. -
  1196. -diff --git a/special/op_ren.c b/special/op_ren.c
  1197. -index 348b4f9..73fa409 100644
  1198. ---- a/special/op_ren.c
  1199. -+++ b/special/op_ren.c
  1200. -@@ -120,13 +120,13 @@ main(argc, argv)
  1201. - #endif /* O_RDWR */
  1202. -
  1203. -       printf("nfsjunk files before rename:\n  ");
  1204. --      system("ls -al .nfs*");
  1205. -+      system("ls -al nfs*");
  1206. -       ret = rename(taname, tbname);
  1207. -       printf("%s open; rename ret = %d\n", tbname, ret);
  1208. -       if (ret)
  1209. -               xxit(" unlink");
  1210. -       printf("nfsjunk files after rename:\n  ");
  1211. --      system("ls -al .nfs*");
  1212. -+      system("ls -al nfs*");
  1213. -       strcpy(wbuf, TMSG);
  1214. -       if ((ret = write(fd, wbuf, TBUFSIZ)) != TBUFSIZ) {
  1215. -               fprintf(stderr, "write ret %d; expected %d\n", ret, TBUFSIZ);
  1216. -@@ -165,7 +165,7 @@ main(argc, argv)
  1217. -       }
  1218. -
  1219. -       printf("nfsjunk files after close:\n  ");
  1220. --      system("ls -al .nfs*");
  1221. -+      system("ls -al nfs*");
  1222. -
  1223. -       if ((ret = close(fd)) == 0) {
  1224. -               errcount++;
  1225. -diff --git a/special/op_unlk.c b/special/op_unlk.c
  1226. -index 93a09b0..d5e5efc 100644
  1227. ---- a/special/op_unlk.c
  1228. -+++ b/special/op_unlk.c
  1229. -@@ -78,13 +78,13 @@ main(argc, argv)
  1230. - #ifndef WIN32
  1231. -       /* For WIN you can not delete the file if it is open */
  1232. -       printf("nfsjunk files before unlink:\n  ");
  1233. --      system("ls -al .nfs*");
  1234. -+      system("ls -al nfs*");
  1235. -       ret = unlink(tname);
  1236. -       printf("%s open; unlink ret = %d\n", tname, ret);
  1237. -       if (ret)
  1238. -               xxit(" unlink");
  1239. -       printf("nfsjunk files after unlink:\n  ");
  1240. --      system("ls -al .nfs*");
  1241. -+      system("ls -al nfs*");
  1242. - #endif
  1243. -       strcpy(wbuf, TMSG);
  1244. -       if ((ret = write(fd, wbuf, TBUFSIZ)) != TBUFSIZ) {
  1245. -@@ -137,7 +137,7 @@ main(argc, argv)
  1246. -
  1247. - #ifndef WIN32
  1248. -       printf("nfsjunk files after close:\n  ");
  1249. --      system("ls -al .nfs*");
  1250. -+      system("ls -al nfs*");
  1251. - #endif
  1252. -
  1253. -       if ((ret = close(fd)) == 0) {
  1254. ---
  1255. -1.6.4.msysgit.0
  1256. -
  1257. diff --git a/tests/cthon04/0007-cthon-porting-lock-tests-to-win32-api.patch b/tests/cthon04/0007-cthon-porting-lock-tests-to-win32-api.patch
  1258. deleted file mode 100644
  1259. index 766b084..0000000
  1260. --- a/tests/cthon04/0007-cthon-porting-lock-tests-to-win32-api.patch
  1261. +++ /dev/null
  1262. @@ -1,577 +0,0 @@
  1263. -From 8a73c727370c3062ff06f9203efbcc81ad37497e Mon Sep 17 00:00:00 2001
  1264. -From: Casey Bodley <cbodley@citi.umich.edu>
  1265. -Date: Mon, 11 Oct 2010 15:25:16 -0400
  1266. -Subject: [PATCH 07/11] cthon: porting lock tests to win32 api
  1267. -
  1268. -added '#ifdef _WIN32' blocks to implement the following changes:
  1269. -
  1270. -int testfd -> HANDLE testfd
  1271. -open() -> CreateFile()
  1272. -close() -> CloseHandle()
  1273. -unlink() -> DeleteFile()
  1274. -write() -> WriteFile()
  1275. -read() -> ReadFile()
  1276. -ftruncate() -> SetFilePointer()+SetEndOfFile()
  1277. -mmap() -> CreateFileMapping()+MapViewOfFile()
  1278. -munmap() -> UnmapViewOfFile()+CloseHandle()
  1279. -lockf(F_LOCK) -> LockFileEx()
  1280. -lockf(F_TLOCK) -> LockFile()
  1281. -lockf(F_ULOCK) -> UnlockFileEx()
  1282. -lockf(F_TEST) -> LockFile()+UnlockFileEx()
  1283. -
  1284. -some tests expect an overflow error when the lock range wraps, but win32 allows this.  changed the expected errors for checks in _WIN32
  1285. -
  1286. -skipping test8, which times 1000 consecutive calls to lock/unlock. this doesn't tell us anything, except that we're slow
  1287. -
  1288. -skipping test10 which checks for splitting lock regions; in windows, the unlock range must match lock range exactly
  1289. -
  1290. -for test11, the _WIN32 path reopens the file instead of using dup()/dup2(); the windows DuplicateHandle() function works differently, in that both copies of the handle must be closed before it releases its locks
  1291. -
  1292. -for test12, it forks an extra 'subchild' process, takes a lock, then kills the process to make sure it releases the lock.  had to move the open call from the child block into the subchild block for this to work; otherwise, the lock wouldn't release because the child still holds a handle
  1293. ----
  1294. - lock/tlock.c |  273 +++++++++++++++++++++++++++++++++++++++++++++++++++++-----
  1295. - 1 files changed, 251 insertions(+), 22 deletions(-)
  1296. -
  1297. -diff --git a/lock/tlock.c b/lock/tlock.c
  1298. -index fe8c760..dac3519 100644
  1299. ---- a/lock/tlock.c
  1300. -+++ b/lock/tlock.c
  1301. -@@ -54,6 +54,12 @@
  1302. - #endif
  1303. - #endif
  1304. -
  1305. -+#define _WIN32
  1306. -+
  1307. -+#ifdef _WIN32
  1308. -+# include <Windows.h>
  1309. -+#endif
  1310. -+
  1311. - #include <stdio.h>
  1312. - #include <stdlib.h>
  1313. - #include <signal.h>
  1314. -@@ -135,8 +141,16 @@ static int pidpipe[2];
  1315. -
  1316. - static char testfile[256];    /* file for locking test */
  1317. - static char *filepath = ".";
  1318. -+#ifdef _WIN32
  1319. -+static HANDLE testfd;
  1320. -+#else
  1321. - static int testfd;
  1322. -+#endif
  1323. -+
  1324. - #ifdef MMAP
  1325. -+#ifdef _WIN32
  1326. -+static HANDLE mappinghandle;
  1327. -+#endif
  1328. - static caddr_t mappedaddr;    /* address file is mapped to (some tests) */
  1329. - static off_t mappedlen;
  1330. - #endif
  1331. -@@ -586,12 +600,21 @@ open_testfile(flags, modes)
  1332. -       int flags;
  1333. -       int modes;
  1334. - {
  1335. --
  1336. -+#ifdef _WIN32
  1337. -+    testfd = CreateFile(testfile, GENERIC_READ | GENERIC_WRITE,
  1338. -+        FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_ALWAYS,
  1339. -+        FILE_ATTRIBUTE_NORMAL, NULL);
  1340. -+    if (testfd == INVALID_HANDLE_VALUE) {
  1341. -+        fprintf(stderr, "CreateFile(%s) returned %d\n", testfile, GetLastError());
  1342. -+        testexit(1);
  1343. -+    }
  1344. -+#else
  1345. -       testfd = open(testfile, flags, modes);
  1346. -       if (testfd < 0) {
  1347. -               perror("tlock: open");
  1348. -               testexit(1);
  1349. -       }
  1350. -+#endif
  1351. - }
  1352. -
  1353. - static void
  1354. -@@ -599,11 +622,17 @@ close_testfile(cleanup)
  1355. -       int cleanup;
  1356. - {
  1357. -
  1358. --      if (cleanup == JUST_CLOSE)
  1359. --              comment("Closed testfile.");
  1360. -+    if (cleanup == JUST_CLOSE)
  1361. -+        comment("Closed testfile.");
  1362. -+#ifdef _WIN32
  1363. -+    CloseHandle(testfd);
  1364. -+    if (cleanup == DO_UNLINK)
  1365. -+        DeleteFile(testfile);
  1366. -+#else
  1367. -       close(testfd);
  1368. -       if (cleanup == DO_UNLINK)
  1369. -               (void) unlink(testfile);
  1370. -+#endif
  1371. - }
  1372. -
  1373. - static void
  1374. -@@ -615,12 +644,28 @@ write_testfile(datap, offset, count, do_comment)
  1375. - {
  1376. -       int result;
  1377. -
  1378. -+#ifdef _WIN32
  1379. -+    {
  1380. -+        DWORD bytes = 0;
  1381. -+        LARGE_INTEGER off = { offset };
  1382. -+        OVERLAPPED overlapped = { 0 };
  1383. -+        overlapped.Offset = off.LowPart;
  1384. -+        overlapped.OffsetHigh = off.HighPart;
  1385. -+
  1386. -+        if (!WriteFile(testfd, datap, count, &bytes, &overlapped)) {
  1387. -+            fprintf(stderr, "WriteFile() failed with %d\n", GetLastError());
  1388. -+            testexit(1);
  1389. -+        }
  1390. -+        result = bytes;
  1391. -+    }
  1392. -+#else
  1393. -       (void) lseek(testfd, offset, 0);
  1394. -       result = write(testfd, datap, count);
  1395. -       if (result < 0) {
  1396. -               perror("tlock: testfile write");
  1397. -               testexit(1);
  1398. -       }
  1399. -+#endif
  1400. -       if (result != count) {
  1401. -               fprintf(stderr, "tlock: short write (got %d, expected %d)\n",
  1402. -                       result, count);
  1403. -@@ -663,6 +708,21 @@ read_testfile(test, sec, datap, offset, count, pass, fail)
  1404. -               exit(1);
  1405. -       }
  1406. -
  1407. -+#ifdef _WIN32
  1408. -+    {
  1409. -+        DWORD bytes = 0;
  1410. -+        LARGE_INTEGER off = { offset };
  1411. -+        OVERLAPPED overlapped = { 0 };
  1412. -+        overlapped.Offset = off.LowPart;
  1413. -+        overlapped.OffsetHigh = off.HighPart;
  1414. -+
  1415. -+        if (!ReadFile(testfd, array, count, &bytes, &overlapped)) {
  1416. -+            fprintf(stderr, "ReadFile() failed with %d\n", GetLastError());
  1417. -+            testexit(1);
  1418. -+        }
  1419. -+        result = bytes;
  1420. -+    }
  1421. -+#else
  1422. -       (void) lseek(testfd, offset, 0);
  1423. -       if (count > IORATE_BUFSIZE)
  1424. -               count = IORATE_BUFSIZE;
  1425. -@@ -671,6 +731,7 @@ read_testfile(test, sec, datap, offset, count, pass, fail)
  1426. -               perror("tlock: testfile read");
  1427. -               testexit(1);
  1428. -       }
  1429. -+#endif
  1430. -       if (result != count) {
  1431. -               fprintf(stderr, "tlock: short read (got %d, expected %d)\n",
  1432. -                       result, count);
  1433. -@@ -703,7 +764,6 @@ testdup2(fd1, fd2)
  1434. -       int fd1;
  1435. -       int fd2;
  1436. - {
  1437. --
  1438. -       if (dup2(fd1, fd2) < 0) {
  1439. -               perror("tlock: dup2");
  1440. -               testexit(1);
  1441. -@@ -713,12 +773,22 @@ testdup2(fd1, fd2)
  1442. - static void
  1443. - testtruncate()
  1444. - {
  1445. --
  1446. --      comment("Truncated testfile.");
  1447. -+    comment("Truncated testfile.");
  1448. -+#ifdef _WIN32
  1449. -+    if (SetFilePointer(testfd, 0, 0, FILE_BEGIN) == INVALID_SET_FILE_POINTER) {
  1450. -+        fprintf(stderr, "SetFilePointer() failed with %d\n", GetLastError());
  1451. -+        testexit(1);
  1452. -+    }
  1453. -+    if (!SetEndOfFile(testfd)) {
  1454. -+        fprintf(stderr, "SetEndOfFile() failed with %d\n", GetLastError());
  1455. -+        testexit(1);
  1456. -+    }
  1457. -+#else
  1458. -       if (ftruncate(testfd, (off_t)0) < 0) {
  1459. -               perror("tlock: ftruncate");
  1460. -               testexit(1);
  1461. -       }
  1462. -+#endif
  1463. - }
  1464. -
  1465. - #ifdef MMAP
  1466. -@@ -735,25 +805,120 @@ testtruncate()
  1467. - static int
  1468. - testmmap()
  1469. - {
  1470. -+#ifdef _WIN32
  1471. -+    LARGE_INTEGER len = { mappedlen };
  1472. -+
  1473. -+    mappinghandle = CreateFileMapping(testfd, NULL,
  1474. -+        PAGE_READWRITE, len.HighPart, len.LowPart, NULL);
  1475. -+    if (mappinghandle == INVALID_HANDLE_VALUE)
  1476. -+        return GetLastError();
  1477. -+
  1478. -+    mappedaddr = MapViewOfFile(mappinghandle, FILE_MAP_READ | FILE_MAP_WRITE,
  1479. -+        0, 0, len.QuadPart);
  1480. -+    if (mappedaddr == NULL)
  1481. -+        return GetLastError();
  1482. -+#else
  1483. -       mappedaddr = mmap(0, mappedlen, PROT_READ | PROT_WRITE, MAP_SHARED,
  1484. -                       testfd, (off_t)0);
  1485. -       if (mappedaddr == (caddr_t)MAP_FAILED)
  1486. -               return (errno);
  1487. -+#endif
  1488. -       return (0);
  1489. - }
  1490. -
  1491. - static void
  1492. - testmunmap()
  1493. - {
  1494. --      comment("unmap testfile.");
  1495. -+    comment("unmap testfile.");
  1496. -+#ifdef _WIN32
  1497. -+    if (!UnmapViewOfFile(mappedaddr)) {
  1498. -+        fprintf(stderr, "UnmapViewOfFile() failed with %d\n", GetLastError());
  1499. -+        testexit(1);
  1500. -+    }
  1501. -+    CloseHandle(mappinghandle);
  1502. -+#else
  1503. -       if (munmap(mappedaddr, mappedlen) < 0) {
  1504. -               perror("Can't unmap testfile.");
  1505. -               testexit(1);
  1506. -       }
  1507. -+#endif
  1508. -       mappedaddr = (caddr_t)0xdeadbeef;
  1509. - }
  1510. - #endif /* MMAP */
  1511. -
  1512. -+#ifdef _WIN32
  1513. -+
  1514. -+static int map_lock_error(int num, int sec, int status) {
  1515. -+    switch (status) {
  1516. -+    case NO_ERROR: return 0;
  1517. -+    case ERROR_NOT_LOCKED:
  1518. -+    case ERROR_LOCK_VIOLATION: return denied_err;
  1519. -+    default:
  1520. -+        comment("%d.%d unexpected windows error %d", num, sec, status);
  1521. -+        testexit(1);
  1522. -+    }
  1523. -+}
  1524. -+
  1525. -+static void
  1526. -+test(num, sec, func, offset, length, pass, fail)
  1527. -+int num;                      /* test number */
  1528. -+int sec;                      /* section number */
  1529. -+int func;                     /* lockf function to invoke */
  1530. -+off_t offset;                 /* starting offset of lock */
  1531. -+off_t length;                 /* length of lock */
  1532. -+int pass;                     /* expected return code */
  1533. -+int fail;                     /* error vs warning */
  1534. -+{
  1535. -+    int result = PASS;
  1536. -+    LARGE_INTEGER off = { offset };
  1537. -+    LARGE_INTEGER len = { length };
  1538. -+    OVERLAPPED overlapped = { 0 };
  1539. -+    overlapped.Offset = off.LowPart;
  1540. -+    overlapped.OffsetHigh = off.HighPart;
  1541. -+
  1542. -+    if (off.QuadPart + len.QuadPart < 0) {
  1543. -+        result = EINVAL;
  1544. -+        goto out;
  1545. -+    }
  1546. -+    if (length == 0)
  1547. -+        len.QuadPart = ULLONG_MAX - offset;
  1548. -+    if (len.QuadPart == 0) {
  1549. -+        result = EINVAL;
  1550. -+        goto out;
  1551. -+    }
  1552. -+
  1553. -+    switch (func) {
  1554. -+    case F_LOCK: /* blocking lock */
  1555. -+        if (!LockFileEx(testfd, LOCKFILE_EXCLUSIVE_LOCK,
  1556. -+            0, len.LowPart, len.HighPart, &overlapped))
  1557. -+            result = map_lock_error(num, sec, GetLastError());
  1558. -+        break;
  1559. -+
  1560. -+    case F_TLOCK: /* non-blocking lock */
  1561. -+        if (!LockFile(testfd, off.LowPart, off.HighPart, len.LowPart, len.HighPart))
  1562. -+            result = map_lock_error(num, sec, GetLastError());
  1563. -+        break;
  1564. -+
  1565. -+    case F_ULOCK:
  1566. -+        if (!UnlockFileEx(testfd, 0, len.LowPart, len.HighPart, &overlapped))
  1567. -+            result = map_lock_error(num, sec, GetLastError());
  1568. -+        break;
  1569. -+
  1570. -+    case F_TEST:
  1571. -+        if (!LockFile(testfd, off.LowPart, off.HighPart, len.LowPart, len.HighPart)) {
  1572. -+            result = map_lock_error(num, sec, GetLastError());
  1573. -+        } else if (!UnlockFileEx(testfd, 0, len.LowPart, len.HighPart, &overlapped)) {
  1574. -+            fprintf(stderr, "UnlockFileEx() returned %d\n", GetLastError());
  1575. -+            testexit(1);
  1576. -+        }
  1577. -+        break;
  1578. -+    }
  1579. -+out:
  1580. -+    report(num, sec, tfunstr(func), offset, length, pass, result, fail);
  1581. -+}
  1582. -+
  1583. -+#else /* !_WIN32 */
  1584. -+
  1585. - #ifdef USE_LOCKF
  1586. -
  1587. - static void
  1588. -@@ -854,11 +1019,16 @@ test(num, sec, func, offset, length, pass, fail)
  1589. - }
  1590. -
  1591. - #endif /* USE_LOCKF */
  1592. -+#endif /* !_WIN32 */
  1593. -
  1594. - static void
  1595. - rate(cnt)
  1596. -       int cnt;
  1597. - {
  1598. -+#ifdef _WIN32
  1599. -+    LARGE_INTEGER len = { 1 };
  1600. -+    OVERLAPPED overlapped = { 0 };
  1601. -+#endif
  1602. -       int i;
  1603. -       long beg;
  1604. -       long end;
  1605. -@@ -867,9 +1037,17 @@ rate(cnt)
  1606. -
  1607. -       beg = times(&tms);
  1608. -       for (i = 0; i < cnt; i++) {
  1609. -+#ifdef _WIN32
  1610. -+        if (!LockFileEx(testfd, LOCKFILE_EXCLUSIVE_LOCK, 0,
  1611. -+                len.LowPart, len.HighPart, &overlapped) ||
  1612. -+            !UnlockFileEx(testfd, 0, len.LowPart,
  1613. -+                len.HighPart, &overlapped)) {
  1614. -+                      fprintf(stderr, "tlock: rate error=%d.\n", GetLastError());
  1615. -+#else
  1616. -               if ((lockf(testfd, F_LOCK, 1) != 0) ||
  1617. -                   (lockf(testfd, F_ULOCK, 1) != 0)) {
  1618. -                       fprintf(stderr, "tlock: rate error=%d.\n", errno);
  1619. -+#endif
  1620. -                       tstfail++;
  1621. -                       break;
  1622. -               }
  1623. -@@ -972,8 +1150,11 @@ test1()
  1624. -                * integer, no overflow).  So treat those failures as
  1625. -                * warnings, not fatal.
  1626. -                */
  1627. --              test(1, 9, F_TEST, maxeof, maxeof, oflow_err,
  1628. --                      WARN);
  1629. -+#ifdef _WIN32
  1630. -+              test(1, 9, F_TEST, maxeof, maxeof, PASS, FATAL);
  1631. -+#else
  1632. -+        test(1, 9, F_TEST, maxeof, maxeof, oflow_err, WARN);
  1633. -+#endif
  1634. -               close_testfile(DO_UNLINK);
  1635. -               childfree(0);
  1636. -       } else {
  1637. -@@ -1006,10 +1187,12 @@ test2()
  1638. -               test(2, 5, F_TEST, (off_t)1, (off_t)END, denied_err, FATAL);
  1639. -               test(2, 6, F_TEST, (off_t)1, maxeof, denied_err, FATAL);
  1640. -               test(2, 7, F_TEST, maxeof, (off_t)1, denied_err, FATAL);
  1641. --              test(2, 8, F_TEST, maxeof, (off_t)END, denied_err,
  1642. --                  FATAL);
  1643. --              test(2, 9, F_TEST, maxeof, maxeof, oflow_err,
  1644. --                      WARN);
  1645. -+              test(2, 8, F_TEST, maxeof, (off_t)END, denied_err, FATAL);
  1646. -+#ifdef _WIN32
  1647. -+        test(2, 9, F_TEST, maxeof, maxeof, denied_err, FATAL);
  1648. -+#else
  1649. -+              test(2, 9, F_TEST, maxeof, maxeof, oflow_err, WARN);
  1650. -+#endif
  1651. -               close_testfile(DO_UNLINK);
  1652. -               parentfree(0);
  1653. -       }
  1654. -@@ -1135,8 +1318,12 @@ test6()
  1655. -                   FATAL);
  1656. -               test(6, 3, F_TEST, maxeof - 1, (off_t)END,
  1657. -                   denied_err, FATAL);
  1658. --              test(6, 4, F_TEST, maxeof, (off_t)1, denied_err, FATAL);
  1659. -+        test(6, 4, F_TEST, maxeof, (off_t)1, denied_err, FATAL);
  1660. -+#ifdef _WIN32
  1661. -+        test(6, 5, F_TEST, maxeof, (off_t)2, denied_err, FATAL);
  1662. -+#else
  1663. -               test(6, 5, F_TEST, maxeof, (off_t)2, oflow_err, WARN);
  1664. -+#endif
  1665. -               test(6, 6, F_TEST, maxeof, (off_t)END, denied_err,
  1666. -                   FATAL);
  1667. -               test(6, 7, F_TEST, (off_t)maxplus1, (off_t)END, EINVAL,
  1668. -@@ -1320,7 +1507,9 @@ test10()
  1669. - static void
  1670. - test11()
  1671. - {
  1672. -+#ifndef _WIN32
  1673. -       int dupfd;
  1674. -+#endif
  1675. -       char *data = "123456789abcdef";
  1676. -       int datalen;
  1677. -
  1678. -@@ -1330,28 +1519,42 @@ test11()
  1679. -               parentwait();
  1680. -               header(11, "Make sure close() releases the process's locks.");
  1681. -               open_testfile(OPENFLAGS, OPENMODES);
  1682. -+#ifndef _WIN32
  1683. -               dupfd = dup(testfd);
  1684. -+#endif
  1685. -               test(11, 0, F_TLOCK, (off_t)0, (off_t)0, PASS, FATAL);
  1686. -               close_testfile(JUST_CLOSE);
  1687. -               childfree(0);
  1688. -
  1689. --              parentwait();
  1690. --              testdup2(dupfd, testfd);
  1691. -+        parentwait();
  1692. -+#ifdef _WIN32
  1693. -+        open_testfile(OPENFLAGS, OPENMODES);
  1694. -+#else
  1695. -+        testdup2(dupfd, testfd);
  1696. -+#endif
  1697. -               test(11, 3, F_TLOCK, (off_t)29, (off_t)1463, PASS, FATAL);
  1698. -               test(11, 4, F_TLOCK, (off_t)0x2000, (off_t)87, PASS, FATAL);
  1699. -               close_testfile(JUST_CLOSE);
  1700. -               childfree(0);
  1701. -
  1702. --              parentwait();
  1703. --              testdup2(dupfd, testfd);
  1704. -+        parentwait();
  1705. -+#ifdef _WIN32
  1706. -+        open_testfile(OPENFLAGS, OPENMODES);
  1707. -+#else
  1708. -+        testdup2(dupfd, testfd);
  1709. -+#endif
  1710. -               write_testfile(data, (off_t)0, datalen, COMMENT);
  1711. -               test(11, 7, F_TLOCK, (off_t)0, (off_t)0, PASS, FATAL);
  1712. -               write_testfile(data, (off_t)(datalen - 3), datalen, COMMENT);
  1713. -               close_testfile(JUST_CLOSE);
  1714. -               childfree(0);
  1715. -
  1716. --              parentwait();
  1717. -+        parentwait();
  1718. -+#ifdef _WIN32
  1719. -+        open_testfile(OPENFLAGS, OPENMODES);
  1720. -+#else
  1721. -               testdup2(dupfd, testfd);
  1722. -+#endif
  1723. -               write_testfile(data, (off_t)0, datalen, COMMENT);
  1724. -               test(11, 10, F_TLOCK, (off_t)0, (off_t)0, PASS, FATAL);
  1725. -               testtruncate();
  1726. -@@ -1359,7 +1562,9 @@ test11()
  1727. -               childfree(0);
  1728. -
  1729. -               parentwait();
  1730. -+#ifndef _WIN32
  1731. -               close(dupfd);
  1732. -+#endif
  1733. -               close_testfile(DO_UNLINK);
  1734. -       } else {
  1735. -               parentfree(0);
  1736. -@@ -1400,8 +1605,10 @@ test12()
  1737. -               open_testfile(OPENFLAGS, OPENMODES);
  1738. -               childfree(0);
  1739. -
  1740. --              parentwait();
  1741. -+        parentwait();
  1742. -+#ifndef _WIN32
  1743. -               (void) lseek(testfd, (off_t)0, 0);
  1744. -+#endif
  1745. -               if (read(pidpipe[0], &target, sizeof (target)) !=
  1746. -                   sizeof (target)) {
  1747. -                       perror("can't read pid to kill");
  1748. -@@ -1420,7 +1627,9 @@ test12()
  1749. -
  1750. -               parentfree(0);
  1751. -               childwait();
  1752. -+#ifndef _WIN32
  1753. -               open_testfile(OPENFLAGS, OPENMODES);
  1754. -+#endif
  1755. -               /*
  1756. -                * Create a subprocess to obtain a lock and get killed.  If
  1757. -                * the parent kills the regular child, tlock will stop
  1758. -@@ -1440,7 +1649,9 @@ test12()
  1759. -               if (subchild > 0) {
  1760. -                       /* original child */
  1761. -                       sleep(wait_time);
  1762. -+#ifndef _WIN32
  1763. -                       (void) lseek(testfd, (off_t)0, 0);
  1764. -+#endif
  1765. -                       if (write(pidpipe[1], &subchild, sizeof (subchild)) !=
  1766. -                           sizeof (subchild)) {
  1767. -                               perror("can't record pid to kill");
  1768. -@@ -1449,11 +1660,16 @@ test12()
  1769. -                       }
  1770. -                       parentfree(0);
  1771. -                       childwait();
  1772. -+#ifndef _WIN32
  1773. -                       close_testfile(DO_UNLINK);
  1774. -+#endif
  1775. -               } else {
  1776. -                       /* subchild */
  1777. -+#ifdef _WIN32
  1778. -+            open_testfile(OPENFLAGS, OPENMODES);
  1779. -+#endif
  1780. -                       signal(SIGINT, SIG_DFL);
  1781. --                      test(12, 0, F_TLOCK, (off_t)0, (off_t)0, PASS, FATAL);
  1782. -+            test(12, 0, F_TLOCK, (off_t)0, (off_t)0, PASS, FATAL);
  1783. -                       for (;;)
  1784. -                               sleep(1);
  1785. -                       /* NOTREACHED */
  1786. -@@ -1489,7 +1705,11 @@ test13()
  1787. -               lock1err = testmmap();
  1788. -               report(13, 1, "mmap", (off_t)0, (off_t)mappedlen, EAGAIN,
  1789. -                       lock1err, WARN);
  1790. -+#ifdef _WIN32
  1791. -+              test(13, 2, F_ULOCK, (off_t)mappedlen - 2, (off_t)END, PASS, FATAL);
  1792. -+#else
  1793. -               test(13, 2, F_ULOCK, (off_t)0, (off_t)END, PASS, FATAL);
  1794. -+#endif
  1795. -               if (lock1err == 0)
  1796. -                       testmunmap();
  1797. -
  1798. -@@ -1505,6 +1725,9 @@ test13()
  1799. -                       FATAL);
  1800. -               test(13, 4, F_TLOCK, (off_t)mappedlen - 2, (off_t)END,
  1801. -                       lock1err, WARN);
  1802. -+#ifdef _WIN32
  1803. -+              testmunmap();
  1804. -+#endif
  1805. -               close_testfile(DO_UNLINK);
  1806. -
  1807. -               childfree(0);
  1808. -@@ -1589,21 +1812,27 @@ runtests()
  1809. -       if (DO_TEST(7)) {
  1810. -               test7();
  1811. -       }
  1812. -+#ifndef _WIN32
  1813. -       if (DO_RATE(8)) {
  1814. -               test8();
  1815. -       }
  1816. -+#endif
  1817. -       if (DO_MAND(9)) {
  1818. -               test9();
  1819. -       }
  1820. -+#ifndef _WIN32
  1821. -+    /* windows doesn't allow splitting lock ranges;
  1822. -+     * unlock ranges must correspond exactly to lock ranges */
  1823. -       if (DO_TEST(10)) {
  1824. -               test10();
  1825. -       }
  1826. -+#endif
  1827. -       if (DO_TEST(11)) {
  1828. -               test11();
  1829. -       }
  1830. -       if (DO_TEST(12)) {
  1831. -               test12();
  1832. --      }
  1833. -+    }
  1834. - #ifdef MMAP
  1835. -       if (DO_TEST(13)) {
  1836. -               test13();
  1837. ---
  1838. -1.6.4.msysgit.0
  1839. -
  1840. diff --git a/tests/cthon04/0008-cthon-disabling-test8-from-the-basic-test.patch b/tests/cthon04/0008-cthon-disabling-test8-from-the-basic-test.patch
  1841. deleted file mode 100644
  1842. index beb7a1c..0000000
  1843. --- a/tests/cthon04/0008-cthon-disabling-test8-from-the-basic-test.patch
  1844. +++ /dev/null
  1845. @@ -1,26 +0,0 @@
  1846. -From 520bd04d9752faa6f77acd50ea759d170fb149d4 Mon Sep 17 00:00:00 2001
  1847. -From: Casey Bodley <cbodley@citi.umich.edu>
  1848. -Date: Mon, 11 Oct 2010 15:25:41 -0400
  1849. -Subject: [PATCH 08/11] cthon: disabling test8 from the basic test
  1850. -
  1851. -it's a symlink test and we are not supporting symlinks on windows
  1852. ----
  1853. - basic/runtests |    2 +-
  1854. - 1 files changed, 1 insertions(+), 1 deletions(-)
  1855. -
  1856. -diff --git a/basic/runtests b/basic/runtests
  1857. -index 32e1d85..0b2f205 100644
  1858. ---- a/basic/runtests
  1859. -+++ b/basic/runtests
  1860. -@@ -69,7 +69,7 @@ fi
  1861. -
  1862. - # Symlink and readlink test
  1863. - echo ""
  1864. --./test8 $TESTARG
  1865. -+#./test8 $TESTARG
  1866. -
  1867. - # Getfs test
  1868. - echo ""
  1869. ---
  1870. -1.6.4.msysgit.0
  1871. -
  1872. diff --git a/tests/cthon04/0009-cthon-enabling-NATIVE64-for-special-tests.patch b/tests/cthon04/0009-cthon-enabling-NATIVE64-for-special-tests.patch
  1873. deleted file mode 100644
  1874. index 148d2ce..0000000
  1875. --- a/tests/cthon04/0009-cthon-enabling-NATIVE64-for-special-tests.patch
  1876. +++ /dev/null
  1877. @@ -1,26 +0,0 @@
  1878. -From aafcd8aea575739115458cf3aeb58611d65647ee Mon Sep 17 00:00:00 2001
  1879. -From: Casey Bodley <cbodley@citi.umich.edu>
  1880. -Date: Mon, 11 Oct 2010 15:26:01 -0400
  1881. -Subject: [PATCH 09/11] cthon: enabling NATIVE64 for special tests
  1882. -
  1883. -that enables 64bit offset tests in the special tests
  1884. ----
  1885. - tests.init |    2 +-
  1886. - 1 files changed, 1 insertions(+), 1 deletions(-)
  1887. -
  1888. -diff --git a/tests.init b/tests.init
  1889. -index 3a1ba74..c5116e6 100644
  1890. ---- a/tests.init
  1891. -+++ b/tests.init
  1892. -@@ -205,7 +205,7 @@ LOCKTESTS=`echo tlocklfs tlock64`
  1893. -
  1894. - # Use with Linux 2.4 / GNU libc 2.2
  1895. - #CFLAGS=`echo -DLINUX -DGLIBC=22 -DMMAP -DSTDARG -fwritable-strings`
  1896. --CFLAGS=`echo -DLINUX -DGLIBC=22 -DMMAP -DSTDARG`
  1897. -+CFLAGS=`echo -DLINUX -DGLIBC=22 -DMMAP -DSTDARG -DNATIVE64`
  1898. - #LIBS=`echo -lnsl`
  1899. - MOUNT=/bin/mount
  1900. - UMOUNT=/bin/umount
  1901. ---
  1902. -1.6.4.msysgit.0
  1903. -
  1904. diff --git a/tests/cthon04/0010-cthon-fixes-for-64-bit-locking.patch b/tests/cthon04/0010-cthon-fixes-for-64-bit-locking.patch
  1905. deleted file mode 100644
  1906. index 508c0c6..0000000
  1907. --- a/tests/cthon04/0010-cthon-fixes-for-64-bit-locking.patch
  1908. +++ /dev/null
  1909. @@ -1,60 +0,0 @@
  1910. -From c8deb58ef9500765aa38fc86747fca0add5d04b1 Mon Sep 17 00:00:00 2001
  1911. -From: Casey Bodley <cbodley@citi.umich.edu>
  1912. -Date: Mon, 11 Oct 2010 15:33:50 -0400
  1913. -Subject: [PATCH 10/11] cthon: fixes for 64-bit locking
  1914. -
  1915. -cthon04/lock/tlock.c: fixed initialization of LARGE_INTEGERs, and removed the parts of test() that return EINVAL (our driver should be returning ERROR_INVALID_LOCK_RANGE for those)
  1916. -
  1917. -also updated the nfs_lock test program to take 64-bit input for length and offset
  1918. ----
  1919. - lock/tlock.c |   18 ++++++++----------
  1920. - 1 files changed, 8 insertions(+), 10 deletions(-)
  1921. -
  1922. -diff --git a/lock/tlock.c b/lock/tlock.c
  1923. -index dac3519..f06de6c 100644
  1924. ---- a/lock/tlock.c
  1925. -+++ b/lock/tlock.c
  1926. -@@ -848,9 +848,12 @@ testmunmap()
  1927. -
  1928. - #ifdef _WIN32
  1929. -
  1930. -+#define ERROR_INVALID_LOCK_RANGE 0x133 // 307
  1931. -+
  1932. - static int map_lock_error(int num, int sec, int status) {
  1933. -     switch (status) {
  1934. -     case NO_ERROR: return 0;
  1935. -+    case ERROR_INVALID_LOCK_RANGE: return EINVAL;
  1936. -     case ERROR_NOT_LOCKED:
  1937. -     case ERROR_LOCK_VIOLATION: return denied_err;
  1938. -     default:
  1939. -@@ -870,22 +873,17 @@ int pass;                        /* expected return code */
  1940. - int fail;                     /* error vs warning */
  1941. - {
  1942. -     int result = PASS;
  1943. --    LARGE_INTEGER off = { offset };
  1944. --    LARGE_INTEGER len = { length };
  1945. -+    ULARGE_INTEGER off;
  1946. -+    ULARGE_INTEGER len;
  1947. -     OVERLAPPED overlapped = { 0 };
  1948. -+
  1949. -+    off.QuadPart = offset;
  1950. -+    len.QuadPart = length;
  1951. -     overlapped.Offset = off.LowPart;
  1952. -     overlapped.OffsetHigh = off.HighPart;
  1953. -
  1954. --    if (off.QuadPart + len.QuadPart < 0) {
  1955. --        result = EINVAL;
  1956. --        goto out;
  1957. --    }
  1958. -     if (length == 0)
  1959. -         len.QuadPart = ULLONG_MAX - offset;
  1960. --    if (len.QuadPart == 0) {
  1961. --        result = EINVAL;
  1962. --        goto out;
  1963. --    }
  1964. -
  1965. -     switch (func) {
  1966. -     case F_LOCK: /* blocking lock */
  1967. ---
  1968. -1.6.4.msysgit.0
  1969. -
  1970. diff --git a/tests/cthon04/0011-cthon-setting-maxeof-to-be-64bit.patch b/tests/cthon04/0011-cthon-setting-maxeof-to-be-64bit.patch
  1971. deleted file mode 100644
  1972. index f59624f..0000000
  1973. --- a/tests/cthon04/0011-cthon-setting-maxeof-to-be-64bit.patch
  1974. +++ /dev/null
  1975. @@ -1,26 +0,0 @@
  1976. -From efeb9db4f13e1dabe29e8bcf97a503079efca8ab Mon Sep 17 00:00:00 2001
  1977. -From: Casey Bodley <cbodley@citi.umich.edu>
  1978. -Date: Mon, 11 Oct 2010 15:34:14 -0400
  1979. -Subject: [PATCH 11/11] cthon: setting maxeof to be 64bit
  1980. -
  1981. -old value was 0x7fffffff
  1982. ----
  1983. - lock/runtests |    2 +-
  1984. - 1 files changed, 1 insertions(+), 1 deletions(-)
  1985. -
  1986. -diff --git a/lock/runtests b/lock/runtests
  1987. -index a25f101..2335363 100644
  1988. ---- a/lock/runtests
  1989. -+++ b/lock/runtests
  1990. -@@ -38,7 +38,7 @@ esac
  1991. -
  1992. - if echo "$mntopts" | grep vers=2 > /dev/null
  1993. - then
  1994. --      TESTARGS="-v 2 $TESTARGS"
  1995. -+      TESTARGS="-v 4 $TESTARGS"
  1996. - fi
  1997. -
  1998. - for i in $LOCKTESTS
  1999. ---
  2000. -1.6.4.msysgit.0
  2001. -
  2002. diff --git a/tests/cthon04/0012-removing-pmapbrb-pmaptst-tests-from-tools-dir.patch b/tests/cthon04/0012-removing-pmapbrb-pmaptst-tests-from-tools-dir.patch
  2003. deleted file mode 100644
  2004. index c602033..0000000
  2005. --- a/tests/cthon04/0012-removing-pmapbrb-pmaptst-tests-from-tools-dir.patch
  2006. +++ /dev/null
  2007. @@ -1,26 +0,0 @@
  2008. -From 0e4268b2b76b5c89f9e661f7ffbb9c2a7234511c Mon Sep 17 00:00:00 2001
  2009. -From: Olga Kornievskaia <aglo@citi.umich.edu>
  2010. -Date: Thu, 14 Oct 2010 12:26:50 -0400
  2011. -Subject: [PATCH 1/3] removing pmapbrb pmaptst tests from tools dir
  2012. -
  2013. ----
  2014. - tools/Makefile |    3 ++-
  2015. - 1 files changed, 2 insertions(+), 1 deletions(-)
  2016. -
  2017. -diff --git a/tools/Makefile b/tools/Makefile
  2018. -index ce6019f..d3fde4e 100644
  2019. ---- a/tools/Makefile
  2020. -+++ b/tools/Makefile
  2021. -@@ -8,7 +8,8 @@
  2022. - # 'make copy DESTDIR=path'      copies test programs to path
  2023. - # 'make dist DESTDIR=path'      copies sources to path
  2024. -
  2025. --TESTS = tcp tcpd udp udpd dirdmp dirprt pmaptst pmapbrd
  2026. -+#TESTS = tcp tcpd udp udpd dirdmp dirprt pmaptst pmapbrd
  2027. -+TESTS = tcp tcpd udp udpd dirdmp dirprt
  2028. -
  2029. - # dirdmp apparently doesn't work with Linux 2.2.  So for Linux systems,
  2030. - # comment out the above definition and use this one.
  2031. ---
  2032. -1.6.4.msysgit.0
  2033. -
  2034. diff --git a/tests/cthon04/0013-nroff-patch.patch b/tests/cthon04/0013-nroff-patch.patch
  2035. deleted file mode 100644
  2036. index b588c21..0000000
  2037. --- a/tests/cthon04/0013-nroff-patch.patch
  2038. +++ /dev/null
  2039. @@ -1,26 +0,0 @@
  2040. -From 343a7ad0eae100b833f2aeed5ca2406427304254 Mon Sep 17 00:00:00 2001
  2041. -From: Olga Kornievskaia <aglo@citi.umich.edu>
  2042. -Date: Wed, 13 Oct 2010 19:45:31 -0400
  2043. -Subject: [PATCH 2/3] nroff patch
  2044. -
  2045. ----
  2046. - general/runtests.wrk |    3 +++
  2047. - 1 files changed, 3 insertions(+), 0 deletions(-)
  2048. -
  2049. -diff --git a/general/runtests.wrk b/general/runtests.wrk
  2050. -index 83f3124..9dda456 100644
  2051. ---- a/general/runtests.wrk
  2052. -+++ b/general/runtests.wrk
  2053. -@@ -89,6 +89,9 @@ $TIME nroff < nroff.tbl > nroff.out 2>> nroff.time || cat nroff.time
  2054. - $TIME nroff < nroff.tbl > nroff.out 2>> nroff.time || cat nroff.time
  2055. - rm nroff.out nroff.tbl
  2056. - set -e
  2057. -+#remove nroff warnings from nroff.time
  2058. -+egrep -v '^warning:.*$' <nroff.time >nroff.new
  2059. -+mv -f nroff.new nroff.time
  2060. - ./stat.exe nroff.time
  2061. - set +e
  2062. -
  2063. ---
  2064. -1.6.4.msysgit.0
  2065. -
  2066. diff --git a/tests/cthon04/0014-commenting-out-symlink-test-in-special-tests.patch b/tests/cthon04/0014-commenting-out-symlink-test-in-special-tests.patch
  2067. deleted file mode 100644
  2068. index 92ba745..0000000
  2069. --- a/tests/cthon04/0014-commenting-out-symlink-test-in-special-tests.patch
  2070. +++ /dev/null
  2071. @@ -1,35 +0,0 @@
  2072. -From cf3f18a335525c4da01c85d58b46653e9c7605ec Mon Sep 17 00:00:00 2001
  2073. -From: Olga Kornievskaia <aglo@citi.umich.edu>
  2074. -Date: Thu, 14 Oct 2010 11:29:28 -0400
  2075. -Subject: [PATCH 3/3] commenting out symlink test in special tests
  2076. -
  2077. ----
  2078. - special/runtests.wrk |   12 ++++++------
  2079. - 1 files changed, 6 insertions(+), 6 deletions(-)
  2080. -
  2081. -diff --git a/special/runtests.wrk b/special/runtests.wrk
  2082. -index 9543761..bd528c2 100644
  2083. ---- a/special/runtests.wrk
  2084. -+++ b/special/runtests.wrk
  2085. -@@ -64,12 +64,12 @@ echo ""
  2086. - echo "test holey file support"
  2087. - ./holey
  2088. -
  2089. --if [ "$HARDLINKS"o != no ]
  2090. --then
  2091. --      echo ""
  2092. --      echo "second check for lost reply on non-idempotent requests"
  2093. --      ./nfsidem 50 testdir
  2094. --fi
  2095. -+#if [ "$HARDLINKS"o != no ]
  2096. -+#then
  2097. -+#     echo ""
  2098. -+#     echo "second check for lost reply on non-idempotent requests"
  2099. -+#     ./nfsidem 50 testdir
  2100. -+#fi
  2101. -
  2102. - echo ""
  2103. - echo "test rewind support"
  2104. ---
  2105. -1.6.4.msysgit.0
  2106. -
  2107. diff --git a/tests/cthon04/0015-cthon-enabled-basic-test4a-5a-5b-and-7a.patch b/tests/cthon04/0015-cthon-enabled-basic-test4a-5a-5b-and-7a.patch
  2108. deleted file mode 100644
  2109. index db75ad0..0000000
  2110. --- a/tests/cthon04/0015-cthon-enabled-basic-test4a-5a-5b-and-7a.patch
  2111. +++ /dev/null
  2112. @@ -1,51 +0,0 @@
  2113. -From 5d35b0e608f386be69b9c7a2f4e136a892d9f0bb Mon Sep 17 00:00:00 2001
  2114. -From: Casey Bodley <cbodley@citi.umich.edu>
  2115. -Date: Wed, 27 Oct 2010 12:57:37 -0400
  2116. -Subject: [PATCH] cthon: enabled basic test4a, 5a, 5b, and 7a
  2117. -
  2118. ----
  2119. - basic/runtests |   16 ++++++++--------
  2120. - 1 files changed, 8 insertions(+), 8 deletions(-)
  2121. -
  2122. -diff --git a/basic/runtests b/basic/runtests
  2123. -index 0b2f205..9567e1a 100644
  2124. ---- a/basic/runtests
  2125. -+++ b/basic/runtests
  2126. -@@ -39,17 +39,17 @@ echo ""
  2127. - echo ""
  2128. - ./test4 $TESTARG
  2129. - # Getattr and lookup tests
  2130. --# echo ""
  2131. --# ./test4a $TESTARG
  2132. -+echo ""
  2133. -+./test4a $TESTARG
  2134. -
  2135. - # Write and read tests
  2136. - echo ""
  2137. - ./test5 $TESTARG
  2138. - # Test 5a and 5b separate out the read and write tests into simpler components.
  2139. --# echo ""
  2140. --# ./test5a $TESTARG
  2141. --# echo ""
  2142. --# ./test5b $TESTARG
  2143. -+echo ""
  2144. -+./test5a $TESTARG
  2145. -+echo ""
  2146. -+./test5b $TESTARG
  2147. -
  2148. - # Read Directory test
  2149. - echo ""
  2150. -@@ -64,8 +64,8 @@ else
  2151. -       ./test7a $TESTARG
  2152. - fi
  2153. - # Link Test
  2154. --# echo ""
  2155. --# ./test7b $TESTARG
  2156. -+echo ""
  2157. -+./test7b $TESTARG
  2158. -
  2159. - # Symlink and readlink test
  2160. - echo ""
  2161. ---
  2162. -1.6.4.msysgit.0
  2163. -
  2164. diff --git a/tests/cthon04/0016-cthon-Handle-error-messages-for-newer-Cygwin-nroff-v.patch b/tests/cthon04/0016-cthon-Handle-error-messages-for-newer-Cygwin-nroff-v.patch
  2165. deleted file mode 100644
  2166. index 13ba5b3..0000000
  2167. --- a/tests/cthon04/0016-cthon-Handle-error-messages-for-newer-Cygwin-nroff-v.patch
  2168. +++ /dev/null
  2169. @@ -1,30 +0,0 @@
  2170. -From a56259552fde64a43a0cb764c77777a6c34dd6bd Mon Sep 17 00:00:00 2001
  2171. -From: Roland Mainz <roland.mainz@nrubsig.org>
  2172. -Date: Mon, 13 Nov 2023 17:49:14 +0100
  2173. -Subject: [PATCH] cthon: Handle error messages for newer Cygwin nroff version
  2174. -
  2175. -cthon: Handle error messages for newer Cygwin 3.5.0 nroff version
  2176. -
  2177. -Tested with:
  2178. -$ nroff --version
  2179. -GNU nroff (groff) version 1.23.0
  2180. -GNU groff version 1.23.0
  2181. ----
  2182. - general/runtests.wrk | 2 +-
  2183. - 1 file changed, 1 insertion(+), 1 deletion(-)
  2184. -
  2185. -diff --git a/general/runtests.wrk b/general/runtests.wrk
  2186. -index 9dda456..ef7bc86 100644
  2187. ---- a/general/runtests.wrk
  2188. -+++ b/general/runtests.wrk
  2189. -@@ -90,7 +90,7 @@ $TIME nroff < nroff.tbl > nroff.out 2>> nroff.time || cat nroff.time
  2190. - rm nroff.out nroff.tbl
  2191. - set -e
  2192. - #remove nroff warnings from nroff.time
  2193. --egrep -v '^warning:.*$' <nroff.time >nroff.new
  2194. -+egrep -v '^(nroff.in:.+?|)warning:.*$' <nroff.time >nroff.new
  2195. - mv -f nroff.new nroff.time
  2196. - ./stat.exe nroff.time
  2197. - set +e
  2198. ---
  2199. -2.42.1
  2200. diff --git a/tests/manual_testing.txt b/tests/manual_testing.txt
  2201. index 065ba42..230da79 100644
  2202. --- a/tests/manual_testing.txt
  2203. +++ b/tests/manual_testing.txt
  2204. @@ -1,5 +1,5 @@
  2205.  #
  2206. -# ms-nfs41-client manual testing sequence, 2025-02-08
  2207. +# ms-nfs41-client manual testing sequence, 2025-02-18
  2208.  #
  2209.  # Draft version, needs to be turned into automated tests
  2210.  # if possible
  2211. @@ -145,6 +145,28 @@
  2212.  #
  2213.  
  2214.  
  2215. +#
  2216. +# "cthon04" test suite:
  2217. +#
  2218. +# mount a NFSv4 filesystem, and then execute this
  2219. +# on this filesystem
  2220. +mkdir nfsv4cthontest1 && cd nfsv4cthontest1
  2221. +git clone https://github.com/kofemann/ms-nfs41-client.git
  2222. +git clone git://git.linux-nfs.org/projects/steved/cthon04.git
  2223. +cd cthon04/
  2224. +git config --global --add safe.directory "$PWD"
  2225. +git checkout 6c9abfd6907b2b43036af111cc600ab60ef804e5
  2226. +git am ../ms-nfs41-client/tests/cthon04/*.patch
  2227. +(make CC="gcc -std=gnu17 -Wno-implicit-int -Wno-implicit-function-declaration -Wno-incompatible-pointer-types" 2>&1 | tee buildlog.log)
  2228. +(rm -Rf testdir1 && mkdir testdir1 && PATH="$PATH:." ksh93 ./runtests -a -t "$PWD/testdir1" 2>&1 | tee testrun.log)
  2229. +
  2230. +
  2231. +#
  2232. +# "winfstest" test suite:
  2233. +#
  2234. +See tests/winfstest/README.txt
  2235. +
  2236. +
  2237.  #
  2238.  # Tests for cp -p/mv/chmod/chgrp
  2239.  # Testcases, all should print *ONLY* "OK" on stdout, nothing on stderr
  2240. --
  2241. 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