diff options
author | Dan Radez <dradez@redhat.com> | 2016-12-21 19:39:51 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2016-12-21 19:39:51 +0000 |
commit | 6a6e2dee30562e14a99bf979b65e6817ad08d75a (patch) | |
tree | b257d9833d2623a619341d5de7c25964f80b029f /tests | |
parent | ffb4f46e5ea022e0688cce672395f2dde409e88e (diff) | |
parent | 4e1320c4235476d7e2a0a90f80997e8371c5f399 (diff) |
Merge "Adds declaring disk device to use on overcloud nodes"
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_apex_inventory.py | 20 |
1 files changed, 20 insertions, 0 deletions
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') |