1
# -*- encoding: utf-8 -*-
3
# Copyright © 2013 Intel Corp
5
# Authors: Lianhao Lu <lianhao.lu@intel.com>
7
# Licensed under the Apache License, Version 2.0 (the "License"); you may
8
# not use this file except in compliance with the License. You may obtain
9
# a copy of the License at
11
# http://www.apache.org/licenses/LICENSE-2.0
13
# Unless required by applicable law or agreed to in writing, software
14
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16
# License for the specific language governing permissions and limitations
19
from ceilometer.hardware.pollsters import net
20
from ceilometer import sample
21
from ceilometer.tests.hardware.pollsters import base
24
class TestNetPollsters(base.TestPollsterBase):
25
def test_bandwidth(self):
26
self._check_get_samples(net.BandwidthBytesPollster,
27
'network.bandwidth.bytes',
28
1000, sample.TYPE_CUMULATIVE)
30
def test_incoming(self):
31
self._check_get_samples(net.IncomingBytesPollster,
32
'network.incoming.bytes',
33
90, sample.TYPE_CUMULATIVE)
35
def test_outgoing(self):
36
self._check_get_samples(net.OutgoingBytesPollster,
37
'network.outgoing.bytes',
38
80, sample.TYPE_CUMULATIVE)
41
self._check_get_samples(net.OutgoingErrorsPollster,
42
'network.outgoing.errors',
43
1, sample.TYPE_CUMULATIVE)