本文整理汇总了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 " )