Merge "Skip python3 package installation on CentOS servers"

This commit is contained in:
Zuul 2020-11-23 15:56:00 +00:00 committed by Gerrit Code Review
commit 1eac0e0b9a
2 changed files with 1 additions and 30 deletions

View File

@ -16,7 +16,6 @@ from __future__ import absolute_import
import tobiko
from tobiko import config
from tobiko.openstack import glance
from tobiko.openstack import nova
from tobiko.openstack.stacks import _nova
@ -50,10 +49,3 @@ class CentosServerStackFixture(_nova.ServerStackFixture):
#: Flavor used to create a Nova server instance
flavor_stack = tobiko.required_setup_fixture(CentosFlavorStackFixture)
#: Install Python3 package by default
@property
def cloud_config(self):
return nova.cloud_config(
super(CentosServerStackFixture, self).cloud_config,
packages=['python3'])

View File

@ -15,13 +15,9 @@
# under the License.
from __future__ import absolute_import
import six
import yaml
import tobiko
from tobiko.shell import sh
from tobiko.openstack import keystone
from tobiko.openstack import nova
from tobiko.openstack import stacks
from tobiko.tests.functional.openstack.stacks import test_cirros
@ -33,26 +29,9 @@ class CentosServerStackTest(test_cirros.CirrosServerStackTest):
#: Stack of resources with a server attached to a floating IP
stack = tobiko.required_setup_fixture(stacks.CentosServerStackFixture)
def test_cloud_config(self):
cloud_config = self.stack.cloud_config
self.assertIn('python3', cloud_config['packages'])
def test_user_data(self):
user_data = self.stack.user_data
self.assertIsInstance(user_data, six.string_types)
self.assertTrue(user_data.startswith('#cloud-config\n'), user_data)
self.assertEqual(self.stack.cloud_config, yaml.load(user_data))
def test_platform_python3(self):
def test_platform_python(self):
python_version = sh.execute(['/usr/libexec/platform-python',
'--version'],
ssh_client=self.stack.ssh_client).stdout
self.assertTrue(python_version.startswith('Python 3.'),
python_version)
def test_python3(self):
nova.wait_for_cloud_init_done(ssh_client=self.stack.ssh_client)
python_version = sh.execute(['python3', '--version'],
ssh_client=self.stack.ssh_client).stdout
self.assertTrue(python_version.startswith('Python 3.'),
python_version)