summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudiu Belu <cbelu@cloudbasesolutions.com>2017-08-29 04:14:55 -0700
committerClaudiu Belu <cbelu@cloudbasesolutions.com>2017-09-01 14:59:00 +0000
commit45e252c159dc75d644f88581cfe14e0049242ef8 (patch)
tree9cfec182f02de67b8268bc6ad68fd155e397b0b4
parent7467321d6a2665c5da56dc75801add663653f639 (diff)
Fixes vNUMA resize negative test
When an asymmetric NUMA topology is required, all the NUMA cells have to be explicitly described. Nova will reject a request to build / resize an instance if it doesn't fit into the available NUMA topology. If the compute nodes only have 1 NUMA node, an instance spanning 2 NUMA nodes cannot be built. Change-Id: I054ad6f567771f12ccf92f690ecd9bb18c4fa532
Notes
Notes (review): Code-Review+2: Lucian Petrut <lpetrut@cloudbasesolutions.com> Code-Review+2: Claudiu Belu <cbelu@cloudbasesolutions.com> Workflow+1: Claudiu Belu <cbelu@cloudbasesolutions.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Fri, 01 Sep 2017 16:13:12 +0000 Reviewed-on: https://review.openstack.org/498761 Project: openstack/oswin-tempest-plugin Branch: refs/heads/master
-rw-r--r--oswin_tempest_plugin/config.py5
-rw-r--r--oswin_tempest_plugin/tests/scenario/test_vnuma.py27
2 files changed, 30 insertions, 2 deletions
diff --git a/oswin_tempest_plugin/config.py b/oswin_tempest_plugin/config.py
index 4ac2d6e..93b34a3 100644
--- a/oswin_tempest_plugin/config.py
+++ b/oswin_tempest_plugin/config.py
@@ -56,6 +56,11 @@ HyperVGroup = [
56 default=False, 56 default=False,
57 help="RemoteFX feature is enabled and supported on the " 57 help="RemoteFX feature is enabled and supported on the "
58 "compute nodes."), 58 "compute nodes."),
59 cfg.IntOpt('available_numa_nodes',
60 default=1,
61 help="The maximum number of NUMA cells the compute nodes "
62 "have. If it's less than 2, resize negative tests for "
63 "vNUMA will be skipped."),
59] 64]
60 65
61 66
diff --git a/oswin_tempest_plugin/tests/scenario/test_vnuma.py b/oswin_tempest_plugin/tests/scenario/test_vnuma.py
index 2b95294..3f89e2b 100644
--- a/oswin_tempest_plugin/tests/scenario/test_vnuma.py
+++ b/oswin_tempest_plugin/tests/scenario/test_vnuma.py
@@ -13,11 +13,16 @@
13# License for the specific language governing permissions and limitations 13# License for the specific language governing permissions and limitations
14# under the License. 14# under the License.
15 15
16import testtools
17
18from oswin_tempest_plugin import config
16from oswin_tempest_plugin.tests._mixins import migrate 19from oswin_tempest_plugin.tests._mixins import migrate
17from oswin_tempest_plugin.tests._mixins import optional_feature 20from oswin_tempest_plugin.tests._mixins import optional_feature
18from oswin_tempest_plugin.tests._mixins import resize 21from oswin_tempest_plugin.tests._mixins import resize
19from oswin_tempest_plugin.tests import test_base 22from oswin_tempest_plugin.tests import test_base
20 23
24CONF = config.CONF
25
21 26
22class HyperVvNumaTestCase(test_base.TestBase, 27class HyperVvNumaTestCase(test_base.TestBase,
23 migrate._MigrateMixin, 28 migrate._MigrateMixin,
@@ -32,5 +37,23 @@ class HyperVvNumaTestCase(test_base.TestBase,
32 _BIGGER_FLAVOR = {'ram': 128, 'extra_specs': {'hw:numa_nodes': '1'}} 37 _BIGGER_FLAVOR = {'ram': 128, 'extra_specs': {'hw:numa_nodes': '1'}}
33 38
34 # NOTE(claudiub): Hyper-V does not support asymmetric NUMA topologies. 39 # NOTE(claudiub): Hyper-V does not support asymmetric NUMA topologies.
35 _FEATURE_FLAVOR = {'ram': '128', 'extra_specs': { 40 # The resize should fail in this case.
36 'hw:numa_nodes': '2', 'hw:numa_mem.0': '128'}} 41 _BAD_FLAVOR = {'ram': 64, 'extra_specs': {
42 'hw:numa_nodes': '2', 'hw:numa_mem.0': '64', 'hw:numa_cpus.0': '0'}}
43
44 @testtools.skipUnless(CONF.hyperv.available_numa_nodes > 1,
45 'At least 2 NUMA nodes are required.')
46 @testtools.skipUnless(CONF.compute_feature_enabled.resize,
47 'Resize is not available.')
48 def test_resize_negative(self):
49 new_flavor = self._create_new_flavor(self._get_flavor_ref(),
50 self._BAD_FLAVOR)
51
52 # NOTE(claudiub): all NUMA nodes have to be properly defined.
53 vcpus = [i for i in range(1, int(new_flavor['vcpus']))]
54 extra_specs = {'hw:numa_mem.1': str(int(new_flavor['ram']) - 64),
55 'hw:numa_cpus.1': ','.join(vcpus)}
56 self.admin_flavors_client.set_flavor_extra_spec(
57 new_flavor['id'], **extra_specs)
58
59 self._check_resize(new_flavor['id'], expected_fail=True)