Exemplo n.º 1
0
 def testNetworkRoute(self):
     self.create5NodeNetwork()
     
     #send message from node 0 to 2 http
     conf = ConnectionBundle(confdir=self.serverConfs[0],reload=True)
     client = ClientMessage()                  
     response = ProcessedResponse(client.pingServer(self.hostname,self.node2HttpsPort))
     print response.pprint()
     
     #send message from node 0 to 4 https
     response = ProcessedResponse(client.pingServer(self.hostname,self.node4HttpsPort))
     print response.pprint()
     
     #send message from node 0 to 4 http
     #this throws an exception since we should not route with http
     response = ProcessedResponse(client.pingServer(self.hostname,self.node4Port))
     print response.pprint()
Exemplo n.º 2
0
    def testNetworkRoute(self):
        self.create5NodeNetwork()

        #send message from node 0 to 2 http
        conf = ConnectionBundle(confdir=self.serverConfs[0], reload=True)
        client = ClientMessage()
        response = ProcessedResponse(
            client.pingServer(self.hostname, self.node2HttpsPort))
        print response.pprint()

        #send message from node 0 to 4 https
        response = ProcessedResponse(
            client.pingServer(self.hostname, self.node4HttpsPort))
        print response.pprint()

        #send message from node 0 to 4 http
        #this throws an exception since we should not route with http
        response = ProcessedResponse(
            client.pingServer(self.hostname, self.node4Port))
        print response.pprint()
Exemplo n.º 3
0
 def testStartServer(self):    
     
     self.createConfFolder(0)
         
     args = ['../../../../cpc','-c',self.serverConfs[0],'start']  #doing cpc.server.server.forkAndRun(cf, debug ) directly here will will for some strange reason mess up things when shutting down, the process wont shutdown 
     subprocess.call(args)
        
     time.sleep(2)
     conf = ServerConf(self.serverConfs[0],True)
     
     #create a custom request message that sends a file and a parameter
     #verifty 
     
     client = ClientMessage()
     ProcessedResponse(client.pingServer()).pprint()
     client.closeClient()
Exemplo n.º 4
0
    def testStartServer(self):

        self.createConfFolder(0)

        args = [
            '../../../../cpc', '-c', self.serverConfs[0], 'start'
        ]  #doing cpc.server.server.forkAndRun(cf, debug ) directly here will will for some strange reason mess up things when shutting down, the process wont shutdown
        subprocess.call(args)

        time.sleep(2)
        conf = ServerConf(self.serverConfs[0], True)

        #create a custom request message that sends a file and a parameter
        #verifty

        client = ClientMessage()
        ProcessedResponse(client.pingServer()).pprint()
        client.closeClient()