~ubuntu-branches/ubuntu/vivid/ceilometer/vivid

« back to all changes in this revision

Viewing changes to ceilometer/tests/ipmi/platform/test_intel_node_manager.py

  • Committer: Package Import Robot
  • Author(s): James Page, Corey Bryant, James Page
  • Date: 2015-02-19 14:59:07 UTC
  • mfrom: (1.2.3)
  • Revision ID: package-import@ubuntu.com-20150219145907-9jojybdsl64zcn14
Tags: 2015.1~b2-0ubuntu1
[ Corey Bryant ]
* New upstream release.
  - d/control: Align requirements with upstream.
  - d/p/skip-test.patch: Rebased.

[ James Page ]
* d/rules,d/p/skip-gabbi.patch: Skip tests that rely on python-gabbi until
  packaging and MIR is complete.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# Copyright 2014 Intel Corp.
2
2
#
3
 
# Author: Zhai Edwin <edwin.zhai@intel.com>
4
 
#
5
3
# Licensed under the Apache License, Version 2.0 (the "License"); you may
6
4
# not use this file except in compliance with the License. You may obtain
7
5
# a copy of the License at
31
29
        utils.execute = mock.Mock(side_effect=fake_utils.execute_with_nm)
32
30
        self.nm = node_manager.NodeManager()
33
31
 
 
32
    @classmethod
 
33
    def tearDownClass(cls):
 
34
        # reset inited to force an initialization of singleton for next test
 
35
        node_manager.NodeManager()._inited = False
 
36
        super(TestNodeManager, cls).tearDownClass()
 
37
 
34
38
    def test_read_power_all(self):
35
39
        power = self.nm.read_power_all()
36
40
 
54
58
        min_val = node_manager._hex(temperature["Minimum_value"])
55
59
        cur_val = node_manager._hex(temperature["Current_value"])
56
60
 
57
 
        self.assertTrue(self.nm.nm_support)
58
61
        # see ipmi_test_data.py for raw data
59
62
        self.assertEqual(23, cur_val)
60
63
        self.assertEqual(22, min_val)
69
72
 
70
73
        utils.execute = mock.Mock(side_effect=fake_utils.execute_without_nm)
71
74
        self.nm = node_manager.NodeManager()
72
 
        self.nm.nm_support = False
 
75
 
 
76
    @classmethod
 
77
    def tearDownClass(cls):
 
78
        # reset inited to force an initialization of singleton for next test
 
79
        node_manager.NodeManager()._inited = False
 
80
        super(TestNonNodeManager, cls).tearDownClass()
73
81
 
74
82
    def test_read_power_all(self):
75
83
        power = self.nm.read_power_all()
76
84
 
 
85
        self.assertFalse(self.nm.nm_support)
77
86
        # Non-Node Manager platform return empty data
78
87
        self.assertEqual({}, power)
79
88