diff options
| author | Hongbin Lu <hongbin.lu@huawei.com> | 2017-12-08 22:52:59 +0000 |
|---|---|---|
| committer | Hongbin Lu <hongbin034@gmail.com> | 2018-01-03 21:11:02 +0000 |
| commit | 5fdd0730c88b7a3f65b728c0ea87bb34cbc1d9c4 (patch) | |
| tree | aca35b2cc9cb7afb1dcb217bed2f676427d34453 /openstackclient/tests/unit/network | |
| parent | b13a323128072f6f56619a816f5be165796171a4 (diff) | |
| download | python-openstackclient-5fdd0730c88b7a3f65b728c0ea87bb34cbc1d9c4.tar.gz | |
Allow ports filtering with device_id
Right now, if a neutron port is owned by a container powered by
Kuryr, there is no way to list and filter those ports because
OSC assumed a neutron port is owned by either a server or router.
This patch adds support for that by introducing an option '--device-id'
to the 'port list' command.
Change-Id: Ib1fd27e8d843a99fb02ccabd8a12a24ac27cec9c
Diffstat (limited to 'openstackclient/tests/unit/network')
| -rw-r--r-- | openstackclient/tests/unit/network/v2/test_port.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/openstackclient/tests/unit/network/v2/test_port.py b/openstackclient/tests/unit/network/v2/test_port.py index 3f751818..908177ce 100644 --- a/openstackclient/tests/unit/network/v2/test_port.py +++ b/openstackclient/tests/unit/network/v2/test_port.py @@ -759,6 +759,25 @@ class TestListPort(TestPort): self.assertEqual(self.columns, columns) self.assertEqual(self.data, list(data)) + def test_port_list_device_id_opt(self): + arglist = [ + '--device-id', self._ports[0].device_id, + ] + + verifylist = [ + ('device_id', self._ports[0].device_id) + ] + + parsed_args = self.check_parser(self.cmd, arglist, verifylist) + + columns, data = self.cmd.take_action(parsed_args) + + self.network.ports.assert_called_once_with(**{ + 'device_id': self._ports[0].device_id + }) + self.assertEqual(self.columns, columns) + self.assertEqual(self.data, list(data)) + def test_port_list_device_owner_opt(self): arglist = [ '--device-owner', self._ports[0].device_owner, |
