예제 #1
0
 def _run_(self, application, test_id=str(uuid.uuid4())):
     basedir = LocalFS(os.path.join("/tmp", "test_spark", test_id))
     try:
         basedir.create_directory()
         _app_input = self.input_path
         _app_output_dir = os.path.join(basedir.path, "output")
         status = application.run('file:' + _app_input, 'file:' + _app_output_dir)
         self.assertTrue(status.is_ok(), status.stderr())
         self.assertTrue(os.path.exists(_app_output_dir), status.stderr())
     finally:
         basedir.delete_directory()
예제 #2
0
 def _run_(self, application, test_id=str(uuid.uuid4())):
     basedir = LocalFS(os.path.join("/tmp", "test_spark", test_id))
     try:
         basedir.create_directory()
         _app_input = self.input_path
         _app_output_dir = os.path.join(basedir.path, "output")
         status = application.run('file:' + _app_input,
                                  'file:' + _app_output_dir)
         self.assertTrue(status.is_ok(), status.stderr())
         self.assertTrue(os.path.exists(_app_output_dir), status.stderr())
     finally:
         basedir.delete_directory()
예제 #3
0
 def test_broker(self):
     shell.execute_shell_command('fuser -k -n tcp {0}'.format(PORT))
     local = LocalFS("/tmp/kafka-test")
     if not local.exists():
         local.create_directory()
     thread = KafkaThreadBroker()
     thread.daemon = True
     thread.start()
     sleep(TIME)
     cmd = shell.execute_shell_command('netstat -lntu')
     self.assertTrue("9010" in cmd.stdout, cmd.stdout)
     local.delete_directory()
     shell.execute_shell_command('fuser -k -n tcp {0}'.format(PORT))
예제 #4
0
파일: test_kafka.py 프로젝트: epam/Merlin
 def test_broker(self):
     shell.execute_shell_command('fuser -k -n tcp {0}'.format(PORT))
     local = LocalFS("/tmp/kafka-test")
     if not local.exists():
         local.create_directory()
     thread = KafkaThreadBroker()
     thread.daemon = True
     thread.start()
     sleep(TIME)
     cmd = shell.execute_shell_command('netstat -lntu')
     self.assertTrue("9010" in cmd.stdout, cmd.stdout)
     local.delete_directory()
     shell.execute_shell_command('fuser -k -n tcp {0}'.format(PORT))