aboutsummaryrefslogtreecommitdiffstats
path: root/build/f_isoroot/f_kvm-pluginbuild
AgeCommit message (Expand)AuthorFilesLines
2016-09-20[KVM] Install plugin in post-deploymentMichal Skalski1-2/+2
2016-08-24build: cache: Consider UBUNTU_ARCH in .cacheidAlexandru Avadanii1-0/+1
2016-08-19Merge "Claenup"Michal Skalski1-4/+2
2016-08-19[KVM]Add support for Broadcom NetXtremeII 10GbMichal Skalski1-1/+1
2016-08-18Claenupdavidjchou1-4/+2
2016-08-18Update kvm pluginMichal Skalski1-1/+1
2016-07-20Update the commit ID of kvmfornfv upstream for fuel-plugin-kvmdavidjchou1-1/+1
2016-06-29Move fuel plugin builder to DockerfileGuo Ruijing1-2/+0
2016-06-28Add fuel-plugin-kvm to install kvmfornfvdavidjchou2-0/+107
Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
##############################################################################
# Copyright (c) 2016 Dan Radez (Red Hat)
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################

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

inventory_files = ('intel_pod2_settings.yaml',
                   'nokia_pod1_settings.yaml',
                   'pod_example_settings.yaml')


class TestInventory(object):
    @classmethod
    def setup_class(klass):
        """This method is run once for each class before any tests are run"""

    @classmethod
    def teardown_class(klass):
        """This method is run once for each class _after_ all tests are run"""

    def setUp(self):
        """This method is run once before _each_ test method is executed"""

    def teardown(self):
        """This method is run once after _each_ test method is executed"""

    def test_init(self):
        for f in inventory_files:
            i = Inventory('../config/inventory/{}'.format(f))
            assert_equal(i.dump_instackenv_json(), None)

        # test virtual
        i = Inventory(i, virtual=True)
        assert_equal(i.dump_instackenv_json(), None)

        # Remove nodes to violate HA node count
        while len(i['nodes']) >= 5:
            i['nodes'].pop()
        assert_raises(InventoryException,
                      Inventory, i)

        # Remove nodes to violate non-HA node count
        while len(i['nodes']) >= 2:
            i['nodes'].pop()
        assert_raises(InventoryException,
                      Inventory, i, ha=False)

    def test_exception(sefl):
        e = InventoryException("test")
        print(e)
        assert_is_instance(e, InventoryException)