Пример #1
0
class TestNeutronUtil(object):
    '''
    测试网络部分的功能与内容
    '''
    def setUp(self):
        endpoint_url = cfg.get(u'neutron', u'os_url')
        self.neutronUtil = NeutronUtil(endpoint_url=endpoint_url, token=token)

    def tearDown(self):
        self.neutronUtil = None

    def testCreateNetWork(self):
        print u'执行创建网络测试'
        networkList = (
            {
                'name': 'firstnet',
                'admin_state_up': True
            },
            {
                'name': 'secondnet',
                'admin_state_up': True
            },
            {
                'name': 'thirdnet',
                'admin_state_up': True
            },
        )
        self.neutronUtil.createNetwork(networkList)
        netNames = (network['name'] for network in networkList)
        for net in self.neutronUtil.getNetworkByName(netNames):
            self.assertIsNotNone(net)
Пример #2
0
class TestNeutronUtil(object):
    '''
    测试网络部分的功能与内容
    '''
    def setUp(self):
        endpoint_url=cfg.get(u'neutron',u'os_url')
        self.neutronUtil=NeutronUtil(endpoint_url=endpoint_url,token=token)
    def tearDown(self):
        self.neutronUtil=None

    def testCreateNetWork(self):
        print u'执行创建网络测试'
        networkList=({'name':'firstnet','admin_state_up':True},{'name':'secondnet','admin_state_up':True},
                     {'name':'thirdnet','admin_state_up':True},)
        self.neutronUtil.createNetwork(networkList)
        netNames=(network['name'] for network in networkList)
        for net in self.neutronUtil.getNetworkByName(netNames):
            self.assertIsNotNone(net)
Пример #3
0
 def setUp(self):
     endpoint_url = cfg.get(u'neutron', u'os_url')
     self.neutronUtil = NeutronUtil(endpoint_url=endpoint_url, token=token)
Пример #4
0
 def setUp(self):
     endpoint_url=cfg.get(u'neutron',u'os_url')
     self.neutronUtil=NeutronUtil(endpoint_url=endpoint_url,token=token)