def test_enable_persist_perf_stats(self): unity = UnitySystem('10.244.223.61') assert_that(unity.is_perf_stats_persisted(), equal_to(False)) unity.enable_persist_perf_stats() assert_that(unity.is_perf_stats_persisted(), equal_to(True)) unity.disable_persist_perf_stats() assert_that(unity.is_perf_stats_persisted(), equal_to(False))
def _is_advanced_dedup_supported(self, support_matrix): from storops.unity.resource.system import UnitySystem unity_system = UnitySystem(cli=self._cli) supported = False for supported_model in support_matrix: if UnityModel(unity_system.model) >= UnityModel(supported_model): supported = True break return supported and self.is_all_flash
def test_enable_performance_statistics(self): unity = UnitySystem('10.244.223.61') assert_that(unity.is_perf_stats_enabled(), equal_to(False)) queries = unity.enable_perf_stats(1) assert_that(queries, instance_of(UnityMetricRealTimeQueryList)) time.sleep(5) assert_that(unity.is_perf_stats_enabled(), equal_to(True)) assert_that(unity._cli.curr_counter, instance_of(UnityMetricQueryResultList)) unity.disable_perf_stats() assert_that(unity.is_perf_stats_enabled(), equal_to(False)) assert_that(unity._cli.curr_counter, none()) assert_that(unity._cli.prev_counter, none())
def test_get_properties(self): system = UnitySystem(cli=t_rest()) assert_that(system.existed, equal_to(True)) assert_that(system.health, instance_of(UnityHealth)) assert_that(system.name, equal_to('FNM00151200215')) assert_that(system.model, equal_to('Unity 500')) assert_that(system.serial_number, equal_to('FNM00151200215')) assert_that(system.internal_model, equal_to('OBERON 25 DRIVE CHASSIS')) assert_that(system.platform, equal_to('Oberon_DualSP')) assert_that(system.mac_address, equal_to('08:00:1B:FF:EA:CD')) assert_that(system.is_eula_accepted, equal_to(True)) assert_that(system.is_upgrade_complete, equal_to(True)) assert_that(system.is_auto_failback_enabled, equal_to(True)) assert_that(system.current_power, equal_to(469)) assert_that(system.avg_power, equal_to(474))
def test_get_file_port_la_unsupported(self): unity = UnitySystem(cli=t_rest("4.0.0")) ports = unity.get_file_port() assert_that(len(ports), equal_to(8))
def test_get_file_port(self): unity = UnitySystem(cli=t_rest("4.1.0")) ports = unity.get_file_port() assert_that(len(ports), equal_to(6))
def test_init_by_ip(self): system = UnitySystem('10.244.223.66', 'admin', 'Password123!') assert_that(system.model, equal_to('Unity 500'))
def t_unity(): return UnitySystem('10.244.223.66', 'admin', 'Password123!')
def test_default_metric_csv_filename(self): sp_list = UnitySystem('10.244.223.61').get_sp() filename = sp_list.get_default_metric_csv_filename() assert_that(filename, contains_string('.storops')) assert_that(filename, contains_string('10.244.223.61_storageProcessor.csv'))
def test_repr_without_metric(self): spa, _ = UnitySystem('10.244.223.61').get_sp() assert_that(str(spa), is_not(contains_string('"nfs_write_mbps":')))