Beispiel #1
0
def testZeroLengthForLNK(t, env):
    """CREATE with zero length name should return NFS4ERR_INVAL

    FLAGS: create symlink all
    CODE: CR9a
    """
    c = env.c1
    ops = c.go_home()
    objtype = createtype4(NF4LNK, **{'linkdata':''})
    ops += [c.create_op(objtype, t.code, getDefaultAttr(c))]
    res = c.compound(ops)
    check(res, [NFS4ERR_INVAL, NFS4ERR_NOENT], "CREATE with zero-length name for SYMLINK")
Beispiel #2
0
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>")
Beispiel #3
0
def testZeroLengthForLNK(t, env):
    """CREATE with zero length name should return NFS4ERR_INVAL

    FLAGS: create symlink all
    CODE: CR9a
    """
    c = env.c1
    ops = c.go_home()
    objtype = createtype4(NF4LNK, **{'linkdata':''})
    ops += [c.create_op(objtype, t.code, getDefaultAttr(c))]
    res = c.compound(ops)
    checklist(res, [NFS4ERR_INVAL, NFS4ERR_NOENT], "CREATE with zero-length name for SYMLINK")
Beispiel #4
0
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>")
Beispiel #5
0
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)
Beispiel #6
0
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)