Subject: Re: bug#8846: coreutils-8.12 on HP-UX 11.31: 3 of 365 tests failed

From: Pádraig Brady <[email-masked]>
Date: Mon, 13 Jun 2011 11:49:56 +0100

On 13/06/11 10:55, Bruno Haible wrote:
> Pádraig Brady wrote:
>> Could you give the error returned for:
>>
>> dd if=/dev/zero of=ifile conv=fdatasync count=100
>> dd if=ifile iflag=nocache count=0
> 
> Here are the results:
> 
> $ ./dd if=/dev/zero of=ifile conv=fdatasync count=100
> 100+0 records in
> 100+0 records out
> 51200 bytes (51 kB) copied, 0.14338 s, 357 kB/s
> $ ./dd if=ifile iflag=nocache count=0
> ./dd: failed to discard cache for: `ifile': Not a typewriter

Weird. I've relaxed the test with the following.

cheers,
Pádraig.

--- a/tests/dd/nocache
+++ b/tests/dd/nocache
@@ -36,12 +36,12 @@ done

 # Advise to drop cache for whole file
 if ! dd if=ifile iflag=nocache count=0 2>err; then
-  if grep -F 'Operation not supported' err >/dev/null; then
-     warn_ 'skipping part; this file system lacks support for posix_fadvise()'
-     skip=1
-  else
-    fail=1
-  fi
+  # We could check for 'Operation not supported' in err here,
+  # but that was seen to be brittle. HPUX returns ENOTTY for example.
+  # So assume that if this basic operation fails, it's due to lack
+  # of support by the system.
+  warn_ 'skipping part; this file system lacks support for posix_fadvise()'
+  skip=1
 fi

 if test "$skip" != 1; then