Beispiel #1
0
def testStaleStateid(t, env):
    """WRITE with stale stateid should return NFS4ERR_STALE_STATEID

    FLAGS: write staleid all
    DEPEND: MKFILE
    CODE: WRT11
    """
    c = env.c1
    c.init_connection()
    fh, stateid = c.create_confirm(t.code)
    res = c.write_file(fh, _text, 0, makeStaleId(stateid))
    check(res, NFS4ERR_STALE_STATEID, "WRITE with stale stateid")
Beispiel #2
0
def testStaleStateid(t, env):
    """OPENDOWNGRADE with stale stateid should return NFS4ERR_STALE_STATEID

    FLAGS: opendowngrade staleid all
    DEPEND: MKFILE
    CODE: OPDG6
    """
    c = env.c1
    c.init_connection()
    fh, stateid = c.create_confirm(t.code)
    res = c.downgrade_file(t.code, fh, makeStaleId(stateid))
    check(res, NFS4ERR_STALE_STATEID, "OPENDOWNGRADE with stale stateid")
Beispiel #3
0
def testStaleStateid(t, env):
    """CLOSE with stale stateid should return NFS4ERR_STALE_STATEID

    FLAGS: close staleid all
    DEPEND: MKFILE
    CODE: CLOSE6
    """
    c = env.c1
    c.init_connection()
    fh, stateid = c.create_confirm(t.code)
    res = c.close_file(t.code, fh, makeStaleId(stateid))
    check(res, NFS4ERR_STALE_STATEID, "CLOSE with a stale stateid")
Beispiel #4
0
def testStaleStateid(t, env):
    """WRITE with stale stateid should return NFS4ERR_STALE_STATEID

    FLAGS: write staleid all
    DEPEND: MKFILE
    CODE: WRT11
    """
    c = env.c1
    c.init_connection()
    fh, stateid = c.create_confirm(t.code)
    res = c.write_file(fh, _text, 0, makeStaleId(stateid))
    check(res, NFS4ERR_STALE_STATEID, "WRITE with stale stateid")
Beispiel #5
0
def testStaleStateid(t, env):
    """READ with stale stateid should return NFS4ERR_STALE_STATEID

    FLAGS: read staleid all
    DEPEND: MKFILE
    CODE: RD10
    """
    c = env.c1
    c.init_connection()
    fh, stateid = c.create_confirm(t.code)
    res = c.read_file(fh, stateid=makeStaleId(stateid))
    check(res, NFS4ERR_STALE_STATEID, "READ with stale stateid")
Beispiel #6
0
def testStaleStateid(t, env):
    """CLOSE with stale stateid should return NFS4ERR_STALE_STATEID

    FLAGS: close staleid all
    DEPEND: MKFILE
    CODE: CLOSE6
    """
    c = env.c1
    c.init_connection()
    fh, stateid = c.create_confirm(t.code)
    res = c.close_file(t.code, fh, makeStaleId(stateid))
    check(res, NFS4ERR_STALE_STATEID, "CLOSE with a stale stateid")
Beispiel #7
0
def testStaleStateid(t, env):
    """OPENDOWNGRADE with stale stateid should return NFS4ERR_STALE_STATEID

    FLAGS: opendowngrade staleid all
    DEPEND: MKFILE
    CODE: OPDG6
    """
    c = env.c1
    c.init_connection()
    fh, stateid = c.create_confirm(t.code)
    res = c.downgrade_file(t.code, fh, makeStaleId(stateid))
    check(res, NFS4ERR_STALE_STATEID, "OPENDOWNGRADE with stale stateid")
Beispiel #8
0
def testStaleOpenStateid(t, env):
    """LOCK with stale openstateid should return NFS4ERR_STALE_STATEID

    FLAGS: lock staleid all
    DEPEND: MKFILE
    CODE: LOCK12b
    """
    c = env.c1
    c.init_connection()
    fh, stateid = c.create_confirm(t.code)
    res = c.lock_file(t.code, fh, makeStaleId(stateid))
    check(res, NFS4ERR_STALE_STATEID, "LOCK with stale openstateid",
          [NFS4ERR_BAD_STATEID, NFS4ERR_OLD_STATEID])
Beispiel #9
0
def testStaleOpenStateid(t, env):
    """LOCK with stale openstateid should return NFS4ERR_STALE_STATEID

    FLAGS: lock staleid all
    DEPEND: MKFILE
    CODE: LOCK12b
    """
    c = env.c1
    c.init_connection()
    fh, stateid = c.create_confirm(t.code)
    res = c.lock_file(t.code, fh, makeStaleId(stateid))
    check(res, NFS4ERR_STALE_STATEID, "LOCK with stale openstateid",
          [NFS4ERR_BAD_STATEID, NFS4ERR_OLD_STATEID])
Beispiel #10
0
def testStaleStateid(t, env):
    """OPEN_CONFIRM with a stale state should return NFS4ERR_STALE_STATEID

    FLAGS: openconfirm staleid all
    CODE: OPCF6
    """
    c = env.c1
    c.init_connection()
    res = c.create_file(t.code)
    check(res)
    stateid = res.resarray[-2].switch.switch.stateid
    fh = res.resarray[-1].switch.switch.object
    res = _confirm(t, c, fh, makeStaleId(stateid))
    check(res, NFS4ERR_STALE_STATEID, "OPEN_CONFIRM with a stale state")
Beispiel #11
0
def testStaleStateid(t, env):
    """OPEN_CONFIRM with a stale state should return NFS4ERR_STALE_STATEID

    FLAGS: openconfirm staleid all
    CODE: OPCF6
    """
    c = env.c1
    c.init_connection()
    res = c.create_file(t.code)
    check(res)
    stateid = res.resarray[-2].arm.arm.stateid
    fh = res.resarray[-1].arm.arm.object
    res = _confirm(t, c, fh, makeStaleId(stateid))
    check(res, NFS4ERR_STALE_STATEID, "OPEN_CONFIRM with a stale state")
Beispiel #12
0
def testStaleLockStateid(t, env):
    """LOCKU with stale lockstateid should return NFS4ERR_STALE_STATEID

    FLAGS: locku staleid all
    DEPEND: MKFILE
    CODE: LKU9
    """
    c = env.c1
    c.init_connection()
    fh, stateid = c.create_confirm(t.code)
    res1 = c.lock_file(t.code, fh, stateid)
    check(res1)
    res2 = c.unlock_file(1, fh, makeStaleId(res1.lockid))
    check(res2, NFS4ERR_STALE_STATEID, "LOCKU with stale lockstateid", [NFS4ERR_BAD_STATEID, NFS4ERR_OLD_STATEID])
Beispiel #13
0
def testStaleLockStateid(t, env):
    """LOCKU with stale lockstateid should return NFS4ERR_STALE_STATEID

    FLAGS: locku staleid all
    DEPEND: MKFILE
    CODE: LKU9
    """
    c = env.c1
    c.init_connection()
    fh, stateid = c.create_confirm(t.code)
    res1 = c.lock_file(t.code, fh, stateid)
    check(res1)
    res2 = c.unlock_file(1, fh, makeStaleId(res1.lockid))
    check(res2, NFS4ERR_STALE_STATEID, "LOCKU with stale lockstateid",
          [NFS4ERR_BAD_STATEID, NFS4ERR_OLD_STATEID])