diff options
author | 2017-08-24 01:02:21 +0000 | |
---|---|---|
committer | 2017-08-25 00:44:47 +0000 | |
commit | d254d748b607c43167876f28c74b9ea839090df2 (patch) | |
tree | 0c634e35164506935e7278b966996db8cb79c1f2 /tests/unit/benchmark/scenarios/lib/test_delete_router_gateway.py | |
parent | 5ed1f7ebbe7a9ae6138f56051a15e7774f6e71b9 (diff) |
Add common openstack opertation scenarios: router & port
JIRA: YARDSTICK-781
This patch adds some common openstack opertation scenarios
Change-Id: Id436a201aa04f8f6b98576e8fbf599ca3654827c
Signed-off-by: JingLu5 <lvjing5@huawei.com>
Diffstat (limited to 'tests/unit/benchmark/scenarios/lib/test_delete_router_gateway.py')
-rw-r--r-- | tests/unit/benchmark/scenarios/lib/test_delete_router_gateway.py | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/unit/benchmark/scenarios/lib/test_delete_router_gateway.py b/tests/unit/benchmark/scenarios/lib/test_delete_router_gateway.py new file mode 100644 index 000000000..1150dccda --- /dev/null +++ b/tests/unit/benchmark/scenarios/lib/test_delete_router_gateway.py @@ -0,0 +1,36 @@ +############################################################################## +# 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.delete_router_gateway import DeleteRouterGateway + + +class DeleteRouterGatewayTestCase(unittest.TestCase): + + @mock.patch('yardstick.common.openstack_utils.get_neutron_client') + @mock.patch('yardstick.common.openstack_utils.remove_gateway_router') + def test_delete_router_gateway(self, mock_get_neutron_client, mock_remove_gateway_router): + options = { + 'router_id': '123-123-123' + } + args = {"options": options} + obj = DeleteRouterGateway(args, {}) + obj.run({}) + self.assertTrue(mock_get_neutron_client.called) + self.assertTrue(mock_remove_gateway_router.called) + + +def main(): + unittest.main() + + +if __name__ == '__main__': + main() |