From 74fee343349035e8ec460ea507d9243670fdea61 Mon Sep 17 00:00:00 2001 From: Artom Lifshitz Date: Wed, 1 Feb 2023 10:18:20 -0500 Subject: [PATCH] Add func test for compute 2.94 The only thing that changes in 2.94 is server-side validation of the ``hostname`` parameter, so no client-side changes are needed other than to bump novaclient's max supported microversion (see dependent patch), but it's still nice to have a test to assert that osc pipes through the correct value to the Nova API. Change-Id: Id1049965150c46fe972733d6194b78d996c6e5d3 Depends-on: https://review.opendev.org/c/openstack/python-novaclient/+/872418 --- .../tests/functional/compute/v2/test_server.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/openstackclient/tests/functional/compute/v2/test_server.py b/openstackclient/tests/functional/compute/v2/test_server.py index 37183a7916..5ae96c3344 100644 --- a/openstackclient/tests/functional/compute/v2/test_server.py +++ b/openstackclient/tests/functional/compute/v2/test_server.py @@ -1050,6 +1050,24 @@ class ServerTests(common.ComputeTestCase): # check the volume is in 'available' status self.assertEqual('available', cmd_output['status']) + def test_server_create_with_fqdn_hostname(self): + server_name = uuid.uuid4().hex + server = self.openstack( + '--os-compute-api-version 2.94 ' + + 'server create ' + + '--flavor ' + self.flavor_name + ' ' + + '--image ' + self.image_name + ' ' + + '--nic none ' + + '--hostname test.example.com' + + server_name, + parse_output=True, + ) + self.assertIsNotNone(server["id"]) + self.addCleanup(self.openstack, 'server delete --wait ' + server_name) + self.wait_for_status(server_name, "ACTIVE") + self.assertEqual('test.example.com', + server['OS-EXT-SRV-ATTR:hostname']) + def test_server_create_with_none_network(self): """Test server create with none network option.""" server_name = uuid.uuid4().hex