Beispiel #1
0
 def test07_make_portal_dd_member(self):
     """
     Make the portal a domain member too. Now even the portal index should stay
     the same. Note that we do not replace whole entity now, but just the portal
     """
     harness.isns_stage('dd-registration2', 'Register port in Discovery Domain')
     (res, msg) = harness.isns_register_domain(self.client_config,
                                               ['dd-id=1',
                                                'member-addr=192.168.1.1',
                                                'member-port=860'])
     self.assertTrue(res, msg)
     (res, msg) = harness.verify_db(self.server_config)
     self.assertTrue(res, msg)
     harness.isns_stage('registration4', 'Replace whole entity')
     (res, msg) = harness.isns_register_client(self.client_config,
                                               ['--replace',
                                                '--key', 'portal=192.168.1.1:860',
                                                'portal=192.168.1.2:860'])
     self.assertTrue(res, msg)
     harness.isns_stage('registration5', 'Replace whole entity again')
     (res, msg) = harness.isns_register_client(self.client_config,
                                               ['--replace',
                                                '--key', 'portal=192.168.1.2:860',
                                                'portal=192.168.1.1:860'])
     self.assertTrue(res, msg)
     harness.vprint('*** SUCCESS ***')
Beispiel #2
0
 def test02_register_client_portals(self):
     """
     Register iniator and target portals
     """
     harness.isns_stage('registration1', 'Register client1: initiator portals')
     (res, msg) = harness.isns_register_client(self.client1_config,
                                               ['initiator', 'portal'])
     self.assertTrue(res, msg)
     (res, msg) = harness.verify_db(self.server_config)
     self.assertTrue(res, msg)
     harness.isns_stage('registration2', 'Register client2: target portals')
     (res, msg) = harness.isns_register_client(self.client2_config,
                                               ['target', 'portal'])
     self.assertTrue(res, msg)
     (res, msg) = harness.verify_db(self.server_config)
     self.assertTrue(res, msg)
     harness.vprint('*** SUCCESS ***')
Beispiel #3
0
 def test02_register_client_initiator_portal(self):
     """
     Register an iniator with default port
     """
     harness.isns_stage('registration', 'Register client initiator portal')
     (res, msg) = harness.isns_register_client(self.client_config,
                                               ['initiator', 'portal'])
     self.assertTrue(res, msg)
     (res, msg) = harness.verify_db(self.server_config)
     self.assertTrue(res, msg)
     harness.vprint('*** SUCCESS ***')
Beispiel #4
0
 def test06_replace_initiator_portal_with_dd(self):
     """
     Replace the portal again. Now the object index of the initiator
     should not change, since it is a domain member now
     """
     harness.isns_stage('registration3', 'Replace initiator portal')
     (res, msg) = harness.isns_register_client(self.client_config,
                                               ['--replace',
                                                'entity=%s' % self.__class__.eid,
                                                'initiator',
                                                'portal=192.168.1.1:860'])
     self.assertTrue(res, msg)
     (res, msg) = harness.verify_db(self.server_config)
     self.assertTrue(res, msg)
     harness.vprint('*** SUCCESS ***')
Beispiel #5
0
    def test04_replace_initiator_portal(self):
        """
        Replace the portal with different values
        """
        harness.isns_stage('registration2-1', 'Replace initiator portal')

        # set portal to 192.168.1.1, then override with 192.168.1.2
        (res, msg) = harness.isns_register_client(self.client_config,
                                                  ['--replace',
                                                   'entity=%s' % self.__class__.eid,
                                                   'initiator',
                                                   'portal=192.168.1.1:860'])
        self.assertTrue(res, msg)
        (res, msg) = harness.verify_db(self.server_config)
        harness.isns_stage('registration2-2', 'Replace initiator portal')
        (res, msg) = harness.isns_register_client(self.client_config,
                                                  ['--replace',
                                                   'entity=%s' % self.__class__.eid,
                                                   'initiator',
                                                   'portal=192.168.1.2:860'])
        self.assertTrue(res, msg)
        (res, msg) = harness.verify_db(self.server_config)
        self.assertTrue(res, msg)
        harness.vprint('*** SUCCESS ***')
Beispiel #6
0
 def test03_register_client_two_portals(self):
     """
     Register a simple initiator with two portals, one with ESI and one without.
     When the ESI-monitored portal expires, this should still take down
     the whole network entity.
     """
     harness.isns_stage('registration2', 'Register client with two portals')
     (res, msg) = harness.isns_register_client(self.client_config,
                                               ['initiator',
                                                'portal,esi-port=65535,esi-interval=5',
                                                'portal=127.0.0.1:1'])
     harness.isns_stage('expired2', 'Wait for ESI to expire again (15s)')
     harness.isns_idle(15)
     (res, msg) = harness.verify_db(self.server_config)
     self.assertTrue(res, msg)
     harness.vprint('*** SUCCESS ***')
Beispiel #7
0
 def test02_register_client_initiator_portal(self):
     """
     Register a simple initiator with one portal, then wait for ESI to expire
     """
     harness.isns_stage('registration1', 'Register client initiator portal')
     (res, msg) = harness.isns_register_client(self.client_config,
                                               ['initiator',
                                                'portal,esi-port=65535,esi-interval=5'])
     self.assertTrue(res, msg)
     (res, msg) = harness.verify_db(self.server_config)
     self.assertTrue(res, msg)
     harness.isns_stage('expired1', 'Wait for ESI to expire (15s)')
     harness.isns_idle(15)
     (res, msg) = harness.verify_db(self.server_config)
     self.assertTrue(res, msg)
     harness.vprint('*** SUCCESS ***')
Beispiel #8
0
 def test08_deregister_and_reregister(self):
     """
     Deregister the whole client, and re-register. Portal and Client
     index should remain the same
     """
     harness.isns_stage('deregister', 'Deregister our client')
     (res, msg) = harness.isns_deregister_client(self.client_config,
                                                 ['eid=%s' % self.__class__.eid])
     self.assertTrue(res, msg)
     (res, msg) = harness.verify_db(self.server_config)
     self.assertTrue(res, msg)
     harness.isns_stage('registration6', 'Re-Register the client')
     (res, msg) = harness.isns_register_client(self.client_config,
                                               ['initiator',
                                                'portal=192.168.1.1:860'])
     self.assertTrue(res, msg)
     (res, msg) = harness.verify_db(self.server_config)
     self.assertTrue(res, msg)
     harness.vprint('*** SUCCESS ***')