Merge "fix functional tests for network agents"
This commit is contained in:
commit
339ab40ee6
@ -168,7 +168,7 @@ class SetNetworkAgent(command.Command):
|
|||||||
|
|
||||||
def take_action(self, parsed_args):
|
def take_action(self, parsed_args):
|
||||||
client = self.app.client_manager.network
|
client = self.app.client_manager.network
|
||||||
obj = client.get_agent(parsed_args.network_agent, ignore_missing=False)
|
obj = client.get_agent(parsed_args.network_agent)
|
||||||
attrs = {}
|
attrs = {}
|
||||||
if parsed_args.description is not None:
|
if parsed_args.description is not None:
|
||||||
attrs['description'] = str(parsed_args.description)
|
attrs['description'] = str(parsed_args.description)
|
||||||
@ -193,7 +193,7 @@ class ShowNetworkAgent(command.ShowOne):
|
|||||||
|
|
||||||
def take_action(self, parsed_args):
|
def take_action(self, parsed_args):
|
||||||
client = self.app.client_manager.network
|
client = self.app.client_manager.network
|
||||||
obj = client.get_agent(parsed_args.network_agent, ignore_missing=False)
|
obj = client.get_agent(parsed_args.network_agent)
|
||||||
columns = tuple(sorted(list(obj.keys())))
|
columns = tuple(sorted(list(obj.keys())))
|
||||||
data = utils.get_item_properties(obj, columns, formatters=_formatters,)
|
data = utils.get_item_properties(obj, columns, formatters=_formatters,)
|
||||||
return columns, data
|
return columns, data
|
||||||
|
@ -10,8 +10,6 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import testtools
|
|
||||||
|
|
||||||
from openstackclient.tests.functional import base
|
from openstackclient.tests.functional import base
|
||||||
|
|
||||||
|
|
||||||
@ -28,13 +26,11 @@ class NetworkAgentTests(base.TestCase):
|
|||||||
# get the list of network agent IDs.
|
# get the list of network agent IDs.
|
||||||
cls.IDs = raw_output.split('\n')
|
cls.IDs = raw_output.split('\n')
|
||||||
|
|
||||||
@testtools.skip('broken SDK testing')
|
|
||||||
def test_network_agent_show(self):
|
def test_network_agent_show(self):
|
||||||
opts = self.get_opts(self.FIELDS)
|
opts = self.get_opts(self.FIELDS)
|
||||||
raw_output = self.openstack('network agent show ' + self.IDs[0] + opts)
|
raw_output = self.openstack('network agent show ' + self.IDs[0] + opts)
|
||||||
self.assertEqual(self.IDs[0] + "\n", raw_output)
|
self.assertEqual(self.IDs[0] + "\n", raw_output)
|
||||||
|
|
||||||
@testtools.skip('broken SDK testing')
|
|
||||||
def test_network_agent_set(self):
|
def test_network_agent_set(self):
|
||||||
opts = self.get_opts(['admin_state_up'])
|
opts = self.get_opts(['admin_state_up'])
|
||||||
self.openstack('network agent set --disable ' + self.IDs[0])
|
self.openstack('network agent set --disable ' + self.IDs[0])
|
||||||
|
@ -324,6 +324,6 @@ class TestShowNetworkAgent(TestNetworkAgent):
|
|||||||
columns, data = self.cmd.take_action(parsed_args)
|
columns, data = self.cmd.take_action(parsed_args)
|
||||||
|
|
||||||
self.network.get_agent.assert_called_once_with(
|
self.network.get_agent.assert_called_once_with(
|
||||||
self._network_agent.id, ignore_missing=False)
|
self._network_agent.id)
|
||||||
self.assertEqual(self.columns, columns)
|
self.assertEqual(self.columns, columns)
|
||||||
self.assertEqual(list(self.data), list(data))
|
self.assertEqual(list(self.data), list(data))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user