first commit
This commit is contained in:
commit
4893f26802
0
README.rst
Normal file
0
README.rst
Normal file
0
wan_qos/__init__.py
Normal file
0
wan_qos/__init__.py
Normal file
0
wan_qos/agent/__init__.py
Normal file
0
wan_qos/agent/__init__.py
Normal file
0
wan_qos/agent/ovsdb/__init__.py
Normal file
0
wan_qos/agent/ovsdb/__init__.py
Normal file
29
wan_qos/agent/ovsdb/impl_idl.py
Normal file
29
wan_qos/agent/ovsdb/impl_idl.py
Normal file
@ -0,0 +1,29 @@
|
||||
# Copyright (c) 2015 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from neutron.agent.ovsdb import api
|
||||
from neutron.agent.ovsdb import impl_idl
|
||||
from neutron.agent.ovsdb.native import commands as cmd
|
||||
from neutron.agent.ovsdb.native import connection
|
||||
from neutron.agent.ovsdb.native import idlutils
|
||||
from neutron.agent.ovsdb.native import vlog
|
||||
|
||||
|
||||
class OvsdbQosIdl(impl_idl.OvsdbIdl):
|
||||
def __init__(self, context, conn, timeout):
|
||||
super(OvsdbQosIdl, self).__init__(context)
|
||||
self.ovsdb_connection = connection.Connection(conn,
|
||||
timeout,
|
||||
'Open_vSwitch')
|
||||
|
0
wan_qos/db/__init__.py
Normal file
0
wan_qos/db/__init__.py
Normal file
0
wan_qos/tests/__init__.py
Normal file
0
wan_qos/tests/__init__.py
Normal file
0
wan_qos/tests/unit/__init__.py
Normal file
0
wan_qos/tests/unit/__init__.py
Normal file
0
wan_qos/tests/unit/ovsdb/__init__.py
Normal file
0
wan_qos/tests/unit/ovsdb/__init__.py
Normal file
40
wan_qos/tests/unit/ovsdb/test_ovsdb.py
Normal file
40
wan_qos/tests/unit/ovsdb/test_ovsdb.py
Normal file
@ -0,0 +1,40 @@
|
||||
# Copyright (c) 2016 Red Hat, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
import testtools
|
||||
|
||||
from neutron.tests import base
|
||||
|
||||
import wan_qos.agent.ovsdb.impl_idl as impl_idl
|
||||
import wan_qos.agent.ovsdb.commands as cmd
|
||||
|
||||
|
||||
class OvsdbIdlTestCase(base.BaseTestCase):
|
||||
def setUp(self):
|
||||
super(OvsdbIdlTestCase, self).setUp()
|
||||
self.vsctl_timeout = 10
|
||||
self.ovsdb_idl = impl_idl.OvsdbQosIdl(self, 'tcp:127.0.0.1:6640', 30)
|
||||
self.ovsdb_idl.ovsdb_connection.start()
|
||||
self.idl = self.ovsdb_idl.ovsdb_connection.idl
|
||||
|
||||
def test1(self):
|
||||
assert self.ovsdb_idl.br_exists('tc-br').execute()==True
|
||||
|
||||
def get_queue_list(self):
|
||||
print (cmd.GetQueueIdList(self.ovsdb_idl, 'enp1s0f1').execute())
|
||||
|
||||
def add_queue(self):
|
||||
print (cmd.AddQueue(self.ovsdb_idl, 'enp1s0f1', 1, '1000000', '1000000')
|
||||
.execute())
|
Loading…
x
Reference in New Issue
Block a user