Merge "Add compute personality feature config"
This commit is contained in:
commit
eeac61b911
tempest
@ -13,8 +13,6 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import base64
|
||||
|
||||
import netaddr
|
||||
import testtools
|
||||
|
||||
@ -52,9 +50,6 @@ class ServersTestJSON(base.BaseV2ComputeTest):
|
||||
cls.accessIPv4 = '1.1.1.1'
|
||||
cls.accessIPv6 = '0000:0000:0000:0000:0000:babe:220.12.22.2'
|
||||
cls.name = data_utils.rand_name('server')
|
||||
file_contents = 'This is a test file.'
|
||||
personality = [{'path': '/test.txt',
|
||||
'contents': base64.b64encode(file_contents)}]
|
||||
disk_config = cls.disk_config
|
||||
cls.server_initial = cls.create_test_server(
|
||||
validatable=True,
|
||||
@ -63,7 +58,6 @@ class ServersTestJSON(base.BaseV2ComputeTest):
|
||||
metadata=cls.meta,
|
||||
accessIPv4=cls.accessIPv4,
|
||||
accessIPv6=cls.accessIPv6,
|
||||
personality=personality,
|
||||
disk_config=disk_config)
|
||||
cls.password = cls.server_initial['adminPass']
|
||||
cls.server = (cls.client.show_server(cls.server_initial['id'])
|
||||
|
@ -13,7 +13,6 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import base64
|
||||
import logging
|
||||
|
||||
from six.moves.urllib import parse as urlparse
|
||||
@ -145,16 +144,12 @@ class ServerActionsTestJSON(base.BaseV2ComputeTest):
|
||||
# The server should be rebuilt using the provided image and data
|
||||
meta = {'rebuild': 'server'}
|
||||
new_name = data_utils.rand_name('server')
|
||||
file_contents = 'Test server rebuild.'
|
||||
personality = [{'path': 'rebuild.txt',
|
||||
'contents': base64.b64encode(file_contents)}]
|
||||
password = 'rebuildPassw0rd'
|
||||
rebuilt_server = self.client.rebuild_server(
|
||||
self.server_id,
|
||||
self.image_ref_alt,
|
||||
name=new_name,
|
||||
metadata=meta,
|
||||
personality=personality,
|
||||
adminPass=password)['server']
|
||||
|
||||
# If the server was rebuilt on a different image, restore it to the
|
||||
|
@ -17,17 +17,42 @@ import base64
|
||||
from tempest_lib import exceptions as lib_exc
|
||||
|
||||
from tempest.api.compute import base
|
||||
from tempest import config
|
||||
from tempest import test
|
||||
|
||||
CONF = config.CONF
|
||||
|
||||
|
||||
class ServerPersonalityTestJSON(base.BaseV2ComputeTest):
|
||||
|
||||
@classmethod
|
||||
def skip_checks(cls):
|
||||
super(ServerPersonalityTestJSON, cls).skip_checks()
|
||||
if not CONF.compute_feature_enabled.personality:
|
||||
raise cls.skipException("Nova personality feature disabled")
|
||||
|
||||
@classmethod
|
||||
def setup_clients(cls):
|
||||
super(ServerPersonalityTestJSON, cls).setup_clients()
|
||||
cls.client = cls.servers_client
|
||||
cls.user_client = cls.limits_client
|
||||
|
||||
@test.idempotent_id('3cfe87fd-115b-4a02-b942-7dc36a337fdf')
|
||||
def test_create_server_with_personality(self):
|
||||
file_contents = 'This is a test file.'
|
||||
personality = [{'path': '/test.txt',
|
||||
'contents': base64.b64encode(file_contents)}]
|
||||
self.create_test_server(personality=personality)
|
||||
|
||||
@test.idempotent_id('128966d8-71fc-443c-8cab-08e24114ecc9')
|
||||
def test_rebuild_server_with_personality(self):
|
||||
server_id = self.rebuild_server(None)
|
||||
file_contents = 'Test server rebuild.'
|
||||
personality = [{'path': 'rebuild.txt',
|
||||
'contents': base64.b64encode(file_contents)}]
|
||||
self.client.rebuild_server(server_id, self.image_ref_alt,
|
||||
personality=personality)
|
||||
|
||||
@test.idempotent_id('176cd8c9-b9e8-48ee-a480-180beab292bf')
|
||||
def test_personality_files_exceed_limit(self):
|
||||
# Server creation should fail if greater than the maximum allowed
|
||||
|
@ -66,6 +66,8 @@ class ServersNegativeTestJSON(base.BaseV2ComputeTest):
|
||||
|
||||
@test.attr(type=['negative'])
|
||||
@test.idempotent_id('b8a7235e-5246-4a8f-a08e-b34877c6586f')
|
||||
@testtools.skipUnless(CONF.compute_feature_enabled.personality,
|
||||
'Nova personality feature disabled')
|
||||
def test_personality_file_contents_not_encoded(self):
|
||||
# Use an unencoded file when creating a server with personality
|
||||
|
||||
|
@ -425,6 +425,9 @@ ComputeFeaturesGroup = [
|
||||
cfg.BoolOpt('nova_cert',
|
||||
default=True,
|
||||
help='Does the test environment have the nova cert running?'),
|
||||
cfg.BoolOpt('personality',
|
||||
default=True,
|
||||
help='Does the test environment support server personality'),
|
||||
# TODO(mriedem): Remove preserve_ports once juno-eol happens.
|
||||
cfg.BoolOpt('preserve_ports',
|
||||
default=False,
|
||||
|
Loading…
x
Reference in New Issue
Block a user