[Git][reproducible-builds/disorderfs][master] 2 commits: tests/touch: Tidy tests

Chris Lamb gitlab at salsa.debian.org
Wed Oct 24 05:39:21 CEST 2018


Chris Lamb pushed to branch master at Reproducible Builds / disorderfs


Commits:
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.

- - - - -


1 changed file:

- tests/touch


Changes:

=====================================
tests/touch
=====================================
@@ -4,20 +4,37 @@
 . ./common
 
 Mount
-f=target/a
-exmtime=12345678
-touch $f
-touch -d @$exmtime $f
-mtime=$(stat --format=%X-%Y $f)
-[ "$mtime" = "$exmtime-$exmtime" ] || Fail "test1: Got=$mtime Expected=$exmtime"
-touch $f
+
+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 -m -d @$exmtime $f
-mtime=$(stat --format=%Y $f)
-[ "$mtime" = "$exmtime" ] || XFail "test2: Got=$mtime Expected=$exmtime" # FIXME
-touch $f
-touch -a -d @$exmtime $f
-atime=$(stat --format=%X $f)
-[ "$atime" = "$exmtime" ] || XFail "test3: Got=$atime Expected=$exmtime" # FIXME
-touch $f
+touch ${FILENAME}
+touch -m -d @${EXPECTED} ${FILENAME}
+RESULT="$(stat --format=%Y ${FILENAME})"
+if [ "${RESULT}" = "${EXPECTED}" ]
+then
+	Fail "test2: Did not XFail"
+else
+	XFail "test2: Got=${RESULT} Expected=${EXPECTED}"
+fi
+
+touch ${FILENAME}
+touch -a -d @${EXPECTED} ${FILENAME}
+RESULT="$(stat --format=%X ${FILENAME})"
+if [ "${RESULT}" = "${EXPECTED}" ]
+then
+	Fail "test3: Did not XFail"
+else
+	XFail "test3: Got=${RESULT} Expected=${EXPECTED}"
+fi
+
 Unmount



View it on GitLab: https://salsa.debian.org/reproducible-builds/disorderfs/compare/326d2cc5afc0a620c460db5e3b08373aed30eb64...80402ea82739c85973682cc30f6864b22b5f5dd7

-- 
View it on GitLab: https://salsa.debian.org/reproducible-builds/disorderfs/compare/326d2cc5afc0a620c460db5e3b08373aed30eb64...80402ea82739c85973682cc30f6864b22b5f5dd7
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/2d396fa5/attachment.html>


More information about the rb-commits mailing list