Add some tests for unsupported fattr4 attributes
Subsystems (2)
Chuck Lever
maintainerPATCH 1/1 Add some tests for unsupported fattr4 attributes
From: Chuck Lever <[email protected]>
Linux NFSD does not implement a handful of these NFSv4.0 fattr4 attributes. Ensure that NFSD's fattr4 result encoder is correctly clearing the result mask and returning NFS4_OK.
--- nfs4.0/servertests/st_getattr.py | 149 +++++++++++++++++++++++++++++++ 1 file changed, 149 insertions(+)
nfs4.0/servertests/st_getattr.py +149 -0
@@ -521,6 +521,155 @@ def testOwnerName(t, env): t.fail_support("owner not a supported attribute") # print(res.resarray[-1].obj_attributes) +def testArchive(t, env): + """GETATTR on "archive" attribute + + FLAGS: getattr all + DEPEND: LOOKFILE + CODE: GATT11a + """ + c = env.c1 + ops = c.use_obj(env.opts.usefile) + ops += [c.getattr([FATTR4_ARCHIVE])] + res = c.compound(ops) + check(res, [NFS4_OK, NFS4ERR_ATTRNOTSUPP], "GETATTR(archive)") + if res.status == NFS4ERR_ATTRNOTSUPP: + t.fail_support("archive not a supported attribute") + +def testHidden(t, env): + """GETATTR on "hidden" attribute + + FLAGS: getattr all + DEPEND: LOOKFILE + CODE: GATT11b + """ + c = env.c1 + ops = c.use_obj(env.opts.usefile) + ops += [c.getattr([FATTR4_HIDDEN])] + res = c.compound(ops) + check(res, [NFS4_OK, NFS4ERR_ATTRNOTSUPP], "GETATTR(hidden)") + if res.status == NFS4ERR_ATTRNOTSUPP: + t.fail_support("hidden not a supported attribute") + +def testMimetype(t, env): + """GETATTR on "mimetype" attribute + + FLAGS: getattr all + DEPEND: LOOKFILE + CODE: GATT11c + """ + c = env.c1 + ops = c.use_obj(env.opts.usefile) + ops += [c.getattr([FATTR4_MIMETYPE])] + res = c.compound(ops) + check(res, [NFS4_OK, NFS4ERR_ATTRNOTSUPP], "GETATTR(mimetype)") + if res.status == NFS4ERR_ATTRNOTSUPP: + t.fail_support("mimetype not a supported attribute") + +def testQuotaAvailHard(t, env): + """GETATTR on "quota avail hard" attribute + + FLAGS: getattr all + DEPEND: LOOKFILE + CODE: GATT11d + """ + c = env.c1 + ops = c.use_obj(env.opts.usefile) + ops += [c.getattr([FATTR4_QUOTA_AVAIL_HARD])] + res = c.compound(ops) + check(res, [NFS4_OK, NFS4ERR_ATTRNOTSUPP], "GETATTR(quota_avail_hard)") + if res.status == NFS4ERR_ATTRNOTSUPP: + t.fail_support("quota_avail_hard not a supported attribute") + +def testQuotaAvailSoft(t, env): + """GETATTR on "quota avail soft" attribute + + FLAGS: getattr all + DEPEND: LOOKFILE + CODE: GATT11e + """ + c = env.c1 + ops = c.use_obj(env.opts.usefile) + ops += [c.getattr([FATTR4_QUOTA_AVAIL_SOFT])] + res = c.compound(ops) + check(res, [NFS4_OK, NFS4ERR_ATTRNOTSUPP], "GETATTR(quota_avail_soft)") + if res.status == NFS4ERR_ATTRNOTSUPP: + t.fail_support("quota_avail_soft not a supported attribute") + +def testQuotaUsed(t, env): + """GETATTR on "quota used" attribute + + FLAGS: getattr all + DEPEND: LOOKFILE + CODE: GATT11f + """ + c = env.c1 + ops = c.use_obj(env.opts.usefile) + ops += [c.getattr([FATTR4_QUOTA_USED])] + res = c.compound(ops) + check(res, [NFS4_OK, NFS4ERR_ATTRNOTSUPP], "GETATTR(quota_used)") + if res.status == NFS4ERR_ATTRNOTSUPP: + t.fail_support("quota_used not a supported attribute") + +def testSystem(t, env): + """GETATTR on "system" attribute + + FLAGS: getattr all + DEPEND: LOOKFILE + CODE: GATT11g + """ + c = env.c1 + ops = c.use_obj(env.opts.usefile) + ops += [c.getattr([FATTR4_SYSTEM])] + res = c.compound(ops) + check(res, [NFS4_OK, NFS4ERR_ATTRNOTSUPP], "GETATTR(system)") + if res.status == NFS4ERR_ATTRNOTSUPP: + t.fail_support("system not a supported attribute") + +def testTimeBackup(t, env): + """GETATTR on "time backup" attribute + + FLAGS: getattr all + DEPEND: LOOKFILE + CODE: GATT11h + """ + c = env.c1 + ops = c.use_obj(env.opts.usefile) + ops += [c.getattr([FATTR4_TIME_BACKUP])] + res = c.compound(ops) + check(res, [NFS4_OK, NFS4ERR_ATTRNOTSUPP], "GETATTR(time_backup)") + if res.status == NFS4ERR_ATTRNOTSUPP: + t.fail_support("time_backup not a supported attribute") + +def testTimeAccessSet(t, env): + """GETATTR on "time access set" attribute (write-only) + + FLAGS: getattr all + DEPEND: LOOKFILE + CODE: GATT11i + """ + c = env.c1 + ops = c.use_obj(env.opts.usefile) + ops += [c.getattr([FATTR4_TIME_ACCESS_SET])] + res = c.compound(ops) + check(res, [NFS4ERR_INVAL, NFS4ERR_ATTRNOTSUPP], "GETATTR(time_access_set)") + if res.status == NFS4ERR_ATTRNOTSUPP: + t.fail_support("time_access_set not a supported attribute") + +def testTimeModifySet(t, env): + """GETATTR on "time modify set" attribute (write-only) + + FLAGS: getattr all + DEPEND: LOOKFILE + CODE: GATT11j + """ + c = env.c1 + ops = c.use_obj(env.opts.usefile) + ops += [c.getattr([FATTR4_TIME_MODIFY_SET])] + res = c.compound(ops) + check(res, [NFS4ERR_INVAL, NFS4ERR_ATTRNOTSUPP], "GETATTR(time_modify_set)") + if res.status == NFS4ERR_ATTRNOTSUPP: + t.fail_support("time_modify_set not a supported attribute") ####################################################
Signature · 1 line
2.51.0
thanks Chuck,
I'm still catching up with pynfs patches; I'll get this (and the others queued up) in asap.
cheers,
c.
Quoted 171 lines · Chuck Lever
From: Chuck Lever <[email protected]>
Linux NFSD does not implement a handful of these NFSv4.0 fattr4 attributes. Ensure that NFSD's fattr4 result encoder is correctly clearing the result mask and returning
NFS4_OK.Signed-off-by Chuck Lever <[email protected]>--- nfs4.0/servertests/st_getattr.py | 149 +++++++++++++++++++++++++++++++ 1 file changed, 149 insertions(+)nfs4.0/servertests/st_getattr.py +149
-0@@ -521,6 +521,155 @@ def testOwnerName(t, env): t.fail_support("owner not a supported attribute") # print(res.resarray[-1].obj_attributes) +def testArchive(t, env): + """GETATTR on "archive" attribute + + FLAGS: getattr all + DEPEND: LOOKFILE + CODE: GATT11a + """ + c = env.c1 + ops = c.use_obj(env.opts.usefile) + ops += [c.getattr([FATTR4_ARCHIVE])] + res = c.compound(ops) + check(res, [NFS4_OK, NFS4ERR_ATTRNOTSUPP], "GETATTR(archive)") + if res.status == NFS4ERR_ATTRNOTSUPP: + t.fail_support("archive not a supported attribute") + +def testHidden(t, env): + """GETATTR on "hidden" attribute + + FLAGS: getattr all + DEPEND: LOOKFILE + CODE: GATT11b + """ + c = env.c1 + ops = c.use_obj(env.opts.usefile) + ops += [c.getattr([FATTR4_HIDDEN])] + res = c.compound(ops) + check(res, [NFS4_OK, NFS4ERR_ATTRNOTSUPP], "GETATTR(hidden)") + if res.status == NFS4ERR_ATTRNOTSUPP: + t.fail_support("hidden not a supported attribute") + +def testMimetype(t, env): + """GETATTR on "mimetype" attribute + + FLAGS: getattr all + DEPEND: LOOKFILE + CODE: GATT11c + """ + c = env.c1 + ops = c.use_obj(env.opts.usefile) + ops += [c.getattr([FATTR4_MIMETYPE])] + res = c.compound(ops) + check(res, [NFS4_OK, NFS4ERR_ATTRNOTSUPP], "GETATTR(mimetype)") + if res.status == NFS4ERR_ATTRNOTSUPP: + t.fail_support("mimetype not a supported attribute") + +def testQuotaAvailHard(t, env): + """GETATTR on "quota avail hard" attribute + + FLAGS: getattr all + DEPEND: LOOKFILE + CODE: GATT11d + """ + c = env.c1 + ops = c.use_obj(env.opts.usefile) + ops += [c.getattr([FATTR4_QUOTA_AVAIL_HARD])] + res = c.compound(ops) + check(res, [NFS4_OK, NFS4ERR_ATTRNOTSUPP], "GETATTR(quota_avail_hard)") + if res.status == NFS4ERR_ATTRNOTSUPP: + t.fail_support("quota_avail_hard not a supported attribute") + +def testQuotaAvailSoft(t, env): + """GETATTR on "quota avail soft" attribute + + FLAGS: getattr all + DEPEND: LOOKFILE + CODE: GATT11e + """ + c = env.c1 + ops = c.use_obj(env.opts.usefile) + ops += [c.getattr([FATTR4_QUOTA_AVAIL_SOFT])] + res = c.compound(ops) + check(res, [NFS4_OK, NFS4ERR_ATTRNOTSUPP], "GETATTR(quota_avail_soft)") + if res.status == NFS4ERR_ATTRNOTSUPP: + t.fail_support("quota_avail_soft not a supported attribute") + +def testQuotaUsed(t, env): + """GETATTR on "quota used" attribute + + FLAGS: getattr all + DEPEND: LOOKFILE + CODE: GATT11f + """ + c = env.c1 + ops = c.use_obj(env.opts.usefile) + ops += [c.getattr([FATTR4_QUOTA_USED])] + res = c.compound(ops) + check(res, [NFS4_OK, NFS4ERR_ATTRNOTSUPP], "GETATTR(quota_used)") + if res.status == NFS4ERR_ATTRNOTSUPP: + t.fail_support("quota_used not a supported attribute") + +def testSystem(t, env): + """GETATTR on "system" attribute + + FLAGS: getattr all + DEPEND: LOOKFILE + CODE: GATT11g + """ + c = env.c1 + ops = c.use_obj(env.opts.usefile) + ops += [c.getattr([FATTR4_SYSTEM])] + res = c.compound(ops) + check(res, [NFS4_OK, NFS4ERR_ATTRNOTSUPP], "GETATTR(system)") + if res.status == NFS4ERR_ATTRNOTSUPP: + t.fail_support("system not a supported attribute") + +def testTimeBackup(t, env): + """GETATTR on "time backup" attribute + + FLAGS: getattr all + DEPEND: LOOKFILE + CODE: GATT11h + """ + c = env.c1 + ops = c.use_obj(env.opts.usefile) + ops += [c.getattr([FATTR4_TIME_BACKUP])] + res = c.compound(ops) + check(res, [NFS4_OK, NFS4ERR_ATTRNOTSUPP], "GETATTR(time_backup)") + if res.status == NFS4ERR_ATTRNOTSUPP: + t.fail_support("time_backup not a supported attribute") + +def testTimeAccessSet(t, env): + """GETATTR on "time access set" attribute (write-only) + + FLAGS: getattr all + DEPEND: LOOKFILE + CODE: GATT11i + """ + c = env.c1 + ops = c.use_obj(env.opts.usefile) + ops += [c.getattr([FATTR4_TIME_ACCESS_SET])] + res = c.compound(ops) + check(res, [NFS4ERR_INVAL, NFS4ERR_ATTRNOTSUPP], "GETATTR(time_access_set)") + if res.status == NFS4ERR_ATTRNOTSUPP: + t.fail_support("time_access_set not a supported attribute") + +def testTimeModifySet(t, env): + """GETATTR on "time modify set" attribute (write-only) + + FLAGS: getattr all + DEPEND: LOOKFILE + CODE: GATT11j + """ + c = env.c1 + ops = c.use_obj(env.opts.usefile) + ops += [c.getattr([FATTR4_TIME_MODIFY_SET])] + res = c.compound(ops) + check(res, [NFS4ERR_INVAL, NFS4ERR_ATTRNOTSUPP], "GETATTR(time_modify_set)") + if res.status == NFS4ERR_ATTRNOTSUPP: + t.fail_support("time_modify_set not a supported attribute") ####################################################
Signature · 3 lines
Calum Mackay Linux Kernel Engineering Oracle Linux and Virtualisation
Chuck Lever
maintainerQuoted 4 lines · Calum Mackay
thanks Chuck,
I'm still catching up with pynfs patches; I'll get this (and the others queued up) in asap.
My patch deserves a smell test first, of course. I'm not at all sure this is reasonable or proper Python.
Quoted 180 lines
cheers,
c.Quoted 174 lines · Chuck Lever
From: Chuck Lever <[email protected]>
Linux NFSD does not implement a handful of these NFSv4.0 fattr4 attributes. Ensure that NFSD's fattr4 result encoder is correctly clearing the result mask and returning
NFS4_OK.Signed-off-by Chuck Lever <[email protected]>---
nfs4.0/servertests/st_getattr.py| 149 +++++++++++++++++++++++++++++++1 file changed, 149 insertions(+)nfs4.0/servertests/ renamed from nfs4.0/servertests/st_getattr.py +0
-0
st_getattr.py
index1c47ebf60571..d423aa1df46d100644nfs4.0/servertests/st_getattr.py +0
-0@@ -521,6 +521,155 @@ def testOwnerName(t, env): t.fail_support("owner not a supported attribute") # print(res.resarray[-1].obj_attributes)+def
testArchive(t, env):
+ """GETATTR on "archive" attributenfs4.0/servertests/st_getattr.py +55
-0+ + FLAGS: getattr all + DEPEND: LOOKFILE + CODE: GATT11a + """ + c = env.c1 + ops = c.use_obj(env.opts.usefile) + ops += [c.getattr([FATTR4_ARCHIVE])] + res = c.compound(ops) + check(res, [NFS4_OK, NFS4ERR_ATTRNOTSUPP], "GETATTR(archive)") + if res.status == NFS4ERR_ATTRNOTSUPP: + t.fail_support("archive not a supported attribute") + +def testHidden(t, env): + """GETATTR on "hidden" attribute + + FLAGS: getattr all + DEPEND: LOOKFILE + CODE: GATT11b + """ + c = env.c1 + ops = c.use_obj(env.opts.usefile) + ops += [c.getattr([FATTR4_HIDDEN])] + res = c.compound(ops) + check(res, [NFS4_OK, NFS4ERR_ATTRNOTSUPP], "GETATTR(hidden)") + if res.status == NFS4ERR_ATTRNOTSUPP: + t.fail_support("hidden not a supported attribute") + +def testMimetype(t, env): + """GETATTR on "mimetype" attribute + + FLAGS: getattr all + DEPEND: LOOKFILE + CODE: GATT11c + """ + c = env.c1 + ops = c.use_obj(env.opts.usefile) + ops += [c.getattr([FATTR4_MIMETYPE])] + res = c.compound(ops) + check(res, [NFS4_OK, NFS4ERR_ATTRNOTSUPP], "GETATTR(mimetype)") + if res.status == NFS4ERR_ATTRNOTSUPP: + t.fail_support("mimetype not a supported attribute") + +def testQuotaAvailHard(t, env): + """GETATTR on "quota avail hard" attribute + + FLAGS: getattr all + DEPEND: LOOKFILE + CODE: GATT11d + """ + c = env.c1 + ops = c.use_obj(env.opts.usefile) + ops += [c.getattr([FATTR4_QUOTA_AVAIL_HARD])] + res = c.compound(ops) + check(res, [NFS4_OK, NFS4ERR_ATTRNOTSUPP],"
GETATTR(quota_avail_hard)")
+ if res.status ==NFS4ERR_ATTRNOTSUPP:
+t.fail_support("quota_avail_hard not a supported attribute")nfs4.0/servertests/st_getattr.py +13
-0+ +def testQuotaAvailSoft(t, env): + """GETATTR on "quota avail soft" attribute + + FLAGS: getattr all + DEPEND: LOOKFILE + CODE: GATT11e + """ + c = env.c1 + ops = c.use_obj(env.opts.usefile) + ops += [c.getattr([FATTR4_QUOTA_AVAIL_SOFT])] + res = c.compound(ops) + check(res, [NFS4_OK, NFS4ERR_ATTRNOTSUPP],"
GETATTR(quota_avail_soft)")
+ if res.status ==NFS4ERR_ATTRNOTSUPP:
+t.fail_support("quota_avail_soft not a supported attribute")nfs4.0/servertests/st_getattr.py +58
-0+ +def testQuotaUsed(t, env): + """GETATTR on "quota used" attribute + + FLAGS: getattr all + DEPEND: LOOKFILE + CODE: GATT11f + """ + c = env.c1 + ops = c.use_obj(env.opts.usefile) + ops += [c.getattr([FATTR4_QUOTA_USED])] + res = c.compound(ops) + check(res, [NFS4_OK, NFS4ERR_ATTRNOTSUPP], "GETATTR(quota_used)") + if res.status == NFS4ERR_ATTRNOTSUPP: + t.fail_support("quota_used not a supported attribute") + +def testSystem(t, env): + """GETATTR on "system" attribute + + FLAGS: getattr all + DEPEND: LOOKFILE + CODE: GATT11g + """ + c = env.c1 + ops = c.use_obj(env.opts.usefile) + ops += [c.getattr([FATTR4_SYSTEM])] + res = c.compound(ops) + check(res, [NFS4_OK, NFS4ERR_ATTRNOTSUPP], "GETATTR(system)") + if res.status == NFS4ERR_ATTRNOTSUPP: + t.fail_support("system not a supported attribute") + +def testTimeBackup(t, env): + """GETATTR on "time backup" attribute + + FLAGS: getattr all + DEPEND: LOOKFILE + CODE: GATT11h + """ + c = env.c1 + ops = c.use_obj(env.opts.usefile) + ops += [c.getattr([FATTR4_TIME_BACKUP])] + res = c.compound(ops) + check(res, [NFS4_OK, NFS4ERR_ATTRNOTSUPP], "GETATTR(time_backup)") + if res.status == NFS4ERR_ATTRNOTSUPP: + t.fail_support("time_backup not a supported attribute") + +def testTimeAccessSet(t, env): + """GETATTR on "time access set" attribute (write-only) + + FLAGS: getattr all + DEPEND: LOOKFILE + CODE: GATT11i + """ + c = env.c1 + ops = c.use_obj(env.opts.usefile) + ops += [c.getattr([FATTR4_TIME_ACCESS_SET])] + res = c.compound(ops) + check(res, [NFS4ERR_INVAL, NFS4ERR_ATTRNOTSUPP],"
GETATTR(time_access_set)")
+ if res.status ==NFS4ERR_ATTRNOTSUPP:
+t.fail_support("time_access_set not a supported attribute")nfs4.0/servertests/st_getattr.py +13
-0+ +def testTimeModifySet(t, env): + """GETATTR on "time modify set" attribute (write-only) + + FLAGS: getattr all + DEPEND: LOOKFILE + CODE: GATT11j + """ + c = env.c1 + ops = c.use_obj(env.opts.usefile) + ops += [c.getattr([FATTR4_TIME_MODIFY_SET])] + res = c.compound(ops) + check(res, [NFS4ERR_INVAL, NFS4ERR_ATTRNOTSUPP],"
GETATTR(time_modify_set)")
+ if res.status ==NFS4ERR_ATTRNOTSUPP:
+t.fail_support("time_modify_set not a supported attribute")
####################################################
Signature · 1 line
Chuck Lever
Quoted 8 lines · Chuck Lever
Quoted 4 lines · Calum Mackay
thanks Chuck,
I'm still catching up with pynfs patches; I'll get this (and the others queued up) in asap.
My patch deserves a smell test first, of course. I'm not at all sure this is reasonable or proper Python.
Yes, of course :)
ta,
c.
Quoted 184 lines
Quoted 182 lines
cheers,
c.Quoted 174 lines · Chuck Lever
From: Chuck Lever <[email protected]>
Linux NFSD does not implement a handful of these NFSv4.0 fattr4 attributes. Ensure that NFSD's fattr4 result encoder is correctly clearing the result mask and returning
NFS4_OK.Signed-off-by Chuck Lever <[email protected]>--- nfs4.0/servertests/st_getattr.py | 149 +++++++++++++++++++++++++++++++ 1 file changed, 149 insertions(+)nfs4.0/servertests/ renamed from nfs4.0/servertests/st_getattr.py +0
-0
st_getattr.py
index1c47ebf60571..d423aa1df46d100644nfs4.0/servertests/st_getattr.py +146
-0@@ -521,6 +521,155 @@ def testOwnerName(t, env): t.fail_support("owner not a supported attribute") # print(res.resarray[-1].obj_attributes) +def testArchive(t, env): + """GETATTR on "archive" attribute + + FLAGS: getattr all + DEPEND: LOOKFILE + CODE: GATT11a + """ + c = env.c1 + ops = c.use_obj(env.opts.usefile) + ops += [c.getattr([FATTR4_ARCHIVE])] + res = c.compound(ops) + check(res, [NFS4_OK, NFS4ERR_ATTRNOTSUPP], "GETATTR(archive)") + if res.status == NFS4ERR_ATTRNOTSUPP: + t.fail_support("archive not a supported attribute") + +def testHidden(t, env): + """GETATTR on "hidden" attribute + + FLAGS: getattr all + DEPEND: LOOKFILE + CODE: GATT11b + """ + c = env.c1 + ops = c.use_obj(env.opts.usefile) + ops += [c.getattr([FATTR4_HIDDEN])] + res = c.compound(ops) + check(res, [NFS4_OK, NFS4ERR_ATTRNOTSUPP], "GETATTR(hidden)") + if res.status == NFS4ERR_ATTRNOTSUPP: + t.fail_support("hidden not a supported attribute") + +def testMimetype(t, env): + """GETATTR on "mimetype" attribute + + FLAGS: getattr all + DEPEND: LOOKFILE + CODE: GATT11c + """ + c = env.c1 + ops = c.use_obj(env.opts.usefile) + ops += [c.getattr([FATTR4_MIMETYPE])] + res = c.compound(ops) + check(res, [NFS4_OK, NFS4ERR_ATTRNOTSUPP], "GETATTR(mimetype)") + if res.status == NFS4ERR_ATTRNOTSUPP: + t.fail_support("mimetype not a supported attribute") + +def testQuotaAvailHard(t, env): + """GETATTR on "quota avail hard" attribute + + FLAGS: getattr all + DEPEND: LOOKFILE + CODE: GATT11d + """ + c = env.c1 + ops = c.use_obj(env.opts.usefile) + ops += [c.getattr([FATTR4_QUOTA_AVAIL_HARD])] + res = c.compound(ops) + check(res, [NFS4_OK, NFS4ERR_ATTRNOTSUPP], "GETATTR(quota_avail_hard)") + if res.status == NFS4ERR_ATTRNOTSUPP: + t.fail_support("quota_avail_hard not a supported attribute") + +def testQuotaAvailSoft(t, env): + """GETATTR on "quota avail soft" attribute + + FLAGS: getattr all + DEPEND: LOOKFILE + CODE: GATT11e + """ + c = env.c1 + ops = c.use_obj(env.opts.usefile) + ops += [c.getattr([FATTR4_QUOTA_AVAIL_SOFT])] + res = c.compound(ops) + check(res, [NFS4_OK, NFS4ERR_ATTRNOTSUPP], "GETATTR(quota_avail_soft)") + if res.status == NFS4ERR_ATTRNOTSUPP: + t.fail_support("quota_avail_soft not a supported attribute") + +def testQuotaUsed(t, env): + """GETATTR on "quota used" attribute + + FLAGS: getattr all + DEPEND: LOOKFILE + CODE: GATT11f + """ + c = env.c1 + ops = c.use_obj(env.opts.usefile) + ops += [c.getattr([FATTR4_QUOTA_USED])] + res = c.compound(ops) + check(res, [NFS4_OK, NFS4ERR_ATTRNOTSUPP], "GETATTR(quota_used)") + if res.status == NFS4ERR_ATTRNOTSUPP: + t.fail_support("quota_used not a supported attribute") + +def testSystem(t, env): + """GETATTR on "system" attribute + + FLAGS: getattr all + DEPEND: LOOKFILE + CODE: GATT11g + """ + c = env.c1 + ops = c.use_obj(env.opts.usefile) + ops += [c.getattr([FATTR4_SYSTEM])] + res = c.compound(ops) + check(res, [NFS4_OK, NFS4ERR_ATTRNOTSUPP], "GETATTR(system)") + if res.status == NFS4ERR_ATTRNOTSUPP: + t.fail_support("system not a supported attribute") + +def testTimeBackup(t, env): + """GETATTR on "time backup" attribute + + FLAGS: getattr all + DEPEND: LOOKFILE + CODE: GATT11h + """ + c = env.c1 + ops = c.use_obj(env.opts.usefile) + ops += [c.getattr([FATTR4_TIME_BACKUP])] + res = c.compound(ops) + check(res, [NFS4_OK, NFS4ERR_ATTRNOTSUPP], "GETATTR(time_backup)") + if res.status == NFS4ERR_ATTRNOTSUPP: + t.fail_support("time_backup not a supported attribute") + +def testTimeAccessSet(t, env): + """GETATTR on "time access set" attribute (write-only) + + FLAGS: getattr all + DEPEND: LOOKFILE + CODE: GATT11i + """ + c = env.c1 + ops = c.use_obj(env.opts.usefile) + ops += [c.getattr([FATTR4_TIME_ACCESS_SET])] + res = c.compound(ops) + check(res, [NFS4ERR_INVAL, NFS4ERR_ATTRNOTSUPP], "GETATTR(time_access_set)") + if res.status == NFS4ERR_ATTRNOTSUPP: + t.fail_support("time_access_set not a supported attribute") + +def testTimeModifySet(t, env): + """GETATTR on "time modify set" attribute (write-only) + + FLAGS: getattr all + DEPEND: LOOKFILE + CODE: GATT11j + """ + c = env.c1 + ops = c.use_obj(env.opts.usefile) + ops += [c.getattr([FATTR4_TIME_MODIFY_SET])] + res = c.compound(ops) + check(res, [NFS4ERR_INVAL, NFS4ERR_ATTRNOTSUPP],"
GETATTR(time_modify_set)")
+ if res.status ==NFS4ERR_ATTRNOTSUPP:
+t.fail_support("time_modify_set not a supported attribute")
####################################################
Signature · 3 lines
Calum Mackay Linux Kernel Engineering Oracle Linux and Virtualisation
Quoted 161 lines · Chuck Lever
From: Chuck Lever <[email protected]>
Linux NFSD does not implement a handful of these NFSv4.0 fattr4 attributes. Ensure that NFSD's fattr4 result encoder is correctly clearing the result mask and returning
NFS4_OK.Signed-off-by Chuck Lever <[email protected]>--- nfs4.0/servertests/st_getattr.py | 149 +++++++++++++++++++++++++++++++ 1 file changed, 149 insertions(+)nfs4.0/servertests/st_getattr.py +142
-0@@ -521,6 +521,155 @@ def testOwnerName(t, env): t.fail_support("owner not a supported attribute") # print(res.resarray[-1].obj_attributes) +def testArchive(t, env): + """GETATTR on "archive" attribute + + FLAGS: getattr all + DEPEND: LOOKFILE + CODE: GATT11a + """ + c = env.c1 + ops = c.use_obj(env.opts.usefile) + ops += [c.getattr([FATTR4_ARCHIVE])] + res = c.compound(ops) + check(res, [NFS4_OK, NFS4ERR_ATTRNOTSUPP], "GETATTR(archive)") + if res.status == NFS4ERR_ATTRNOTSUPP: + t.fail_support("archive not a supported attribute") + +def testHidden(t, env): + """GETATTR on "hidden" attribute + + FLAGS: getattr all + DEPEND: LOOKFILE + CODE: GATT11b + """ + c = env.c1 + ops = c.use_obj(env.opts.usefile) + ops += [c.getattr([FATTR4_HIDDEN])] + res = c.compound(ops) + check(res, [NFS4_OK, NFS4ERR_ATTRNOTSUPP], "GETATTR(hidden)") + if res.status == NFS4ERR_ATTRNOTSUPP: + t.fail_support("hidden not a supported attribute") + +def testMimetype(t, env): + """GETATTR on "mimetype" attribute + + FLAGS: getattr all + DEPEND: LOOKFILE + CODE: GATT11c + """ + c = env.c1 + ops = c.use_obj(env.opts.usefile) + ops += [c.getattr([FATTR4_MIMETYPE])] + res = c.compound(ops) + check(res, [NFS4_OK, NFS4ERR_ATTRNOTSUPP], "GETATTR(mimetype)") + if res.status == NFS4ERR_ATTRNOTSUPP: + t.fail_support("mimetype not a supported attribute") + +def testQuotaAvailHard(t, env): + """GETATTR on "quota avail hard" attribute + + FLAGS: getattr all + DEPEND: LOOKFILE + CODE: GATT11d + """ + c = env.c1 + ops = c.use_obj(env.opts.usefile) + ops += [c.getattr([FATTR4_QUOTA_AVAIL_HARD])] + res = c.compound(ops) + check(res, [NFS4_OK, NFS4ERR_ATTRNOTSUPP], "GETATTR(quota_avail_hard)") + if res.status == NFS4ERR_ATTRNOTSUPP: + t.fail_support("quota_avail_hard not a supported attribute") + +def testQuotaAvailSoft(t, env): + """GETATTR on "quota avail soft" attribute + + FLAGS: getattr all + DEPEND: LOOKFILE + CODE: GATT11e + """ + c = env.c1 + ops = c.use_obj(env.opts.usefile) + ops += [c.getattr([FATTR4_QUOTA_AVAIL_SOFT])] + res = c.compound(ops) + check(res, [NFS4_OK, NFS4ERR_ATTRNOTSUPP], "GETATTR(quota_avail_soft)") + if res.status == NFS4ERR_ATTRNOTSUPP: + t.fail_support("quota_avail_soft not a supported attribute") + +def testQuotaUsed(t, env): + """GETATTR on "quota used" attribute + + FLAGS: getattr all + DEPEND: LOOKFILE + CODE: GATT11f + """ + c = env.c1 + ops = c.use_obj(env.opts.usefile) + ops += [c.getattr([FATTR4_QUOTA_USED])] + res = c.compound(ops) + check(res, [NFS4_OK, NFS4ERR_ATTRNOTSUPP], "GETATTR(quota_used)") + if res.status == NFS4ERR_ATTRNOTSUPP: + t.fail_support("quota_used not a supported attribute") + +def testSystem(t, env): + """GETATTR on "system" attribute + + FLAGS: getattr all + DEPEND: LOOKFILE + CODE: GATT11g + """ + c = env.c1 + ops = c.use_obj(env.opts.usefile) + ops += [c.getattr([FATTR4_SYSTEM])] + res = c.compound(ops) + check(res, [NFS4_OK, NFS4ERR_ATTRNOTSUPP], "GETATTR(system)") + if res.status == NFS4ERR_ATTRNOTSUPP: + t.fail_support("system not a supported attribute") + +def testTimeBackup(t, env): + """GETATTR on "time backup" attribute + + FLAGS: getattr all + DEPEND: LOOKFILE + CODE: GATT11h + """ + c = env.c1 + ops = c.use_obj(env.opts.usefile) + ops += [c.getattr([FATTR4_TIME_BACKUP])] + res = c.compound(ops) + check(res, [NFS4_OK, NFS4ERR_ATTRNOTSUPP], "GETATTR(time_backup)") + if res.status == NFS4ERR_ATTRNOTSUPP: + t.fail_support("time_backup not a supported attribute") + +def testTimeAccessSet(t, env): + """GETATTR on "time access set" attribute (write-only) + + FLAGS: getattr all + DEPEND: LOOKFILE + CODE: GATT11i + """ + c = env.c1 + ops = c.use_obj(env.opts.usefile) + ops += [c.getattr([FATTR4_TIME_ACCESS_SET])] + res = c.compound(ops) + check(res, [NFS4ERR_INVAL, NFS4ERR_ATTRNOTSUPP], "GETATTR(time_access_set)") + if res.status == NFS4ERR_ATTRNOTSUPP: + t.fail_support("time_access_set not a supported attribute") + +def testTimeModifySet(t, env): + """GETATTR on "time modify set" attribute (write-only) + + FLAGS: getattr all + DEPEND: LOOKFILE + CODE: GATT11j + """
nfs4.0/servertests/st_getattr.py def testOwnerName(t, env): · line 675
Quoted 10 lines
nfs4.0/servertests/st_getattr.py +7
-0+ c = env.c1 + ops = c.use_obj(env.opts.usefile) + ops += [c.getattr([FATTR4_TIME_MODIFY_SET])] + res = c.compound(ops) + check(res, [NFS4ERR_INVAL, NFS4ERR_ATTRNOTSUPP], "GETATTR(time_modify_set)") + if res.status == NFS4ERR_ATTRNOTSUPP: + t.fail_support("time_modify_set not a supported attribute") ####################################################