From f1345dc06f91177ced17f102bcdaaa126fe12568 Mon Sep 17 00:00:00 2001 From: Bence Romsics Date: Tue, 7 Mar 2017 15:54:31 +0100 Subject: Make MAC address of port updatable openstackclient does not allow the update of a port's MAC address. However this is possible in neutron API (though by default policy it is an admin-only operation). Allow it in openstackclient too. Change-Id: Ibd9e0a6fbd1d0d461b8a8daee24dbb7c3f929df6 Closes-Bug: #1670707 --- .../tests/functional/network/v2/test_port.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'openstackclient/tests/functional/network') diff --git a/openstackclient/tests/functional/network/v2/test_port.py b/openstackclient/tests/functional/network/v2/test_port.py index 78c57273..bd5eefa5 100644 --- a/openstackclient/tests/functional/network/v2/test_port.py +++ b/openstackclient/tests/functional/network/v2/test_port.py @@ -147,3 +147,22 @@ class PortTests(base.TestCase): 'port show -f json ' + self.NAME )) self.assertEqual('', json_output.get('security_group_ids')) + + def test_port_admin_set(self): + """Test create, set (as admin), show, delete""" + json_output = json.loads(self.openstack( + 'port create -f json ' + + '--network ' + self.NETWORK_NAME + ' ' + self.NAME + )) + id_ = json_output.get('id') + self.addCleanup(self.openstack, 'port delete ' + id_) + + raw_output = self.openstack( + '--os-username admin ' + + 'port set --mac-address 11:22:33:44:55:66 ' + + self.NAME) + self.assertOutput('', raw_output) + json_output = json.loads(self.openstack( + 'port show -f json ' + self.NAME + )) + self.assertEqual(json_output.get('mac_address'), '11:22:33:44:55:66') -- cgit v1.2.1