[Git][reproducible-builds/disorderfs][debian] 8 commits: Add two tests

Chris Lamb gitlab at salsa.debian.org
Wed Oct 24 22:39:20 CEST 2018


Chris Lamb pushed to branch debian at Reproducible Builds / disorderfs


Commits:
d606f262 by Bernhard M. Wiedemann at 2018-10-17T19:44:22Z
Add two tests

one passing and
one "FIXME" XFail that needs a code fix

- - - - -
326d2cc5 by Bernhard M. Wiedemann at 2018-10-18T06:49:26Z
tests: extend touch test with atime

and add bug ref

- - - - -
fb34e619 by Chris Lamb at 2018-10-24T03:37:55Z
tests/touch: Tidy tests

- - - - -
80402ea8 by Chris Lamb at 2018-10-24T03:38:16Z
tests/touch: Failing an XFail test should be a failure.

- - - - -
e58c31a8 by Chris Lamb at 2018-10-24T20:01:41Z
Inform FUSE that we wrap and thus accept the UTIME_OMIT (and UTIME_NOW) magic values to ensure that "touch -m …" and "touch -a …" work as expected. (Closes: #911281)

- - - - -
d5d44b14 by Chris Lamb at 2018-10-24T20:24:45Z
Release 0.5.5

- - - - -
7303c2b6 by Chris Lamb at 2018-10-24T20:32:39Z
Merge tag '0.5.5' into debian

Release 0.5.5

* tag '0.5.5':
  Release 0.5.5
  Inform FUSE that we wrap and thus accept the UTIME_OMIT (and UTIME_NOW) magic values to ensure that "touch -m …" and "touch -a …" work as expected. (Closes: #911281)
  tests/touch: Failing an XFail test should be a failure.
  tests/touch: Tidy tests
  tests: extend touch test with atime
  Add two tests

- - - - -
984eac88 by Chris Lamb at 2018-10-24T20:33:00Z
releasing package disorderfs version 0.5.5-1

- - - - -


3 changed files:

- debian/changelog
- disorderfs.cpp
- + tests/touch


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,15 @@
+disorderfs (0.5.5-1) unstable; urgency=medium
+
+  [ Chris Lamb ]
+  * Inform FUSE that we wrap and thus accept the UTIME_OMIT (and UTIME_NOW)
+    magic values to ensure that "touch -m …" and "touch -a …" work as expected.
+    (Closes: #911281)
+
+  [ Bernhard M. Wiedemann ]
+  * Add tests for file modification and access time issues.
+
+ -- Chris Lamb <lamby at debian.org>  Wed, 24 Oct 2018 16:30:58 -0400
+
 disorderfs (0.5.4-2) unstable; urgency=medium
 
   * Use the new debhelper-compat(=11) notation and drop d/compat.


=====================================
disorderfs.cpp
=====================================
@@ -43,7 +43,7 @@ extern "C" {
 #include <sys/file.h>
 #include <stddef.h>
 
-#define DISORDERFS_VERSION "0.5.4"
+#define DISORDERFS_VERSION "0.5.5"
 
 namespace {
 	std::vector<std::string>	bare_arguments;
@@ -293,6 +293,12 @@ int	main (int argc, char** argv)
 	 * Initialize disorderfs_fuse_operations
 	 */
 
+	/*
+	 * Indicate that we should accept UTIME_OMIT (and UTIME_NOW) in the
+	 * utimens operations for "touch -m" and "touch -a"
+	 */
+	disorderfs_fuse_operations.flag_utime_omit_ok = 1;
+
 	disorderfs_fuse_operations.getattr = [] (const char* path, struct stat* st) -> int {
 		Guard g;
 		if (lstat((root + path).c_str(), st) == -1) {


=====================================
tests/touch
=====================================
@@ -0,0 +1,36 @@
+#!/bin/sh
+# Test for https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=911281
+
+. ./common
+
+Mount
+
+EXPECTED="12345678"
+FILENAME="target/a"
+
+touch ${FILENAME}
+touch -d @${EXPECTED} ${FILENAME}
+RESULT="$(stat --format=%X-%Y ${FILENAME})"
+if [ "${RESULT}" != "${EXPECTED}-${EXPECTED}" ]
+then
+	Fail "test1: Got=${RESULT} Expected=${EXPECTED}"
+fi
+
+# This is what tar xf does for extracted files via futimens(2)
+touch ${FILENAME}
+touch -m -d @${EXPECTED} ${FILENAME}
+RESULT="$(stat --format=%Y ${FILENAME})"
+if [ "${RESULT}" != "${EXPECTED}" ]
+then
+	Fail "test2: Got=${RESULT} Expected=${EXPECTED}"
+fi
+
+touch ${FILENAME}
+touch -a -d @${EXPECTED} ${FILENAME}
+RESULT="$(stat --format=%X ${FILENAME})"
+if [ "${RESULT}" != "${EXPECTED}" ]
+then
+	Fail "test3: Got=${RESULT} Expected=${EXPECTED}"
+fi
+
+Unmount



View it on GitLab: https://salsa.debian.org/reproducible-builds/disorderfs/compare/d56c268e42840bd6c334ad271e61fcd46c15e1fe...984eac8879049d84896895e044ddc5e6c3948061

-- 
View it on GitLab: https://salsa.debian.org/reproducible-builds/disorderfs/compare/d56c268e42840bd6c334ad271e61fcd46c15e1fe...984eac8879049d84896895e044ddc5e6c3948061
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.reproducible-builds.org/pipermail/rb-commits/attachments/20181024/2eb6809c/attachment.html>


More information about the rb-commits mailing list