def CASE2( self, main ): """ Configure Network Subnet Port """ import os try: from tests.FUNCovsdbtestL3.dependencies.Nbdata import NetworkData from tests.FUNCovsdbtestL3.dependencies.Nbdata import SubnetData from tests.FUNCovsdbtestL3.dependencies.Nbdata import VirtualPortData from tests.FUNCovsdbtestL3.dependencies.Nbdata import RouterData from tests.FUNCovsdbtestL3.dependencies.Nbdata import RouterInterfaceData 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( "Configure Network Subnet Port Start" ) main.case( "Configure Network Subnet Port" ) main.caseExplanation = "Configure Network Subnet Port " +\ "Verify post is OK" ctrlip = os.getenv( main.params['CTRL']['ip1'] ) httpport = main.params['HTTP']['port'] path = main.params['HTTP']['path'] main.step( "Generate Post Data of Inner Network" ) network = NetworkData() network.id = '1000000000000002' network.tenant_id = '1000000000000001' subnet1 = SubnetData() subnet1.id = "1000000000000003" subnet1.tenant_id = network.tenant_id subnet1.network_id = network.id subnet1.gateway_ip = '192.168.33.254' subnet1.start = "192.168.33.1" subnet1.end = "192.168.33.254" subnet1.cidr = "192.168.33.0/24" subnet2 = SubnetData() subnet2.id = "1000000000000004" subnet2.tenant_id = network.tenant_id subnet2.network_id = network.id subnet2.gateway_ip = '192.168.44.254' subnet2.start = "192.168.44.1" subnet2.end = "192.168.44.254" subnet2.cidr = "192.168.44.0/24" port1 = VirtualPortData() port1.id = "00000000-0000-0000-0000-000000000001" port1.subnet_id = subnet1.id port1.tenant_id = network.tenant_id port1.network_id = network.id port1.macAddress = "00:00:00:00:00:01" port1.ip_address = "192.168.33.1" port2 = VirtualPortData() port2.id = "00000000-0000-0000-0000-000000000002" port2.subnet_id = subnet2.id port2.tenant_id = network.tenant_id port2.network_id = network.id port2.macAddress = "00:00:00:00:00:02" port2.ip_address = "192.168.44.1" router = RouterData() router.id = '1000000000000010' router.network_id = network.id router.tenant_id = network.tenant_id main.step("Generate Post Data of Inner RouteInterface") riport1 = VirtualPortData() riport1.state = 'DOWN' riport1.id = "00000000-0000-0000-0000-000000000004" riport1.subnet_id = subnet1.id riport1.tenant_id = network.tenant_id riport1.network_id = network.id riport1.ip_address = '192.168.33.254' riport1.macAddress = "00:00:00:00:00:04" riport1.deviceId = router.id riport2 = VirtualPortData() riport2.state = 'DOWN' riport2.id = "00000000-0000-0000-0000-000000000005" riport2.subnet_id = subnet2.id riport2.tenant_id = network.tenant_id riport2.network_id = network.id riport2.ip_address = '192.168.44.254' riport2.macAddress = "00:00:00:00:00:05" riport2.deviceId = router.id routerinterface1 = RouterInterfaceData() routerinterface1.id = riport1.deviceId routerinterface1.subnet_id = riport1.subnet_id routerinterface1.tenant_id = riport1.tenant_id routerinterface1.port_id = riport1.id routerinterface2 = RouterInterfaceData() routerinterface2.id = riport2.deviceId routerinterface2.subnet_id = riport2.subnet_id routerinterface2.tenant_id = riport2.tenant_id routerinterface2.port_id = riport2.id networkpostdata = network.DictoJson() subnet1postdata = subnet1.DictoJson() subnet2postdata = subnet2.DictoJson() port1postdata = port1.DictoJson() port2postdata = port2.DictoJson() routerpostdata = router.DictoJson() riportpostdata1 = riport1.DictoJson() routerinterfacedata1 = routerinterface1.DictoJson() riportpostdata2 = riport2.DictoJson() routerinterfacedata2 = routerinterface2.DictoJson() main.step( "Post Network Data via HTTP(Post port need post network)" ) Poststatus, result = main.ONOSrest.send( ctrlip, httpport, '', path + 'networks/', 'POST', None, networkpostdata ) utilities.assert_equals( expect='200', actual=Poststatus, onpass="******", onfail="Post Network Failed " + str( Poststatus ) + "," + str( result ) ) main.step( "Post Subnet1 Data via HTTP(Post port need post subnet)" ) Poststatus, result = main.ONOSrest.send( ctrlip, httpport, '', path + 'subnets/', 'POST', None, subnet1postdata ) utilities.assert_equals( expect='202', actual=Poststatus, onpass="******", onfail="Post Subnet1 Failed " + str( Poststatus ) + "," + str( result ) ) main.step( "Post Subnet2 Data via HTTP(Post port need post subnet)" ) Poststatus, result = main.ONOSrest.send( ctrlip, httpport, '', path + 'subnets/', 'POST', None, subnet2postdata ) utilities.assert_equals( expect='202', actual=Poststatus, onpass="******", onfail="Post Subnet2 Failed " + str( Poststatus ) + "," + str( result ) ) main.step( "Post Port1 Data via HTTP" ) Poststatus, result = main.ONOSrest.send( ctrlip, httpport, '', path + 'ports/', 'POST', None, port1postdata ) utilities.assert_equals( expect='200', actual=Poststatus, onpass="******" + str(port1postdata), onfail="Post Port1 Failed " + str( Poststatus ) + "," + str( result ) ) main.step( "Post Port2 Data via HTTP" ) Poststatus, result = main.ONOSrest.send( ctrlip, httpport, '', path + 'ports/', 'POST', None, port2postdata ) utilities.assert_equals( expect='200', actual=Poststatus, onpass="******", onfail="Post Port2 Failed " + str( Poststatus ) + "," + str( result ) ) main.step( "Post Router Data via HTTP" ) Poststatus, result = main.ONOSrest.send( ctrlip, httpport, '', path + 'routers/', 'POST', None, routerpostdata ) utilities.assert_equals( expect='201', actual=Poststatus, onpass="******", onfail="Post Router Failed " + str( Poststatus ) + "," + str( result ) ) main.step( "Post RIPort1 Data via HTTP" ) Poststatus, result = main.ONOSrest.send( ctrlip, httpport, '', path + 'ports/', 'POST', None, riportpostdata1 ) utilities.assert_equals( expect='200', actual=Poststatus, onpass="******", onfail="Post RIPort1 Failed " + str( Poststatus ) + "," + str( result ) ) main.step( "Post RouterInterface1 Data via HTTP") Poststatus, result = main.ONOSrest.send( ctrlip, httpport, '', path + 'routers/' + router.id + '/add_router_interface/', 'PUT', None, routerinterfacedata1 ) utilities.assert_equals( expect='200', actual=Poststatus, onpass="******", onfail="Post RouterInterface1 Failed " + str( Poststatus ) + "," + str( result ) ) main.step( "Post RIPort2 Data via HTTP" ) Poststatus, result = main.ONOSrest.send( ctrlip, httpport, '', path + 'ports/', 'POST', None, riportpostdata2 ) utilities.assert_equals( expect='200', actual=Poststatus, onpass="******", onfail="Post RIPort2 Failed " + str( Poststatus ) + "," + str( result ) ) main.step( "Post RouterInterface2 Data via HTTP") Poststatus, result = main.ONOSrest.send( ctrlip, httpport, '', path + 'routers/' + router.id + '/add_router_interface/', 'PUT', None, routerinterfacedata2 ) utilities.assert_equals( expect='200', actual=Poststatus, onpass="******", onfail="Post RouterInterface2 Failed " + str( Poststatus ) + "," + str( result ) )
def CASE2( self, main ): """ Configure Network Subnet Port """ import os try: from tests.FUNCovsdbtestL3.dependencies.Nbdata import NetworkData from tests.FUNCovsdbtestL3.dependencies.Nbdata import SubnetData from tests.FUNCovsdbtestL3.dependencies.Nbdata import VirtualPortData from tests.FUNCovsdbtestL3.dependencies.Nbdata import RouterData from tests.FUNCovsdbtestL3.dependencies.Nbdata import RouterInterfaceData from tests.FUNCovsdbtestL3.dependencies.Nbdata import FloatingIpData 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( "Configure Network Subnet Port Start" ) main.case( "Configure Network Subnet Port" ) main.caseExplanation = "Configure Network Subnet Port " +\ "Verify post is OK" ctrlip = os.getenv( main.params['CTRL']['ip1'] ) httpport = main.params['HTTP']['port'] path = main.params['HTTP']['path'] main.step( "Generate Post Data of Inner Network" ) network = NetworkData() network.id = '1000000000000002' network.tenant_id = '1000000000000001' subnet1 = SubnetData() subnet1.id = "1000000000000003" subnet1.tenant_id = network.tenant_id subnet1.network_id = network.id subnet1.gateway_ip = '192.168.33.254' subnet1.start = "192.168.33.1" subnet1.end = "192.168.33.254" subnet1.cidr = "192.168.33.0/24" subnet2 = SubnetData() subnet2.id = "1000000000000004" subnet2.tenant_id = network.tenant_id subnet2.network_id = network.id subnet2.gateway_ip = '192.168.44.254' subnet2.start = "192.168.44.1" subnet2.end = "192.168.44.254" subnet2.cidr = "192.168.44.0/24" port1 = VirtualPortData() port1.id = "00000000-0000-0000-0000-000000000001" port1.subnet_id = subnet1.id port1.tenant_id = network.tenant_id port1.network_id = network.id port1.macAddress = "00:00:00:00:00:01" port1.ip_address = "192.168.33.1" port2 = VirtualPortData() port2.id = "00000000-0000-0000-0000-000000000002" port2.subnet_id = subnet2.id port2.tenant_id = network.tenant_id port2.network_id = network.id port2.macAddress = "00:00:00:00:00:02" port2.ip_address = "192.168.44.1" main.step("Generate Post Data of Ext Network") exnetwork = NetworkData() exnetwork.id = '1000000000000011' exnetwork.tenant_id = '1000000000000001' exsubnet = SubnetData() exsubnet.id = "1000000000000012" exsubnet.tenant_id = exnetwork.tenant_id exsubnet.network_id = exnetwork.id exsubnet.gateway_ip = '172.16.0.1' exsubnet.start = "172.16.0.1" exsubnet.end = "172.16.0.254" exsubnet.cidr = "172.16.0.0/24" rgwport = VirtualPortData() rgwport.id = "00000000-0000-0000-0000-000000000003" rgwport.subnet_id = exsubnet.id rgwport.tenant_id = exnetwork.tenant_id rgwport.network_id = exnetwork.id rgwport.macAddress = "00:00:00:00:00:03" rgwport.ip_address = "172.16.0.100" rgwport.deviceId = '1000000000000010' exgwport = VirtualPortData() exgwport.id = "00000000-0000-0000-0000-100000000011" exgwport.subnet_id = exsubnet.id exgwport.tenant_id = exnetwork.tenant_id exgwport.network_id = exnetwork.id exgwport.macAddress = "52:54:00:d0:bf:31" #exgwport.macAddress = "00:00:00:00:10:11" exgwport.ip_address = "172.16.0.1" exgwport.deviceId = None router = RouterData() router.id = '1000000000000010' router.network_id = exnetwork.id router.tenant_id = network.tenant_id router.subnet_id = exsubnet.id router.ip_address = '172.16.0.100' router.gw_port_id = rgwport.id main.step("Generate Post Data of Inner RouteInterface") riport1 = VirtualPortData() riport1.state = 'DOWN' riport1.id = "00000000-0000-0000-0000-000000000004" riport1.subnet_id = subnet1.id riport1.tenant_id = network.tenant_id riport1.network_id = network.id riport1.ip_address = '192.168.33.254' riport1.macAddress = "00:00:00:00:00:04" riport1.deviceId = router.id riport2 = VirtualPortData() riport2.state = 'DOWN' riport2.id = "00000000-0000-0000-0000-000000000005" riport2.subnet_id = subnet2.id riport2.tenant_id = network.tenant_id riport2.network_id = network.id riport2.ip_address = '192.168.44.254' riport2.macAddress = "00:00:00:00:00:05" riport2.deviceId = router.id routerinterface1 = RouterInterfaceData() routerinterface1.id = riport1.deviceId routerinterface1.subnet_id = riport1.subnet_id routerinterface1.tenant_id = riport1.tenant_id routerinterface1.port_id = riport1.id routerinterface2 = RouterInterfaceData() routerinterface2.id = riport2.deviceId routerinterface2.subnet_id = riport2.subnet_id routerinterface2.tenant_id = riport2.tenant_id routerinterface2.port_id = riport2.id main.step("Generate Post Data of Inner FloatingIp") flport = VirtualPortData() flport.id = "9352e05c-58b8-4f2c-b4df-c20435ser56466" flport.subnet_id = exsubnet.id flport.tenant_id = exnetwork.tenant_id flport.network_id = exnetwork.id flport.deviceId = '91a546ea-8add-47e7-ad98-15677c74b337' flport.macAddress = "00:00:00:00:00:06" flport.ip_address = "172.16.0.101" #export1 = VirtualPortData() #export1.id = "00000000-0000-0000-0000-100000000001" #export1.subnet_id = exsubnet.id #export1.tenant_id = exnetwork.tenant_id #export1.network_id = exnetwork.id #export1.macAddress = "00:00:00:00:10:01" #export1.ip_address = "192.168.22.4" floatingip = FloatingIpData() floatingip.id = flport.deviceId floatingip.floating_network_id = exnetwork.id floatingip.tenant_id = router.tenant_id floatingip.floating_ip_address = '172.16.0.101' floatingip.router_id = router.id #floatingip.port_id = flport.id floatingip.port_id = port1.id floatingip.fixed_ip_address = '192.168.33.1' networkpostdata = network.DictoJson() subnet1postdata = subnet1.DictoJson() subnet2postdata = subnet2.DictoJson() port1postdata = port1.DictoJson() port2postdata = port2.DictoJson() exnetworkpostdata = exnetwork.DictoJson() exsubnetpostdata = exsubnet.DictoJson() rgwportpostdata = rgwport.DictoJson() exgwportpostdata = exgwport.DictoJson() routerpostdata = router.DictoJson() riportpostdata1 = riport1.DictoJson() routerinterfacedata1 = routerinterface1.DictoJson() riportpostdata2 = riport2.DictoJson() routerinterfacedata2 = routerinterface2.DictoJson() flportpostdata = flport.DictoJson() #export1postdata = export1.DictoJson() floatingippostdata = floatingip.DictoJson() main.step( "Post Network Data via HTTP(Post port need post network)" ) Poststatus, result = main.ONOSrest.send( ctrlip, httpport, '', path + 'networks/', 'POST', None, networkpostdata ) utilities.assert_equals( expect='200', actual=Poststatus, onpass="******", onfail="Post Network Failed " + str( Poststatus ) + "," + str( result ) ) main.step( "Post Subnet1 Data via HTTP(Post port need post subnet)" ) Poststatus, result = main.ONOSrest.send( ctrlip, httpport, '', path + 'subnets/', 'POST', None, subnet1postdata ) utilities.assert_equals( expect='202', actual=Poststatus, onpass="******", onfail="Post Subnet1 Failed " + str( Poststatus ) + "," + str( result ) ) main.step( "Post Subnet2 Data via HTTP(Post port need post subnet)" ) Poststatus, result = main.ONOSrest.send( ctrlip, httpport, '', path + 'subnets/', 'POST', None, subnet2postdata ) utilities.assert_equals( expect='202', actual=Poststatus, onpass="******", onfail="Post Subnet2 Failed " + str( Poststatus ) + "," + str( result ) ) main.step( "Post Port1 Data via HTTP" ) Poststatus, result = main.ONOSrest.send( ctrlip, httpport, '', path + 'ports/', 'POST', None, port1postdata ) utilities.assert_equals( expect='200', actual=Poststatus, onpass="******" + str(port1postdata), onfail="Post Port1 Failed " + str( Poststatus ) + "," + str( result ) ) main.step( "Post Port2 Data via HTTP" ) Poststatus, result = main.ONOSrest.send( ctrlip, httpport, '', path + 'ports/', 'POST', None, port2postdata ) utilities.assert_equals( expect='200', actual=Poststatus, onpass="******", onfail="Post Port2 Failed " + str( Poststatus ) + "," + str( result ) ) main.step( "Post ExNetwork Data via HTTP(Post port need post network)" ) Poststatus, result = main.ONOSrest.send( ctrlip, httpport, '', path + 'networks/', 'POST', None, exnetworkpostdata ) utilities.assert_equals( expect='200', actual=Poststatus, onpass="******", onfail="Post ExNetwork Failed " + str( Poststatus ) + "," + str( result ) ) main.step( "Post ExSubnet Data via HTTP(Post port need post subnet)" ) Poststatus, result = main.ONOSrest.send( ctrlip, httpport, '', path + 'subnets/', 'POST', None, exsubnetpostdata ) utilities.assert_equals( expect='202', actual=Poststatus, onpass="******", onfail="Post ExSubnet Failed " + str( Poststatus ) + "," + str( result ) ) main.step( "Post GwPort Data via HTTP" ) Poststatus, result = main.ONOSrest.send( ctrlip, httpport, '', path + 'ports/', 'POST', None, rgwportpostdata ) utilities.assert_equals( expect='200', actual=Poststatus, onpass="******", onfail="Post GwPort Failed " + str( Poststatus ) + "," + str( result ) ) main.step( "Post exPort Data via HTTP" ) Poststatus, result = main.ONOSrest.send( ctrlip, httpport, '', path + 'ports/', 'POST', None, exgwportpostdata ) utilities.assert_equals( expect='200', actual=Poststatus, onpass="******", onfail="Post exPort Failed " + str( Poststatus ) + "," + str( result ) ) main.step( "Post Router Data via HTTP" ) Poststatus, result = main.ONOSrest.send( ctrlip, httpport, '', path + 'routers/', 'POST', None, routerpostdata ) utilities.assert_equals( expect='201', actual=Poststatus, onpass="******", onfail="Post Router Failed " + str( Poststatus ) + "," + str( result ) ) main.step( "Post RIPort1 Data via HTTP" ) Poststatus, result = main.ONOSrest.send( ctrlip, httpport, '', path + 'ports/', 'POST', None, riportpostdata1 ) utilities.assert_equals( expect='200', actual=Poststatus, onpass="******", onfail="Post RIPort1 Failed " + str( Poststatus ) + "," + str( result ) ) main.step( "Post RouterInterface1 Data via HTTP") Poststatus, result = main.ONOSrest.send( ctrlip, httpport, '', path + 'routers/' + router.id + '/add_router_interface/', 'PUT', None, routerinterfacedata1 ) utilities.assert_equals( expect='200', actual=Poststatus, onpass="******", onfail="Post RouterInterface1 Failed " + str( Poststatus ) + "," + str( result ) ) main.step( "Post RIPort2 Data via HTTP" ) Poststatus, result = main.ONOSrest.send( ctrlip, httpport, '', path + 'ports/', 'POST', None, riportpostdata2 ) utilities.assert_equals( expect='200', actual=Poststatus, onpass="******", onfail="Post RIPort2 Failed " + str( Poststatus ) + "," + str( result ) ) main.step( "Post RouterInterface2 Data via HTTP") Poststatus, result = main.ONOSrest.send( ctrlip, httpport, '', path + 'routers/' + router.id + '/add_router_interface/', 'PUT', None, routerinterfacedata2 ) utilities.assert_equals( expect='200', actual=Poststatus, onpass="******", onfail="Post RouterInterface2 Failed " + str( Poststatus ) + "," + str( result ) ) main.step( "Post FLPort Data via HTTP" ) Poststatus, result = main.ONOSrest.send( ctrlip, httpport, '', path + 'ports/', 'POST', None, flportpostdata ) utilities.assert_equals( expect='200', actual=Poststatus, onpass="******", onfail="Post FLPort Failed " + str( Poststatus ) + "," + str( result ) ) main.step( "Post FloatingIp Data via HTTP" ) Poststatus, result = main.ONOSrest.send( ctrlip, httpport, '', path + 'floatingips/', 'POST', None, floatingippostdata ) utilities.assert_equals( expect='201', actual=Poststatus, onpass="******", onfail="Post FloatingIp Failed " + str( Poststatus ) + "," + str( result ) ) """
def CASE2( self, main ): """ Configure Network Subnet Port """ import os try: from tests.FUNCovsdbtestL3.dependencies.Nbdata import NetworkData from tests.FUNCovsdbtestL3.dependencies.Nbdata import SubnetData from tests.FUNCovsdbtestL3.dependencies.Nbdata import VirtualPortData from tests.FUNCovsdbtestL3.dependencies.Nbdata import RouterData from tests.FUNCovsdbtestL3.dependencies.Nbdata import RouterInterfaceData from tests.FUNCovsdbtestL3.dependencies.Nbdata import FloatingIpData 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( "Configure Network Subnet Port Start" ) main.case( "Configure Network Subnet Port" ) main.caseExplanation = "Configure Network Subnet Port " +\ "Verify post is OK" ctrlip = os.getenv( main.params['CTRL']['ip1'] ) httpport = main.params['HTTP']['port'] path = main.params['HTTP']['path'] main.step( "Generate Post Data of Inner Network" ) network = NetworkData() network.id = '1000000000000002' network.tenant_id = '1000000000000001' subnet1 = SubnetData() subnet1.id = "1000000000000003" subnet1.tenant_id = network.tenant_id subnet1.network_id = network.id subnet1.gateway_ip = '192.168.33.254' subnet1.start = "192.168.33.1" subnet1.end = "192.168.33.254" subnet1.cidr = "192.168.33.0/24" subnet2 = SubnetData() subnet2.id = "1000000000000004" subnet2.tenant_id = network.tenant_id subnet2.network_id = network.id subnet2.gateway_ip = '192.168.44.254' subnet2.start = "192.168.44.1" subnet2.end = "192.168.44.254" subnet2.cidr = "192.168.44.0/24" port1 = VirtualPortData() port1.id = "00000000-0000-0000-0000-000000000001" port1.subnet_id = subnet1.id port1.tenant_id = network.tenant_id port1.network_id = network.id port1.macAddress = "00:00:00:00:00:01" port1.ip_address = "192.168.33.1" port2 = VirtualPortData() port2.id = "00000000-0000-0000-0000-000000000002" port2.subnet_id = subnet2.id port2.tenant_id = network.tenant_id port2.network_id = network.id port2.macAddress = "00:00:00:00:00:02" port2.ip_address = "192.168.44.1" """ main.step("Generate Post Data of Ext Network") exnetwork = NetworkData() exnetwork.id = '1000000000000011' exnetwork.tenant_id = '1000000000000001' exsubnet = SubnetData() exsubnet.id = "1000000000000012" exsubnet.tenant_id = exnetwork.tenant_id exsubnet.network_id = exnetwork.id exsubnet.gateway_ip = '192.168.22.254' gwport = VirtualPortData() gwport.id = "00000000-0000-0000-0000-000000000003" gwport.subnet_id = exsubnet.id gwport.tenant_id = exnetwork.tenant_id gwport.network_id = exnetwork.id gwport.macAddress = "00:00:00:00:00:03" gwport.device_id = '1000000000000010' """ router = RouterData() router.id = '1000000000000010' router.network_id = network.id router.tenant_id = network.tenant_id #router.subnet_id = exsubnet.id #router.ip_address = '192.168.22.33' #router.gw_port_id = gwport.id main.step("Generate Post Data of Inner RouteInterface") riport1 = VirtualPortData() riport1.state = 'DOWN' riport1.id = "00000000-0000-0000-0000-000000000004" riport1.subnet_id = subnet1.id riport1.tenant_id = network.tenant_id riport1.network_id = network.id riport1.ip_address = '192.168.33.254' riport1.macAddress = "00:00:00:00:00:04" riport1.deviceId = router.id riport2 = VirtualPortData() riport2.state = 'DOWN' riport2.id = "00000000-0000-0000-0000-000000000005" riport2.subnet_id = subnet2.id riport2.tenant_id = network.tenant_id riport2.network_id = network.id riport2.ip_address = '192.168.44.254' riport2.macAddress = "00:00:00:00:00:05" riport2.deviceId = router.id routerinterface1 = RouterInterfaceData() routerinterface1.id = riport1.deviceId routerinterface1.subnet_id = riport1.subnet_id routerinterface1.tenant_id = riport1.tenant_id routerinterface1.port_id = riport1.id routerinterface2 = RouterInterfaceData() routerinterface2.id = riport2.deviceId routerinterface2.subnet_id = riport2.subnet_id routerinterface2.tenant_id = riport2.tenant_id routerinterface2.port_id = riport2.id """ main.step("Generate Post Data of Inner FloatingIp") flport = VirtualPortData() flport.id = "9352e05c-58b8-4f2c-b4df-c20435ser56466" flport.subnet_id = subnet1.id flport.tenant_id = network.tenant_id flport.network_id = network.id flport.device_Id = '91a546ea-8add-47e7-ad98-15677c74b337' flport.macAddress = "00:00:00:00:00:06" floatingip = FloatingIpData() floatingip.id = flport.device_Id floatingip.floating_network_id = flport.network_id floatingip.tenant_id = router.tenant_id floatingip.floating_ip_address = '192.168.22.4' floatingip.router_id = router.id floatingip.port_id = flport.id floatingip.fixed_ip_address = '10.0.0.1' """ networkpostdata = network.DictoJson() subnet1postdata = subnet1.DictoJson() subnet2postdata = subnet2.DictoJson() port1postdata = port1.DictoJson() port2postdata = port2.DictoJson() #exnetworkpostdata = exnetwork.DictoJson() #exsubnetpostdata = exsubnet.DictoJson() #gwportpostdata = gwport.DictoJson() routerpostdata = router.DictoJson() riportpostdata1 = riport1.DictoJson() routerinterfacedata1 = routerinterface1.DictoJson() riportpostdata2 = riport2.DictoJson() routerinterfacedata2 = routerinterface2.DictoJson() #flportpostdata = flport.DictoJson() #floatingippostdata = floatingip.DictoJson() main.step( "Post Network Data via HTTP(Post port need post network)" ) Poststatus, result = main.ONOSrest.send( ctrlip, httpport, '', path + 'networks/', 'POST', None, networkpostdata ) utilities.assert_equals( expect='200', actual=Poststatus, onpass="******", onfail="Post Network Failed " + str( Poststatus ) + "," + str( result ) ) main.step( "Post Subnet1 Data via HTTP(Post port need post subnet)" ) Poststatus, result = main.ONOSrest.send( ctrlip, httpport, '', path + 'subnets/', 'POST', None, subnet1postdata ) utilities.assert_equals( expect='202', actual=Poststatus, onpass="******", onfail="Post Subnet1 Failed " + str( Poststatus ) + "," + str( result ) ) main.step( "Post Subnet2 Data via HTTP(Post port need post subnet)" ) Poststatus, result = main.ONOSrest.send( ctrlip, httpport, '', path + 'subnets/', 'POST', None, subnet2postdata ) utilities.assert_equals( expect='202', actual=Poststatus, onpass="******", onfail="Post Subnet2 Failed " + str( Poststatus ) + "," + str( result ) ) main.step( "Post Port1 Data via HTTP" ) Poststatus, result = main.ONOSrest.send( ctrlip, httpport, '', path + 'ports/', 'POST', None, port1postdata ) utilities.assert_equals( expect='200', actual=Poststatus, onpass="******" + str(port1postdata), onfail="Post Port1 Failed " + str( Poststatus ) + "," + str( result ) ) main.step( "Post Port2 Data via HTTP" ) Poststatus, result = main.ONOSrest.send( ctrlip, httpport, '', path + 'ports/', 'POST', None, port2postdata ) utilities.assert_equals( expect='200', actual=Poststatus, onpass="******", onfail="Post Port2 Failed " + str( Poststatus ) + "," + str( result ) ) """ main.step( "Post ExNetwork Data via HTTP(Post port need post network)" ) Poststatus, result = main.ONOSrest.send( ctrlip, httpport, '', path + 'networks/', 'POST', None, exnetworkpostdata ) utilities.assert_equals( expect='200', actual=Poststatus, onpass="******", onfail="Post ExNetwork Failed " + str( Poststatus ) + "," + str( result ) ) main.step( "Post ExSubnet Data via HTTP(Post port need post subnet)" ) Poststatus, result = main.ONOSrest.send( ctrlip, httpport, '', path + 'subnets/', 'POST', None, exsubnetpostdata ) utilities.assert_equals( expect='202', actual=Poststatus, onpass="******", onfail="Post ExSubnet Failed " + str( Poststatus ) + "," + str( result ) ) main.step( "Post GwPort Data via HTTP" ) Poststatus, result = main.ONOSrest.send( ctrlip, httpport, '', path + 'ports/', 'POST', None, gwportpostdata ) utilities.assert_equals( expect='200', actual=Poststatus, onpass="******", onfail="Post GwPort Failed " + str( Poststatus ) + "," + str( result ) ) """ main.step( "Post Router Data via HTTP" ) Poststatus, result = main.ONOSrest.send( ctrlip, httpport, '', path + 'routers/', 'POST', None, routerpostdata ) utilities.assert_equals( expect='201', actual=Poststatus, onpass="******", onfail="Post Router Failed " + str( Poststatus ) + "," + str( result ) ) main.step( "Post RIPort1 Data via HTTP" ) Poststatus, result = main.ONOSrest.send( ctrlip, httpport, '', path + 'ports/', 'POST', None, riportpostdata1 ) utilities.assert_equals( expect='200', actual=Poststatus, onpass="******", onfail="Post RIPort1 Failed " + str( Poststatus ) + "," + str( result ) ) main.step( "Post RouterInterface1 Data via HTTP") Poststatus, result = main.ONOSrest.send( ctrlip, httpport, '', path + 'routers/' + router.id + '/add_router_interface/', 'PUT', None, routerinterfacedata1 ) utilities.assert_equals( expect='200', actual=Poststatus, onpass="******", onfail="Post RouterInterface1 Failed " + str( Poststatus ) + "," + str( result ) ) main.step( "Post RIPort2 Data via HTTP" ) Poststatus, result = main.ONOSrest.send( ctrlip, httpport, '', path + 'ports/', 'POST', None, riportpostdata2 ) utilities.assert_equals( expect='200', actual=Poststatus, onpass="******", onfail="Post RIPort2 Failed " + str( Poststatus ) + "," + str( result ) ) main.step( "Post RouterInterface2 Data via HTTP") Poststatus, result = main.ONOSrest.send( ctrlip, httpport, '', path + 'routers/' + router.id + '/add_router_interface/', 'PUT', None, routerinterfacedata2 ) utilities.assert_equals( expect='200', actual=Poststatus, onpass="******", onfail="Post RouterInterface2 Failed " + str( Poststatus ) + "," + str( result ) ) """