def test_IgnoreDevMgrDuplicate(self):
        # These two nodes use the same identifier, but have different names to distinguish them
        devmgr_nb, devMgr = self.launchDeviceManager(
            "/nodes/test_BasicTestDevice_node/DeviceManager.dcd.xml",
            debug=self.debuglevel)
        self.assertNotEqual(devMgr, None)

        # NOTE These assert check must be kept in-line with the DeviceManager.dcd.xml
        self.assertEqual(len(self._domMgr._get_deviceManagers()), 1)
        self.assertEqual(len(devMgr._get_registeredDevices()), 1)

        # Because the DeviceManager has the same identifier, we cannot use the launchDeviceManager
        # method; however, to get automatic cleanup in the event of a failure, we manually add the
        # nodebooter to the list of DeviceManager nodebooters.
        devmgr2_nb = scatest.spawnNodeBooter(
            dcdFile=
            "/nodes/test_BasicTestDeviceSameDevMgrId_node/DeviceManager.dcd.xml",
            debug=self.debuglevel)
        self._deviceBooters.append(devmgr2_nb)
        time.sleep(2)

        # Verify that the second DeviceManager is no longer alive,
        # This is REDHAWK specific, the spec would have let this go without
        # giving the user clear warning that something was wrong
        self.assertNotEqual(devmgr2_nb.poll(), None)
        self.assertEqual(len(self._domMgr._get_deviceManagers()), 1)
        devMgr = self._domMgr._get_deviceManagers()[0]
        self.assertEqual(devMgr._get_label(), "BasicTestDevice_node"
                         )  # If the second one won, it would be DeviceManager2
        self.assertEqual(len(devMgr._get_registeredDevices()), 1)
def launchDomain(number, root):
    domainName = scatest.getTestDomainName() + '_' + str(number)
    _domainBooter = scatest.spawnNodeBooter(dmdFile='', domainname=domainName)
    while _domainBooter.poll() == None:
        _domainManager = None
        try:
            _domainManager = root.resolve(URI.stringToName("%s/%s" % (domainName, domainName)))._narrow(CF.DomainManager)
        except:
            _domainManager = None
        if _domainManager:
            break
        time.sleep(0.1)
    return (_domainBooter, _domainManager)
Beispiel #3
0
def launchDomain(number, root):
    domainName = scatest.getTestDomainName() + '_' + str(number)
    _domainBooter = scatest.spawnNodeBooter(dmdFile='', domainname=domainName)
    while _domainBooter.poll() == None:
        _domainManager = None
        try:
            _domainManager = root.resolve(
                URI.stringToName("%s/%s" % (domainName, domainName)))._narrow(
                    CF.DomainManager)
        except:
            _domainManager = None
        if _domainManager:
            break
        time.sleep(0.1)
    return (_domainBooter, _domainManager)
def launchDomain(number, root):
    domainName = scatest.getTestDomainName() + '_' + str(number)
    _domainBooter = scatest.spawnNodeBooter(dmdFile='', domainname=domainName)
    while _domainBooter.poll() == None:
        _domainManager = None
        try:
            _domainManager = root.resolve(
                URI.stringToName("%s/%s" % (domainName, domainName)))._narrow(
                    CF.DomainManager)
        except _CORBA.BAD_INV_ORDER:
            orb = _CORBA.ORB_init(_sys.argv, _CORBA.ORB_ID)
            ns = orb.resolve_initial_references("NameService")
            root = ns._narrow(CosNaming.NamingContext)
        except Exception, e:
            _domainManager = None
        if _domainManager:
            break
        time.sleep(0.1)
    def test_IgnoreDevMgrDuplicate(self):
        # These two nodes use the same identifier, but have different names to distinguish them
        devmgr_nb, devMgr = self.launchDeviceManager("/nodes/test_BasicTestDevice_node/DeviceManager.dcd.xml")
        self.assertNotEqual(devMgr, None)

        # NOTE These assert check must be kept in-line with the DeviceManager.dcd.xml
        self.assertEqual(len(self._domMgr._get_deviceManagers()), 1)
        self.assertEqual(len(devMgr._get_registeredDevices()), 1)

        # Because the DeviceManager has the same identifier, we cannot use the launchDeviceManager
        # method; however, to get automatic cleanup in the event of a failure, we manually add the
        # nodebooter to the list of DeviceManager nodebooters.
        devmgr2_nb = scatest.spawnNodeBooter(dcdFile="/nodes/test_BasicTestDeviceSameDevMgrId_node/DeviceManager.dcd.xml")
        self._deviceBooters.append(devmgr2_nb)
        time.sleep(2)

        # Verify that the second DeviceManager is no longer alive,
        # This is REDHAWK specific, the spec would have let this go without
        # giving the user clear warning that something was wrong
        self.assertNotEqual(devmgr2_nb.poll(), None)
        self.assertEqual(len(self._domMgr._get_deviceManagers()), 1)
        devMgr = self._domMgr._get_deviceManagers()[0]
        self.assertEqual(devMgr._get_label(), "BasicTestDevice_node") # If the second one won, it would be DeviceManager2
        self.assertEqual(len(devMgr._get_registeredDevices()), 1)