summaryrefslogtreecommitdiffstats
path: root/tests/unit/benchmark/scenarios/lib/test_delete_router.py
diff options
context:
space:
mode:
authorJingLu5 <lvjing5@huawei.com>2017-08-24 01:02:21 +0000
committerJingLu5 <lvjing5@huawei.com>2017-08-25 00:44:47 +0000
commitd254d748b607c43167876f28c74b9ea839090df2 (patch)
tree0c634e35164506935e7278b966996db8cb79c1f2 /tests/unit/benchmark/scenarios/lib/test_delete_router.py
parent5ed1f7ebbe7a9ae6138f56051a15e7774f6e71b9 (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.py')
-rw-r--r--tests/unit/benchmark/scenarios/lib/test_delete_router.py36
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/unit/benchmark/scenarios/lib/test_delete_router.py b/tests/unit/benchmark/scenarios/lib/test_delete_router.py
new file mode 100644
index 000000000..ab1ad5d35
--- /dev/null
+++ b/tests/unit/benchmark/scenarios/lib/test_delete_router.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 import DeleteRouter
+
+
+class DeleteRouterTestCase(unittest.TestCase):
+
+ @mock.patch('yardstick.common.openstack_utils.get_neutron_client')
+ @mock.patch('yardstick.common.openstack_utils.delete_neutron_router')
+ def test_delete_router(self, mock_get_neutron_client, mock_delete_neutron_router):
+ options = {
+ 'router_id': '123-123-123'
+ }
+ args = {"options": options}
+ obj = DeleteRouter(args, {})
+ obj.run({})
+ self.assertTrue(mock_get_neutron_client.called)
+ self.assertTrue(mock_delete_neutron_router.called)
+
+
+def main():
+ unittest.main()
+
+
+if __name__ == '__main__':
+ main()