当前位置: 首页>>代码示例>>Python>>正文


Python NetworkData.admin_state_up方法代码示例

本文整理汇总了Python中tests.FUNCvirNetNB.dependencies.Nbdata.NetworkData.admin_state_up方法的典型用法代码示例。如果您正苦于以下问题:Python NetworkData.admin_state_up方法的具体用法?Python NetworkData.admin_state_up怎么用?Python NetworkData.admin_state_up使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在tests.FUNCvirNetNB.dependencies.Nbdata.NetworkData的用法示例。


在下文中一共展示了NetworkData.admin_state_up方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: CASE11

# 需要导入模块: from tests.FUNCvirNetNB.dependencies.Nbdata import NetworkData [as 别名]
# 或者: from tests.FUNCvirNetNB.dependencies.Nbdata.NetworkData import admin_state_up [as 别名]
    def CASE11 ( self,main ):

        """
        Test Post Error Json Create Network
        """
        import os

        try:
            from tests.FUNCvirNetNB.dependencies.Nbdata import NetworkData
        except ImportError:
            main.log.exception( "Something wrong with import file or code error." )
            main.log.info( "Import Error, please check!" )
            main.cleanup()
            main.exit()

        main.log.info( "ONOS Post Error Json Create Network test Start" )
        main.case( "Virtual Network NBI Test - Network" )
        main.caseExplanation  = "Test Network Post With Error json " +\
                                "The wrong Json can't post network successfully"

        ctrlip = os.getenv( main.params['CTRL']['ip1'] )
        port = main.params['HTTP']['port']
        path = main.params['HTTP']['path']

        main.step( "Generate Post Data" )
        network = NetworkData()
        network.id = '030d6d3d-fa36-45bf-ae2b-4f4bc43a54dc'
        network.tenant_id = '26cd996094344a0598b0a1af1d525cdc'
        #The network.admin_state_up should be True or False,when the admin_state_up is 'tttttttttt',the Json can't post.
        network.admin_state_up = 'tttttttttt'
        #The network.routerExternal should be True or False,when the routerExternal is 'ffffffffffff',the Json can't post.
        network.routerExternal = 'ffffffffffff'
        #The network.shared should be True or False,when the shared is 'ffffffffffffff',the Json can't post.
        network.shared = 'ffffffffffffff'
        postdata = network.DictoJson()

        main.step( "Post Data via HTTP" )
        Poststatus, result = main.ONOSrest.send( ctrlip, port, '', path+'networks/',
                                                'POST', None, postdata)

        utilities.assert_equals(
                expect='500',
                actual=Poststatus,
                onpass="The Json is wrong,can't post",
                onfail="Wrong Json can post successfully " )
开发者ID:castroflavio,项目名称:OnosSystemTest,代码行数:47,代码来源:FUNCvirNetNB.py


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