aboutsummaryrefslogtreecommitdiffstats
path: root/puppet/extraconfig/pre_deploy/compute
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2017-04-07 21:36:45 +0000
committerGerrit Code Review <review@openstack.org>2017-04-07 21:36:45 +0000
commita190acfa7d802a27df9a922ed391367d35addf64 (patch)
tree9dda935ae5f100778601322aff4e12cb4d23501f /puppet/extraconfig/pre_deploy/compute
parent7e5e9aa8bbc27503e567df73c6b2bce545424492 (diff)
parent1f172ca25e8e8afab60061cdc33a0599cb322663 (diff)
Merge "Prepare 7.0.0.0b1 (pike-1)"
Diffstat (limited to 'puppet/extraconfig/pre_deploy/compute')
0 files changed, 0 insertions, 0 deletions
} /* 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) 2017 Huawei Technologies Co.,Ltd and others.
#
# 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
##############################################################################
import unittest
import mock
import paramiko

from yardstick.benchmark.scenarios.lib.create_subnet import CreateSubnet


class CreateSubnetTestCase(unittest.TestCase):

    @mock.patch('yardstick.common.openstack_utils.get_neutron_client')
    @mock.patch('yardstick.common.openstack_utils.create_neutron_subnet')
    def test_create_subnet(self, mock_get_neutron_client, mock_create_neutron_subnet):
        options = {
          'openstack_paras': {
             'network_id': '123-123-123',
             'name': 'yardstick_subnet',
             'cidr': '10.10.10.0/24',
             'ip_version': '4'
          }
        }
        args = {"options": options}
        obj = CreateSubnet(args, {})
        obj.run({})
        self.assertTrue(mock_get_neutron_client.called)
        self.assertTrue(mock_create_neutron_subnet.called)


def main():
    unittest.main()


if __name__ == '__main__':
    main()