diff options
author | Tim Nibert <docz2a@gmail.com> | 2018-08-18 17:47:36 +1000 |
---|---|---|
committer | Tim Nibert <docz2a@gmail.com> | 2018-08-20 18:18:21 +1000 |
commit | c15a97093717253f0305890fbb7ee7c06b1ed00b (patch) | |
tree | aa028f4fd6e6d99b6ce98c607530d0f1c4edf2fa /unitest.py | |
parent | 1d2add124852cb8e88a7e99aaab631c7103f49e4 (diff) |
Hard disk SMART plugin, includes python3 patched pySMART
Diffstat (limited to 'unitest.py')
-rwxr-xr-x | unitest.py | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -254,6 +254,20 @@ class TestGlances(unittest.TestCase): l_subsample = subsample(l[0], l[1]) self.assertLessEqual(len(l_subsample), l[1]) + def test_016_hddsmart(self): + """Check hard disk SMART data plugin.""" + from glances.plugins.glances_smart import is_admin + stat = 'DeviceName' + print('INFO: [TEST_016] Check SMART stats: {}'.format(stat)) + stats_grab = stats.get_plugin('smart').get_raw() + if not is_admin(): + print("INFO: Not admin, SMART list should be empty") + assert len(stats_grab) == 0 + else: + self.assertTrue(stat in stats_grab[0].keys(), msg='Cannot find key: %s' % stat) + + print('INFO: SMART stats: %s' % stats_grab) + def test_094_thresholds(self): """Test thresholds classes""" print('INFO: [TEST_094] Thresholds') |