cephfs: Skip fallocate with mode 0 test on main

There has been an internal change with fallocate API[1] forcing us not
to run those fallocate tests which uses mode as 0. For now we skip those
tests on main branch.

[1] https://github.com/ceph/ceph/pull/59725

Signed-off-by: Anoop C S <anoopcs@cryptolab.net>
This commit is contained in:
Anoop C S 2024-11-12 16:06:44 +05:30 committed by mergify[bot]
parent 75d1af3ed6
commit 8f3beb622f
1 changed files with 28 additions and 0 deletions

View File

@ -8,6 +8,26 @@ import (
"github.com/stretchr/testify/assert"
)
var (
serverVersion string
)
const (
cephOctopus = "octopus"
cephPacfic = "pacific"
cephQuincy = "quincy"
cephReef = "reef"
cephSquid = "squid"
cephMain = "main"
)
func init() {
switch vname := os.Getenv("CEPH_VERSION"); vname {
case cephOctopus, cephPacfic, cephQuincy, cephReef, cephSquid, cephMain:
serverVersion = vname
}
}
func TestFileOpen(t *testing.T) {
mount := fsConnect(t)
defer fsDisconnect(t, mount)
@ -492,6 +512,10 @@ func TestFallocate(t *testing.T) {
// Allocate space - default case, mode == 0.
t.Run("modeIsZero", func(t *testing.T) {
if serverVersion == cephMain {
t.Skip("fallocate with mode 0 is unsupported: https://tracker.ceph.com/issues/68026")
}
// check file size.
sx, err := mount.Statx(fname, StatxBasicStats, 0)
assert.NoError(t, err)
@ -507,6 +531,10 @@ func TestFallocate(t *testing.T) {
// Allocate space - size increases, data remains intact.
t.Run("increaseSize", func(t *testing.T) {
if serverVersion == cephMain {
t.Skip("fallocate with mode 0 is unsupported: https://tracker.ceph.com/issues/68026")
}
fname := "file2.txt"
f1, err := mount.Open(fname, os.O_RDWR|os.O_CREATE, 0644)
assert.NoError(t, err)