本文整理汇总了Python中nfs4lib.test_equal函数的典型用法代码示例。如果您正苦于以下问题:Python test_equal函数的具体用法?Python test_equal怎么用?Python test_equal使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了test_equal函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testCsr_sequence
def testCsr_sequence(t, env):
"""The corresponding result of csa_sequence is csr_sequence,
which MUST be equal to csa_sequence.
FLAGS: create_session all
CODE: CSESS24
"""
c = env.c1.new_client(env.testname(t))
# CREATE_SESSION
chan_attrs = channel_attrs4(0,8192,8192,8192,128,8,[])
csa_sequence = c.seqid
sess1 = c.create_session(fore_attrs=chan_attrs)
if not nfs4lib.test_equal(sess1.seqid, csa_sequence, "int"):
fail("Server returns bad csr_sequence which not equal to csa_sequence")
示例2: testReplay1
def testReplay1(t, env):
"""Replay a successful CREATE_SESSION
FLAGS: create_session all
CODE: CSESS5
"""
c = env.c1.new_client(env.testname(t))
# CREATE_SESSION
res1 = create_session(c.c, c.clientid, c.seqid)
check(res1)
# REPLAY
res2 = create_session(c.c, c.clientid, c.seqid)
check(res2)
# Test results are equal (ignoring tags)
res1.tag = res2.tag = ""
if not nfs4lib.test_equal(res1, res2):
fail("Replay results not equal")
示例3: testReplay2
def testReplay2(t, env):
"""Replay a unsuccessful CREATE_SESSION
FLAGS: create_session all
DEPEND: CSESS9
CODE: CSESS6
"""
c = env.c1.new_client(env.testname(t), cred=env.cred1)
res1 = create_session(c.c, c.clientid, c.seqid, cred=env.cred2)
check(res1, NFS4ERR_CLID_INUSE)
# REPLAY
res2 = create_session(c.c, c.clientid, c.seqid, cred=env.cred2)
check(res2, NFS4ERR_CLID_INUSE)
# Test results are equal (ignoring tags)
res1.tag = res2.tag = ""
if not nfs4lib.test_equal(res1, res2):
fail("Replay results not equal")
示例4: testMaxreqs
def testMaxreqs(t, env):
"""A CREATE_SESSION with maxreqs too large should return
a modified value
FLAGS: create_session all
CODE: CSESS22
"""
# Assuming this is too large for any server; increase if necessary:
# but too huge will eat many memory for replay_cache, be careful!
TOO_MANY_SLOTS = 500
c = env.c1.new_client(env.testname(t))
# CREATE_SESSION with fore_channel = TOO_MANY_SLOTS
chan_attrs = channel_attrs4(0,8192,8192,8192,128, TOO_MANY_SLOTS, [])
sess1 = c.create_session(fore_attrs=chan_attrs)
if nfs4lib.test_equal(sess1.fore_channel.maxrequests,
chan_attrs.ca_maxrequests, "count4"):
fail("Server allows surprisingly large fore_channel maxreqs")
示例5: testReplay1b
def testReplay1b(t, env):
"""Replay a successful SEQUENCE:CREATE_SESSION without a preceeding SEQUENCE
FLAGS: create_session all
CODE: CSESS5b
"""
c = env.c1.new_client(env.testname(t))
# CREATE_SESSION
sess1 = c.create_session()
# another CREATE_SESSION with SEQUENCE from first session
c.seqid = 2
chan_attrs = channel_attrs4(0,8192,8192,8192,128,8,[])
cs_op = op.create_session(c.clientid, c.seqid, 0,
chan_attrs, chan_attrs, c.c.prog, [])
res1 = sess1.compound([cs_op])
check(res1)
# REPLAY second CREATE_SESSION without SEQUENCE
res2 = create_session(c.c, c.clientid, c.seqid)
check(res2)
# Test results are equal (ignoring tags)
res1.tag = res2.tag = ""
if not nfs4lib.test_equal(res1, res2):
fail("Replay results not equal")
示例6: testReplay1a
def testReplay1a(t, env):
"""Replay a successful CREATE_SESSION with a SEQUENCE from a different session
FLAGS: create_session all
CODE: CSESS5a
"""
c = env.c1.new_client(env.testname(t))
# CREATE_SESSION
sess1 = c.create_session()
# another CREATE_SESSION
c.seqid = 2
chan_attrs = channel_attrs4(0,8192,8192,8192,128,8,[])
sec = [callback_sec_parms4(0)]
res1 = create_session(c.c, c.clientid, c.seqid)
check(res1)
# REPLAY first CREATE_SESSION with SEQUENCE from 2nd session
cs_op = op.create_session(c.clientid, c.seqid, 0,
chan_attrs, chan_attrs, c.c.prog, sec)
res2 = sess1.compound([cs_op])
check(res2)
# Test results are equal (ignoring tags)
res1.tag = res2.tag = ""
if not nfs4lib.test_equal(res1, res2):
fail("Replay results not equal")