Exemplo n.º 1
0
 def test_update_lun_add_remove(self):
     cg = UnityConsistencyGroup.get(cli=t_rest(), _id='res_21')
     lun1 = UnityLun(cli=t_rest(), _id='sv_58')
     lun2 = UnityLun(cli=t_rest(), _id='sv_59')
     lun3 = UnityLun(cli=t_rest(), _id='sv_60')
     lun4 = UnityLun(cli=t_rest(), _id='sv_61')
     resp = cg.update_lun(add_luns=[lun1, lun3], remove_luns=[lun2, lun4])
     assert_that(resp.is_ok(), equal_to(True))
Exemplo n.º 2
0
    def test_create_cg_with_hosts(self):
        lun1 = UnityLun(cli=t_rest(), _id='sv_3338')
        host1 = UnityHost(cli=t_rest(), _id='Host_14')
        host2 = UnityHost(cli=t_rest(), _id='Host_15')
        cg = UnityConsistencyGroup.create(
            t_rest(), 'Muse', lun_add=[lun1], hosts=[host1, host2])
        hosts = cg.block_host_access

        assert_that(len(hosts), equal_to(2))
        for mask in hosts.access_mask:
            assert_that(mask, equal_to(HostLUNAccessEnum.BOTH))
Exemplo n.º 3
0
    def test_create_cg_with_initial_member(self):
        lun1 = UnityLun(cli=t_rest(), _id='sv_3339')
        lun2 = UnityLun(cli=t_rest(), _id='sv_3340')
        cg = UnityConsistencyGroup.create(t_rest(), 'Muse',
                                          lun_add=[lun1, lun2])
        assert_that(cg.name, equal_to('Muse'))

        members = cg.luns
        assert_that(len(members), equal_to(2))
        lun_id_list = map(lambda lun: lun.get_id(), members)
        assert_that(lun_id_list, has_items('sv_3339', 'sv_3340'))
Exemplo n.º 4
0
 def test_create_replicate_cg_session_without_dst_cg(self):
     cg = UnityConsistencyGroup.get(cli=t_rest(), _id='res_21')
     rs = UnityRemoteSystem.get(cli=t_rest(), _id='RS_0')
     lun1 = UnityLun(cli=t_rest(), _id='sv_58')
     lun2 = UnityLun(cli=t_rest(), _id='sv_59')
     luns = [lun1, lun2]
     rep_session = cg.replicate_cg_with_dst_resource_provisioning(
         60, luns, 'pool_2', dst_cg_name=None, remote_system=rs)
     assert_that(
         rep_session.id,
         equal_to(
             '81866043753_A9221PM0010744_0604000_81378689_FNM84900101113_0000'
         ))
Exemplo n.º 5
0
 def test_create_local_replicate_cg_session(self):
     # Create the session in local when the remote system is empty
     cg = UnityConsistencyGroup.get(cli=t_rest(), _id='res_21')
     lun1 = UnityLun(cli=t_rest(), _id='sv_58')
     lun2 = UnityLun(cli=t_rest(), _id='sv_59')
     luns = [lun1, lun2]
     rep_session = cg.replicate_cg_with_dst_resource_provisioning(
         60, luns, 'pool_2', dst_cg_name=cg.name, remote_system=None)
     assert_that(
         rep_session.id,
         equal_to(
             '81604378625_APM00192210744_0000_81604378629_APM00192210744_0000'
         ))
Exemplo n.º 6
0
 def f():
     UnityConsistencyGroup.create(t_rest(), 'in_use')
Exemplo n.º 7
0
 def test_create_empty_cg(self):
     cg = UnityConsistencyGroup.create(t_rest(), 'Goddess')
     assert_that(cg.name, equal_to('Goddess'))
     assert_that(cg.type, equal_to(self.cg_type))
Exemplo n.º 8
0
 def test_get_properties(self):
     cg = UnityConsistencyGroup(_id='res_13', cli=t_rest())
     assert_that(cg.id, equal_to('res_13'))
     assert_that(cg.type, equal_to(self.cg_type))
Exemplo n.º 9
0
 def get_cg():
     return UnityConsistencyGroup(cli=t_rest(), _id='res_19')
Exemplo n.º 10
0
 def test_update_lun_all_none(self):
     cg = UnityConsistencyGroup.get(cli=t_rest(), _id='res_21')
     resp = cg.update_lun()
     assert_that(resp.is_ok(), equal_to(True))
Exemplo n.º 11
0
 def test_detach_cg_not_implemented(self):
     cg = UnityConsistencyGroup.get(cli=t_rest(), _id='res_6')
     assert_that(calling(cg.detach_from), raises(NotImplementedError))
Exemplo n.º 12
0
 def test_replace_lun_in_cg_already_in(self):
     cg = UnityConsistencyGroup.get(cli=t_rest(), _id='res_6')
     lun1 = UnityLun(cli=t_rest(), _id='sv_3341')
     lun2 = UnityLun(cli=t_rest(), _id='sv_14')
     resp = cg.replace_lun(lun1, lun2)
     assert_that(resp.is_ok(), equal_to(True))
Exemplo n.º 13
0
 def f():
     cg = UnityConsistencyGroup(cli=t_rest(), _id='res_119')
     cg.delete()
Exemplo n.º 14
0
 def test_delete_cg_normal(self):
     cg = UnityConsistencyGroup(cli=t_rest(), _id='res_18')
     resp = cg.delete()
     assert_that(resp.is_ok(), equal_to(True))
Exemplo n.º 15
0
 def create_cg(self, name, description=None, lun_add=None, hosts=None):
     return UnityConsistencyGroup.create(self._cli,
                                         name,
                                         description=description,
                                         lun_add=lun_add,
                                         hosts=hosts)
Exemplo n.º 16
0
 def cg(self):
     if self.is_cg_member and self._cg is None:
         from storops.unity.resource.cg import UnityConsistencyGroup
         self._cg = UnityConsistencyGroup(cli=self._cli,
                                          _id=self.storage_resource.id)
     return self._cg
Exemplo n.º 17
0
 def test_cg_is_not_replicated(self):
     cg = UnityConsistencyGroup.get(cli=t_rest(), _id='res_21')
     result = cg.check_cg_is_replicated()
     assert_that(result, equal_to(None))