From 4e1320c4235476d7e2a0a90f80997e8371c5f399 Mon Sep 17 00:00:00 2001 From: Tim Rozet Date: Wed, 30 Nov 2016 11:03:02 -0500 Subject: Adds declaring disk device to use on overcloud nodes Now in inventory file a user can declare 'disk_device' which will allow the user to specify which disk on their overcloud server to use for installation. The variable can be a comma delimited list, which will search in order post-introspection for the first device on the node that exists. The default disk used will be sda for deployments. Currently defining a per node disk is not supported by OSCLI, so although defined that way in Apex inventory, only the last definition will be used for all nodes. Other changes include: - Various fixes in inventory parsing - Makes bash writing a common function - Introspection now enabled for baremetal deployments JIRA: APEX-296 Change-Id: I330d91eb17408ccfceb7a99c25edbae5ce6d848d Signed-off-by: Tim Rozet --- tests/test_apex_inventory.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'tests') diff --git a/tests/test_apex_inventory.py b/tests/test_apex_inventory.py index 08a34152..ec75856b 100644 --- a/tests/test_apex_inventory.py +++ b/tests/test_apex_inventory.py @@ -7,12 +7,16 @@ # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## +import sys + from apex.inventory import Inventory from apex.inventory import InventoryException from nose.tools import assert_is_instance from nose.tools import assert_raises from nose.tools import assert_equal +from nose.tools import assert_regexp_matches +from io import StringIO inventory_files = ('intel_pod2_settings.yaml', 'nokia_pod1_settings.yaml', @@ -59,3 +63,19 @@ class TestInventory(object): e = InventoryException("test") print(e) assert_is_instance(e, InventoryException) + + def test_dump_bash_default(self): + i = Inventory('../config/inventory/intel_pod2_settings.yaml') + out = StringIO() + sys.stdout = out + i.dump_bash() + output = out.getvalue().strip() + assert_regexp_matches(output, 'root_disk_list=sda') + + def test_dump_bash_set_root_device(self): + i = Inventory('../config/inventory/pod_example_settings.yaml') + out = StringIO() + sys.stdout = out + i.dump_bash() + output = out.getvalue().strip() + assert_regexp_matches(output, 'root_disk_list=sdb') -- cgit 1.2.3-korg