Exemplo n.º 1
0
ServerTask::Base* SGEServer::testConfiguration()
{
   QLOG_TRACE() << "Testing SGEServer configuration";
   if (!m_server->isConnected()) {
      throw Server::Exception("Test Configuration called on disconnected server");
   }

   ServerTask::TestConfiguration* test = new ServerTask::TestSGEConfiguration(m_server);

   HostDelegate::FileFlags flags;
   QString file;

   flags = HostDelegate::Directory | HostDelegate::Writable;
   file  = m_server->workingDirectory();
   test->addFileTest(file, flags);
   
   //flags = HostDelegate::Directory | HostDelegate::Readable;
   //file  = m_server->qchemEnvironment();
   //test->addFileTest(file, flags);

   //flags = HostDelegate::Executable;
   //file  = m_server->qchemEnvironment() + "/exe/" + m_server->executableName();
   //test->addFileTest(file, flags);

   // The following are not tested as each test requires a separate test which
   // takes time.  We just assume the server is *nix based and they exist:
   // qstat  test  at  ps  rm  mkdir  grep  cd  sleep  awk  tail

   return test;
}
Exemplo n.º 2
0
ServerTask::Base* BasicServer::testConfiguration()
{
qDebug() << "Testing BasicServer configuration";
   if (!m_server->isConnected()) {
      throw Server::Exception("Test Configuration called on disconnected server");
   }

   ServerTask::TestConfiguration* test = new ServerTask::TestConfiguration(m_server);

   HostDelegate::FileFlags flags;
   QString file;

   flags = HostDelegate::Directory | HostDelegate::Readable;
   file  = m_server->qchemEnvironment();
   test->addFileTest(file, flags);

   flags = HostDelegate::Directory | HostDelegate::Writable;
   file  = m_server->workingDirectory();
   if (!file.isEmpty()) test->addFileTest(file, flags);
   
#ifndef Q_WS_WIN
   flags = HostDelegate::Executable;
   file  = m_server->qchemEnvironment() + "/exe/" + m_server->executableName();
   test->addFileTest(file, flags);
#endif

   // These may not be required if we just assume the remote server is *nix based
   // also use: test  at  ps  rm  mkdir  grep  cd  sleep  awk  tail
   if (m_server->host() == Server::Remote) {
      flags = HostDelegate::Executable;
      file  = "nohup";
      test->addFileTest(file, flags);
      file  = "grep";
      test->addFileTest(file, flags);
      file  = "sleep";
      test->addFileTest(file, flags);
   }

   return test;
}