go-mtree
go-mtree copied to clipboard
[BUG] TestTarCompare failure on openbsd
$ uname -a
OpenBSD puffy.attlocal.net 6.0 GENERIC.MP#0 amd64
$ go version
go version go1.7.3 openbsd/amd64
xref #105
=== RUN TestTarCompare
--- FAIL: TestTarCompare (0.07s)
compare_test.go:449: FAILURE: diff[0] = {
"type": "modified",
"path": "tmpfile",
"keys": [
{
"type": "modified",
"name": "gid",
"old": "0",
"new": "1000"
}
]
}
compare_test.go:449: FAILURE: diff[1] = {
"type": "modified",
"path": "testdir",
"keys": [
{
"type": "modified",
"name": "gid",
"old": "0",
"new": "1000"
}
]
}
compare_test.go:449: FAILURE: diff[2] = {
"type": "modified",
"path": "testdir/anotherfile",
"keys": [
{
"type": "modified",
"name": "gid",
"old": "0",
"new": "1000"
}
]
}
compare_test.go:456: expected the diff length to be 0, got 3
FAIL
exit status 1
FAIL github.com/vbatts/go-mtree 0.123s
a diff of the mtree manifests produced by the test on the test directory:
--- dir.mtree Wed Dec 14 13:42:52 2016
+++ tar.mtree Wed Dec 14 13:43:03 2016
@@ -1,16 +1,18 @@
# user: vbatts
# machine: puffy.attlocal.net
-# tree: tmp/test-compare-tar320547988
-# date: Wed Dec 14 13:42:52 2016
-# keywords: size,type,uid,gid,mode,link,nlink,time,sha1digest
+# tree: <user specified tar archive>
+# date: Wed Dec 14 13:43:03 2016
+# keywords: size,type,uid,gid,mode,link,tar_time,sha1digest
# .
-/set type=file nlink=1 mode=0664 uid=1000 gid=1000
-. size=512 type=dir mode=0700 nlink=3 time=100.987655000
- tmpfile size=12 mode=0644 time=100.987655000 sha1digest=94e66df8cd09d410c62d9e0dc59d3a884e458e05
+. type=dir
+ tmpfile size=12 type=file uid=1000 gid=1000 mode=0644 tar_time=100.000000000 sha1digest=94e66df8cd09d410c62d9e0dc59d3a884e458e05
# testdir
-testdir size=512 type=dir mode=0755 nlink=2 time=100.987655000
- anotherfile size=3 mode=0644 time=100.987655000 sha1digest=7e240de74fb1ed08fa08d38063f6a6a91462a815
+/set type=file mode=0664 uid=1000 gid=1000
+testdir type=dir mode=0755 tar_time=100.000000000
+ anotherfile size=3 mode=0644 tar_time=100.000000000 sha1digest=7e240de74fb1ed08fa08d38063f6a6a91462a815
+# testdir
..
+# .
..
/cc @cyphar
It's possible that my changes to dhCreator haven't handled something properly -- though I doubt it because /set type=file still appears to work in the tar case -- not to mention that it works on Linux.