Exemple #1
0
    def test_delete_portal_not_found(self):
        portal = UnityIscsiPortal.get(cli=t_rest(), _id='if_20')

        def f():
            portal.delete()

        assert_that(f, raises(UnityResourceNotFoundError))
Exemple #2
0
 def test_get_properties(self):
     portal = UnityIscsiPortal(cli=t_rest(), _id='if_4')
     assert_that(portal.ip_address, equal_to('10.244.213.177'))
     assert_that(portal.iscsi_node, instance_of(UnityIscsiNode))
     assert_that(portal.iscsi_node.name,
                 equal_to('iqn.1992-04.com.emc:cx.fnm00150600267.a0'))
     assert_that(portal.netmask, equal_to('255.255.255.0'))
     assert_that(portal.gateway, equal_to('10.244.213.1'))
Exemple #3
0
 def test_create_iscsi_portal(self):
     portal = UnityIscsiPortal.create(cli=t_rest(),
                                      ethernet_port='spa_eth3',
                                      ip="10.244.213.244",
                                      netmask="255.255.255.0",
                                      vlan=133,
                                      gateway="10.244.213.1")
     assert_that(portal.id, equal_to("if_4"))
Exemple #4
0
 def create_iscsi_portal(self,
                         ethernet_port,
                         ip,
                         netmask=None,
                         v6_prefix_len=None,
                         vlan=None,
                         gateway=None):
     return UnityIscsiPortal.create(cli=self._cli,
                                    ethernet_port=ethernet_port,
                                    ip=ip,
                                    netmask=netmask,
                                    v6_prefix_len=v6_prefix_len,
                                    vlan=vlan,
                                    gateway=gateway)
Exemple #5
0
 def test_delete_portal(self):
     portal = UnityIscsiPortal.get(cli=t_rest(), _id='if_4')
     portal.delete()
Exemple #6
0
 def test_modify_portal(self):
     portal = UnityIscsiPortal(cli=t_rest(), _id='if_4')
     portal.modify(ip="10.244.21.11",
                   netmask="255.255.252.0",
                   vlan=111,
                   gateway="10.244.21.1")
Exemple #7
0
 def f():
     UnityIscsiPortal.create(cli=t_rest(),
                             ethernet_port='spa_eth2',
                             ip='10.244.213.244',
                             netmask="255.255.255.0",
                             gateway="10.244.213.1")