def testNoFh(t, env): """CREATE should fail with NFS4ERR_NOFILEHANDLE if no (cfh) FLAGS: create emptyfh all DEPEND: CODE: CR8 """ c = env.c1 objtype = createtype4(NF4DIR) ops = [c.create_op(objtype, t.code, getDefaultAttr(c))] res = c.compound(ops) check(res, NFS4ERR_NOFILEHANDLE, "CREATE with no <cfh>")
def _test_create(t, env, type, name, **keywords): c = env.c1 ops = c.go_home() objtype = createtype4(type, **keywords) ops += [c.create_op(objtype, t.code, getDefaultAttr(c))] res = c.compound(ops) if res.status == NFS4ERR_BADTYPE: t.fail_support("CREATE of a %s returns _BADTYPE" % name) elif res.status == NFS4ERR_PERM: t.fail_support("CREATE of a %s returns _PERM" % name) check(res, msg="CREATE in empty dir") # Try again, should get NFS4ERR_EXIST res = c.compound(ops) check(res, NFS4ERR_EXIST)
def _test_create(t, env, type, name, **keywords): c = env.c1 ops = c.go_home() objtype = createtype4(type, **keywords) ops += [c.create_op(objtype, t.code, getDefaultAttr(c))] res = c.compound(ops) if res.status == NFS4ERR_BADTYPE: t.fail_support("CREATE of a %s returns _BADTYPE" % name) elif res.status == NFS4ERR_PERM: t.fail_support("CREATE of a %s returns _PERM"% name) check(res, msg="CREATE in empty dir") # Try again, should get NFS4ERR_EXIST res = c.compound(ops) check(res, NFS4ERR_EXIST)