Exemplo n.º 1
0
 def test_is_perf_monitored_resource(self):
     cli = self.perf_mon()
     cli._rsc_clz_list = [UnityDisk]
     assert_that(cli._is_perf_monitored(UnityDisk('', cli=cli)),
                 equal_to(True))
     assert_that(cli._is_perf_monitored(UnityLun('', cli=cli)),
                 equal_to(False))
Exemplo n.º 2
0
 def test_is_perf_metric_enabled_rsc_default(self):
     cli = self.perf_mon()
     cli.enable_perf_metric(0, lambda: 1)
     enabled = cli.is_perf_metric_enabled(UnityDiskList(cli=cli))
     assert_that(enabled, equal_to(True))
     enabled = cli.is_perf_metric_enabled(UnityDisk(_id='', cli=cli))
     assert_that(enabled, equal_to(True))
Exemplo n.º 3
0
    def test_is_perf_metric_enabled_rsc_specific(self):
        cli = self.perf_mon()
        cli.enable_perf_metric(0, lambda: 1, [UnityDisk])
        enabled = cli.is_perf_metric_enabled(UnityDiskList(cli=cli))
        assert_that(enabled, equal_to(True))

        enabled = cli.is_perf_metric_enabled(UnityLunList(cli=cli))
        assert_that(enabled, equal_to(False))

        enabled = cli.is_perf_metric_enabled(UnityDisk(_id='', cli=cli))
        assert_that(enabled, equal_to(True))

        enabled = cli.is_perf_metric_enabled(UnityLun(_id='', cli=cli))
        assert_that(enabled, equal_to(False))
Exemplo n.º 4
0
 def test_metric_in_repr(self):
     unity = t_unity()
     disk = UnityDisk(_id='dae_0_1_disk_2', cli=unity._cli)
     repr_str = repr(disk)
     assert_that(repr_str, contains_string('"read_iops":'))
     assert_that(repr_str, contains_string('"write_mbps"'))
Exemplo n.º 5
0
 def test_disk_utilization(self):
     unity = t_unity()
     disk = UnityDisk(_id='dae_0_1_disk_2', cli=unity._cli)
     assert_that(disk.utilization, close_to(2.41, 0.01))
Exemplo n.º 6
0
 def test_metric_read_iops(self):
     unity = t_unity()
     disk = UnityDisk(_id='dae_0_1_disk_2', cli=unity._cli)
     assert_that(disk.write_iops, close_to(0.0, 0.01))
Exemplo n.º 7
0
 def test_not_inserted(self):
     disk = UnityDisk(_id='dpe_disk_23', cli=t_rest())
     assert_that(disk.inserted, equal_to(False))
Exemplo n.º 8
0
 def test_metric_names(self):
     metric_names = UnityDisk().metric_names()
     assert_that(metric_names, has_items('read_iops', 'write_iops'))
Exemplo n.º 9
0
 def test_properties(self):
     disk = UnityDisk(_id='dae_0_1_disk_0', cli=t_rest())
     self.verify_dae_0_1_disk_0(disk)
Exemplo n.º 10
0
 def test_nested_properties(self):
     disk = UnityDisk(_id='dpe_disk_12', cli=t_rest())
     assert_that(disk.pool.id, equal_to('pool_1'))
     assert_that(disk.pool.name, equal_to('perfpool1130'))