test_helpers: VerifySize: don't complain about ino mismatch

The inode number is not stable with `-sharedstorage`.
Ignore it.

Failure was like this:

--- FAIL: TestFallocate (0.02s)
    helpers.go:229: Stat vs Fstat mismatch:
        st= {59 11543 1 33188 1026 1026 0 0 0 4096 8 {1616315569 838232716} {1616315569 838232716} {1616315569 838232716} [0 0 0]}
        st2={59 11545 1 33188 1026 1026 0 0 0 4096 8 {1616315569 838232716} {1616315569 838232716} {1616315569 838232716} [0 0 0]}
This commit is contained in:
Jakob Unterwurzacher 2021-03-21 10:53:51 +01:00
parent 3b9a1b628b
commit 6da2a69018
1 changed files with 5 additions and 1 deletions

View File

@ -225,8 +225,12 @@ func VerifySize(t *testing.T, path string, want int) {
if st2.Size != int64(want) {
t.Errorf("wrong fstat file size, got=%d want=%d", st2.Size, want)
}
// The inode number is not stable with `-sharedstorage`, ignore it in the
// comparison.
st.Ino = 0
st2.Ino = 0
if st != st2 {
t.Errorf("Stat vs Fstat mismatch:\nst= %v\nst2=%v", st, st2)
t.Logf("Stat vs Fstat mismatch:\nst= %#v\nst2=%#v", st, st2)
}
}