6 @link: http://hierarchical-cluster-engine.com/ 7 @copyright: Copyright © 2013-2014 IOIX Ukraine 8 @license: http://hierarchical-cluster-engine.com/license/ 26 logger = logging.getLogger(__name__)
38 BaseServerManager.ADMIN_CONNECT_ENDPOINT)
39 self.
config = ConfigParser.ConfigParser()
40 self.
config.read(
"./dc.ini")
53 serverHost = self.
config.get(ClientInterfaceService.CONFIG_SECTION, ClientInterfaceService.CONFIG_SERVER_HOST)
54 serverPort = self.
config.get(ClientInterfaceService.CONFIG_SECTION, ClientInterfaceService.CONFIG_SERVER_PORT)
55 server = serverHost +
":" + str(serverPort)
58 server, transport.Consts.TCP_TYPE)
60 except ConfigParser.NoSectionError:
61 logger.error(
">>> TasksDataManager can't read config - Section Error")
62 except ConfigParser.NoOptionError:
63 logger.error(
">>> TasksDataManager can't read config - Option Error")
68 URLManager = self.
config.get(ClientInterfaceService.CONFIG_SECTION, ClientInterfaceService.CONFIG_URL_MANAGER)
69 sitesManager = self.
config.get(ClientInterfaceService.CONFIG_SECTION, ClientInterfaceService.CONFIG_SITES_MANAGER)
74 except ConfigParser.NoSectionError:
75 logger.error(
">>> TasksDataManager can't read config - Section Error")
76 except ConfigParser.NoOptionError:
77 logger.error(
">>> TasksDataManager can't read config - Option Error")
96 self.assertTrue(
True,
">>> " + excptStr +
"Was timeout")
101 def commonTest(self, eventObject, eventObjectResponse, eventType, eventTypeResponse, excptStr):
103 responseEvent = self.
eventBuilder.build(eventTypeResponse, eventObjectResponse)
104 responseEvent.uid = event.uid
109 self.assertTrue(
False,
">>> " + excptStr +
" Was timeout")
112 if ret.eventType != eventTypeResponse:
113 self.assertTrue(
False,
">>> " + excptStr +
" Bad ret event type")
123 self.
commonTestTimeout(updateSiteObj, EVENT_TYPES.SITE_UPDATE,
"[testUpdateSiteTimeout]")
128 self.
commonTestTimeout(statusSiteObj, EVENT_TYPES.SITE_STATUS,
"[testStatusSiteTimeout]")
133 self.
commonTestTimeout(deleteSiteObj, EVENT_TYPES.SITE_DELETE,
"[testDeleteSiteTimeout]")
138 self.
commonTestTimeout(cleanupSiteObj, EVENT_TYPES.SITE_CLEANUP,
"[testCleanupSiteTimeout]")
149 self.
commonTestTimeout(updateURLObj, EVENT_TYPES.URL_UPDATE,
"[testUpdateURLTimeout]")
155 self.
commonTestTimeout(statusURLObj, EVENT_TYPES.URL_STATUS,
"[testStatusURLTimeout]")
161 self.
commonTestTimeout(deleteURLObj, EVENT_TYPES.URL_DELETE,
"[testDeleteURLTimeout]")
167 self.
commonTestTimeout(cleanupURLObj, EVENT_TYPES.URL_CLEANUP,
"[testCleanupURLTimeout]")
172 self.
commonTestTimeout(fetchURLObj, EVENT_TYPES.URL_FETCH,
"[testFetchURLTimeout]")
178 self.
commonTestTimeout(contentURLObj, EVENT_TYPES.URL_CONTENT,
"[testContentURLTimeout]")
184 self.
commonTest(newSiteObj, generalResponse, EVENT_TYPES.SITE_NEW, EVENT_TYPES.SITE_NEW_RESPONSE,
185 "[testNewSiteTimeout]")
191 self.
commonTest(updateSiteObj, generalResponse, EVENT_TYPES.SITE_UPDATE, EVENT_TYPES.SITE_UPDATE_RESPONSE,
192 "[testUpdateSiteTimeout]")
198 self.
commonTest(statusSiteObj, siteResponse, EVENT_TYPES.SITE_STATUS, EVENT_TYPES.SITE_STATUS_RESPONSE,
199 "[testStatusSiteTimeout]")
205 self.
commonTest(deleteSiteObj, generalResponse, EVENT_TYPES.SITE_DELETE, EVENT_TYPES.SITE_DELETE_RESPONSE,
206 "[testDeleteSiteTimeout]")
212 self.
commonTest(cleanupSiteObj, generalResponse, EVENT_TYPES.SITE_CLEANUP, EVENT_TYPES.SITE_CLEANUP_RESPONSE,
213 "[testCleanupSiteTimeout]")
219 self.
commonTest(newURLObj, generalResponse, EVENT_TYPES.URL_NEW, EVENT_TYPES.URL_NEW_RESPONSE,
220 "[testNewURLTimeout]")
227 self.
commonTest(updateURLObj, generalResponse, EVENT_TYPES.URL_UPDATE, EVENT_TYPES.URL_UPDATE_RESPONSE,
228 "[testUpdateURLTimeout]")
236 self.
commonTest(statusURLObj, urlResponse, EVENT_TYPES.URL_STATUS, EVENT_TYPES.URL_STATUS_RESPONSE,
237 "[testStatusURLTimeout]")
244 self.
commonTest(deleteURLObj, generalResponse, EVENT_TYPES.URL_DELETE, EVENT_TYPES.URL_DELETE_RESPONSE,
245 "[testDeleteURLTimeout]")
252 self.
commonTest(cleanupURLObj, generalResponse, EVENT_TYPES.URL_CLEANUP, EVENT_TYPES.URL_CLEANUP_RESPONSE,
253 "[testCleanupURLTimeout]")
260 self.
commonTest(fetchURLObj, urlsResponse, EVENT_TYPES.URL_FETCH, EVENT_TYPES.URL_FETCH_RESPONSE,
261 "[testFetchURLTimeout]")
269 self.
commonTest(contentURLObj, contentResponse, EVENT_TYPES.URL_CONTENT, EVENT_TYPES.URL_CONTENT_RESPONSE,
270 "[testContentURLTimeout]")
273 if __name__ ==
"__main__":
def commonTest(self, eventObject, eventObjectResponse, eventType, eventTypeResponse, excptStr)
def testFetchURLTimeout(self)
def connectionInitClients(self)
localConnectionSitesManager
def testDeleteSiteTimeout(self)
GeneralResponse event object, represents general state response for multipurpose usage.
def testUpdateSiteTimeout(self)
def testNewSiteTimeout(self)
def testDeleteURLTimeout(self)
def testContentURLTimeout(self)
Class hides routines of bulding connection objects.
def testCleanupSite(self)
def commonTestTimeout(self, eventObj, eventType, excptStr)
def testCleanupURLTimeout(self)
def testCleanupSiteTimeout(self)
def testNewURLTimeout(self)
def testUpdateURLTimeout(self)
def testStatusSiteTimeout(self)
def connectionInitServers(self)
def testStatusURLTimeout(self)
localConnectionURLManager