Exemple #1
0
    def test_cmdhelp(self):

        for cmd in tool.commands:
            with open(os.devnull, 'wb') as devnull:
                p = tool.start_process(cmd, ['-h'],
                                       stdout=devnull,
                                       stderr=devnull)
                utils.wait_or_kill(p, timeout=10)
                self.assertEqual(0, p.returncode)
Exemple #2
0
 def setUp(self):
     unittest.TestCase.setUp(self)
     self.temp_dir = tempfile.mkdtemp()
     args = [
         '-d', lg_dir, '-t', self.temp_dir, '-p',
         str(lgweb_port), '-H', 'localhost'
     ]
     self.devnull = open(os.devnull, 'wb')
     self.web_proc = tool.start_process('lgweb',
                                        args,
                                        stdout=self.devnull,
                                        stderr=self.devnull)
Exemple #3
0
 def setUp(self):
     super(ARLExecuteTestCase, self).setUp()
     
     import os
     from wrappers.arlexecute.execution_support.arlexecute import arlexecute
     use_dlg = os.environ.get('ARL_TESTS_USE_DLG', '0') == '1'
     use_dask = os.environ.get('ARL_TESTS_USE_DASK', '1') == '1'
     arlexecute.set_client(use_dask=use_dask, use_dlg=use_dlg)
     
     # Start a daliuge node manager for these tests; make sure it can see
     # the arl modules. The node manager will be shut down at tearDown
     if use_dlg:
         from dlg import tool
         arl_root = os.path.normpath(os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..')))
         self.nm_proc = tool.start_process('nm', ['--dlg-path', arl_root])
Exemple #4
0
    def _run_graph(self, graph, completed_uids, timeout):

        sessionId = 'lala'
        restPort = 8888
        args = ['--port', str(restPort), '-N', hostname, '-qq']

        c = client.NodeManagerClient(port=restPort)
        dimProcess = tool.start_process('dim', args)

        with testutils.terminating(dimProcess, timeout):
            c.create_session(sessionId)
            logger.info("Appending graph")
            c.append_graph(sessionId, graph)

            # What we are actually trying to measure with all this stuff
            start = time.time()
            c.deploy_session(sessionId, completed_uids)
            delta = time.time() - start

            # A minute is more than enough, in my PC it takes around 4 or 5 [s]
            # A minute is also way less than the ~2 [h] we observed in AWS
            self.assertLessEqual(
                delta, 60, "It took way too much time to create all drops")
Exemple #5
0
    def setUp(self):
        unittest.TestCase.setUp(self)

        args = ['-H', hostname, '-qq']
        self.dmProcess = tool.start_process('nm', args)
Exemple #6
0
 def setUp(self):
     unittest.TestCase.setUp(self)
     self.dmProcess = tool.start_process('nm')