From b374cf720da946ae7cfe25fe90efae5841ed4732 Mon Sep 17 00:00:00 2001 From: Huang Rui Date: Wed, 16 Sep 2015 17:51:54 +0800 Subject: [PATCH] add inspector.py Add ceilometer_zvm/compute/virt/zvm/inspector.py, ZVMInspector is inherit from ceilometer.compute.virt.inspector:Inspector. Change-Id: I413b7d0ef2adb3f5e7851dbe27608826d3a24e0d --- ceilometer_zvm/compute/virt/zvm/inspector.py | 37 +++++++++++++++++++ .../unit/compute/virt/zvm/test_inspector.py | 28 ++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 ceilometer_zvm/compute/virt/zvm/inspector.py create mode 100644 ceilometer_zvm/tests/unit/compute/virt/zvm/test_inspector.py diff --git a/ceilometer_zvm/compute/virt/zvm/inspector.py b/ceilometer_zvm/compute/virt/zvm/inspector.py new file mode 100644 index 0000000..12ed66d --- /dev/null +++ b/ceilometer_zvm/compute/virt/zvm/inspector.py @@ -0,0 +1,37 @@ +# Copyright 2015 IBM Corp. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + + +from ceilometer.compute.virt import inspector as virt_inspector +from oslo_config import cfg +from oslo_log import log + + +CONF = cfg.CONF +LOG = log.getLogger(__name__) + + +class ZVMInspector(virt_inspector.Inspector): + + def __init__(self): + pass + + def inspect_cpus(self, instance): + pass + + def inspect_memory_usage(self, instance, duration=None): + pass + + def inspect_vnics(self, instance): + pass diff --git a/ceilometer_zvm/tests/unit/compute/virt/zvm/test_inspector.py b/ceilometer_zvm/tests/unit/compute/virt/zvm/test_inspector.py new file mode 100644 index 0000000..b1d91e8 --- /dev/null +++ b/ceilometer_zvm/tests/unit/compute/virt/zvm/test_inspector.py @@ -0,0 +1,28 @@ +# Copyright 2015 IBM Corp. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + + +from oslotest import base + +from ceilometer_zvm.compute.virt.zvm import inspector as zvm_inspector + + +class TestZVMInspector(base.BaseTestCase): + + def setUp(self): + super(TestZVMInspector, self).setUp() + self.inspector = zvm_inspector.ZVMInspector() + + def test_init(self): + self.assertIsInstance(self.inspector, zvm_inspector.ZVMInspector)