• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python nfs4lib.test_equal函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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")
开发者ID:kofemann,项目名称:pynfs,代码行数:14,代码来源:st_create_session.py


示例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")
开发者ID:kofemann,项目名称:pynfs,代码行数:17,代码来源:st_create_session.py


示例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")
开发者ID:kofemann,项目名称:pynfs,代码行数:17,代码来源:st_create_session.py


示例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")
开发者ID:kofemann,项目名称:pynfs,代码行数:18,代码来源:st_create_session.py


示例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")
开发者ID:mauser,项目名称:pynfs,代码行数:23,代码来源:st_create_session.py


示例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")
开发者ID:kofemann,项目名称:pynfs,代码行数:24,代码来源:st_create_session.py



注:本文中的nfs4lib.test_equal函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python nfvo.check_tenant函数代码示例发布时间:2022-05-27
下一篇:
Python nfqueue.queue函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap