Esempio n. 1
0
 def webHookMutipleWebHooks(self):
     for server in self.servers:
         shell = RemoteMachineShellConnection(server)
         type = shell.extract_remote_info().type.lower()
         shell.copy_file_local_to_remote(
             "pytests/sg/simpleServe.go",
             "{0}/tmp/simpleServe2.go".format(self.folder_prefix))
         self.log.info('=== Starting SimpleServe second instances')
         if type == 'windows':
             shell.terminate_process(process_name='simpleServe2.exe')
             output, error = shell.execute_command_raw(
                 'c:/Go/bin/go.exe run c:/tmp/simpleServe2.go 8082'
                 ' >{0}/tmp/simpleServe2.txt 2>&1 &'.format(
                     self.folder_prefix))
         else:
             shell.terminate_process(process_name='simpleServe2')
             shell.execute_command(
                 "kill $(ps aux | grep '8082' | awk '{print $2}')")
             output, error = shell.execute_command_raw(
                 'go run /tmp/simpleServe2.go 8082'
                 '  >/tmp/simpleServe2.txt 2>&1 &')
         self.start_sync_gateway(shell, self.configfile)
         shell.log_command_output(output, error)
         success, revision, status = self.create_doc_logfiles(
             shell, self.doc_id, self.doc_content, [
                 '{0}/tmp/simpleServe.txt'.format(self.folder_prefix),
                 '{0}/tmp/simpleServe2.txt'.format(self.folder_prefix)
             ])
         self.assertTrue(success)
         shell.disconnect()
Esempio n. 2
0
 def load_with_ops(self):
     self.setup_xdcr()
     for cluster in self.get_cb_clusters():
         for node in cluster.get_nodes():
             shell = RemoteMachineShellConnection(node)
             shell.copy_file_local_to_remote("pytests/sg/resources/sg_localhost_default_xattrs.conf",
                                             "/home/sync_gateway/sync_gateway.json")
             # TODO: works for Centos6 only now
             shell.execute_command('initctl stop sync_gateway')
             shell.execute_command('initctl start sync_gateway')
     self.load_data_topology()
     self.verify_results(sg_run=True)
Esempio n. 3
0
 def load_with_ops(self):
     self.setup_xdcr()
     for cluster in self.get_cb_clusters():
         for node in cluster.get_nodes():
             shell = RemoteMachineShellConnection(node)
             shell.copy_file_local_to_remote("pytests/sg/resources/sg_localhost_default_xattrs.conf",
                                             "/home/sync_gateway/sync_gateway.json")
             # TODO: works for Centos6 only now
             shell.execute_command('initctl stop sync_gateway')
             shell.execute_command('initctl start sync_gateway')
     self.load_data_topology()
     self.verify_results(sg_run=True)
Esempio n. 4
0
 def writeFile(self, host):
     shell = RemoteMachineShellConnection(host)
     try:
         result = shell.copy_file_local_to_remote(self.PATH_SASLAUTHD_LOCAL + self.FILE_SASLAUTHD, \
                                                  self.PATH_SASLAUTHD + self.FILE_SASLAUTHD)
     finally:
         shell.disconnect()
Esempio n. 5
0
 def writeFile(self, host):
     shell = RemoteMachineShellConnection(host)
     try:
         result = shell.copy_file_local_to_remote(self.PATH_SASLAUTHD_LOCAL + self.FILE_SASLAUTHD, \
                                                  self.PATH_SASLAUTHD + self.FILE_SASLAUTHD)
     finally:
         shell.disconnect()
Esempio n. 6
0
 def writeFile(self, pathAuditFile=None, fileName=None, lines=None):
     if (pathAuditFile is None):
         pathAuditFile = self.getAuditConfigPathInitial()
     if (fileName is None):
         fileName = audit.AUDITCONFIGFILENAME
     shell = RemoteMachineShellConnection(self.host)
     try:
         with open ("/tmp/audit.json", 'w') as outfile:
             json.dump(lines, outfile)
         result = shell.copy_file_local_to_remote('/tmp/audit.json', pathAuditFile + fileName)
     finally:
         shell.disconnect()
Esempio n. 7
0
 def writeFile(self, pathAuditFile=None, fileName=None, lines=None):
     if (pathAuditFile is None):
         pathAuditFile = self.getAuditConfigPathInitial()
     if (fileName is None):
         fileName = audit.AUDITCONFIGFILENAME
     shell = RemoteMachineShellConnection(self.host)
     try:
         with open ("/tmp/audit.json", 'w') as outfile:
             json.dump(lines, outfile)
         result = shell.copy_file_local_to_remote('/tmp/audit.json', pathAuditFile + fileName)
     finally:
         shell.disconnect()
Esempio n. 8
0
 def webHookMutipleWebHooks(self):
     for server in self.servers:
         shell = RemoteMachineShellConnection(server)
         type = shell.extract_remote_info().type.lower()
         shell.copy_file_local_to_remote("pytests/sg/simpleServe.go", "{0}/tmp/simpleServe2.go".format(self.folder_prefix))
         self.log.info('=== Starting SimpleServe second instances')
         if type == 'windows':
             shell.terminate_process(process_name='simpleServe2.exe')
             output, error = shell.execute_command_raw('c:/Go/bin/go.exe run c:/tmp/simpleServe2.go 8082'
                                   ' >{0}/tmp/simpleServe2.txt 2>&1 &'.format(self.folder_prefix))
         else:
             shell.terminate_process(process_name='simpleServe2')
             shell.execute_command("kill $(ps aux | grep '8082' | awk '{print $2}')")
             output, error = shell.execute_command_raw('go run /tmp/simpleServe2.go 8082'
                                               '  >/tmp/simpleServe2.txt 2>&1 &')
         self.start_sync_gateway(shell, self.configfile)
         shell.log_command_output(output, error)
         success, revision, status = self.create_doc_logfiles(shell, self.doc_id, self.doc_content,
                                     ['{0}/tmp/simpleServe.txt'.format(self.folder_prefix),
                                      '{0}/tmp/simpleServe2.txt'.format(self.folder_prefix)])
         self.assertTrue(success)
         shell.disconnect()
Esempio n. 9
0
 def _copy_node_key_chain_cert(self,host,src_path,dest_path):
     shell = RemoteMachineShellConnection(host)
     shell.copy_file_local_to_remote(src_path,dest_path)
Esempio n. 10
0
 def transfer_file(self,src):
     for server in self.servers:
         shell = RemoteMachineShellConnection(server)
         shell.copy_file_local_to_remote(src,"/tmp/block_ports.py")
         shell.disconnect()
Esempio n. 11
0
 def _copy_node_key_chain_cert(self, host, src_path, dest_path):
     shell = RemoteMachineShellConnection(host)
     shell.copy_file_local_to_remote(src_path, dest_path)