Пример #1
0
def testContrivedReplay(t, env):
    """Server is supposed to create a contrived replay result

    FLAGS: create_session all
    CODE: CSESS4
    """
    c = env.c1.new_client(env.testname(t))
    # CREATE_SESSION
    res = create_session(c.c, c.clientid, nfs4lib.dec_u32(c.seqid))
    check(res, NFS4ERR_SEQ_MISORDERED)
Пример #2
0
def testContrivedReplay(t, env):
    """Server is supposed to create a contrived replay result

    FLAGS: create_session all
    CODE: CSESS4
    """
    c = env.c1.new_client(env.testname(t))
    # CREATE_SESSION
    res = create_session(c.c, c.clientid,
                         nfs4lib.dec_u32(c.seqid))
    check(res, NFS4ERR_SEQ_MISORDERED)
Пример #3
0
def testBadSeqnum2(t, env):
    """Send too small seqnum
    
    FLAGS: create_session all
    CODE: CSESS8
    """
    c = env.c1.new_client(env.testname(t))
    res1 = create_session(c.c, c.clientid, c.seqid)
    check(res1)
    # REPLAY
    badseqid = nfs4lib.dec_u32(c.seqid)
    res2 = create_session(c.c, c.clientid, badseqid)
    check(res2, NFS4ERR_SEQ_MISORDERED)
Пример #4
0
def testBadSeqnum2(t, env):
    """Send too small seqnum
    
    FLAGS: create_session all
    CODE: CSESS8
    """
    c = env.c1.new_client(env.testname(t))
    res1 = create_session(c.c, c.clientid, c.seqid)
    check(res1)
    # REPLAY
    badseqid = nfs4lib.dec_u32(c.seqid)
    res2 = create_session(c.c, c.clientid, badseqid)
    check(res2, NFS4ERR_SEQ_MISORDERED)
Пример #5
0
def testBadSequenceidAtSlot(t, env):
    """ If the difference between sa_sequenceid and the server's cached
        sequence ID at the slot ID is two (2) or more, or if sa_sequenceid
        is less than the cached sequence ID , server MUST return
        NFS4ERR_SEQ_MISORDERED. rfc5661 18.46.3

    FLAGS: sequence all
    CODE: SEQ13
    """
    c = env.c1.new_client(env.testname(t))
    # CREATE_SESSION
    sess1 = c.create_session()

    sid = sess1.sessionid
    res = c.c.compound([op.sequence(sid, 1, 2, 3, True)])
    check(res)

    seqid = res.resarray[0].sr_sequenceid
    # SEQUENCE with bad sr_sequenceid
    res = c.c.compound([op.sequence(sid, seqid + 2, 2, 3, True)])
    check(res, NFS4ERR_SEQ_MISORDERED)

    res = c.c.compound([op.sequence(sid, nfs4lib.dec_u32(seqid), 2, 3, True)])
    check(res, NFS4ERR_SEQ_MISORDERED)
Пример #6
0
def testBadSequenceidAtSlot(t, env):
    """ If the difference between sa_sequenceid and the server's cached
        sequence ID at the slot ID is two (2) or more, or if sa_sequenceid
        is less than the cached sequence ID , server MUST return
        NFS4ERR_SEQ_MISORDERED. rfc5661 18.46.3

    FLAGS: sequence all
    CODE: SEQ13
    """
    c = env.c1.new_client(env.testname(t))
    # CREATE_SESSION
    sess1 = c.create_session()

    sid = sess1.sessionid
    res = c.c.compound([op.sequence(sid, 1, 2, 3, True)])
    check(res)

    seqid = res.resarray[0].sr_sequenceid
    # SEQUENCE with bad sr_sequenceid
    res = c.c.compound([op.sequence(sid, seqid + 2, 2, 3, True)])
    check(res, NFS4ERR_SEQ_MISORDERED)

    res = c.c.compound([op.sequence(sid, nfs4lib.dec_u32(seqid), 2, 3, True)])
    check(res, NFS4ERR_SEQ_MISORDERED)