diff --git a/.gitlab/ci/configure_fedora35_shared_mpi_python_qt.cmake b/.gitlab/ci/configure_fedora35_shared_mpi_python_qt.cmake index 8c17ec7d859dccb656e9800dd819a07849e4061d..dfbeaec121e61352bc0f5a70b2b8e7cc7afc6767 100644 --- a/.gitlab/ci/configure_fedora35_shared_mpi_python_qt.cmake +++ b/.gitlab/ci/configure_fedora35_shared_mpi_python_qt.cmake @@ -15,6 +15,8 @@ set(PARAVIEW_PLUGIN_ENABLE_pvNVIDIAIndeX ON CACHE BOOL "") set(PARAVIEW_PLUGIN_ENABLE_CDIReader ON CACHE BOOL "") +set(PARAVIEW_SSH_SERVERS_TESTING ON CACHE BOOL "") + # External package settings. # set(PARAVIEW_BUILD_WITH_EXTERNAL ON CACHE BOOL "") # set(VTK_MODULE_USE_EXTERNAL_ParaView_vtkcatalyst OFF CACHE BOOL "") diff --git a/.gitlab/ci/ssh-test-conf.sh b/.gitlab/ci/ssh-test-conf.sh new file mode 100755 index 0000000000000000000000000000000000000000..24b4255c3c85fdcbbb8ae607ba959bcb5998c6a3 --- /dev/null +++ b/.gitlab/ci/ssh-test-conf.sh @@ -0,0 +1,14 @@ +#!/bin/sh +set -e + +# Append own public key as authorized so we can ssh localhost +mkdir ~/.ssh +ssh-keygen -t rsa -q -f "$HOME/.ssh/id_rsa" -N "" +cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys + +# Run ssh server +systemctl start sshd.service + +# Append ourself to the known hosts to avoid interactive prompt +ssh-keyscan -H localhost >> ~/.ssh/known_hosts +ssh-keyscan -H $HOSTNAME >> ~/.ssh/known_hosts diff --git a/.gitlab/os-linux.yml b/.gitlab/os-linux.yml index 6b5eba2b66ab8548f5f087c747c81ce9e2713af5..e0b1fa7f948860f8db560945dec8927aa41327ce 100644 --- a/.gitlab/os-linux.yml +++ b/.gitlab/os-linux.yml @@ -141,6 +141,7 @@ - .gitlab/ci/ninja.sh - .gitlab/ci/doxygen.sh - .gitlab/ci/sccache.sh + - .gitlab/ci/ssh-test-conf.sh - export PATH=$PWD/.gitlab:$PWD/.gitlab/cmake/bin:$PWD/.gitlab/doxygen/bin:$PATH - cmake --version - ninja --version diff --git a/Clients/ParaView/Testing/XML/RCSSHServerPortForwarding.xml.in b/Clients/ParaView/Testing/XML/RCSSHServerPortForwarding.xml.in index 04bdd4900329182810a0ac28b01e1c18076c4865..81b3f265c64620d841a17960a654d939e1b79f2f 100644 --- a/Clients/ParaView/Testing/XML/RCSSHServerPortForwarding.xml.in +++ b/Clients/ParaView/Testing/XML/RCSSHServerPortForwarding.xml.in @@ -6,6 +6,7 @@ + diff --git a/Clients/ParaView/Testing/XML/SSHServerPortForwarding.xml.in b/Clients/ParaView/Testing/XML/SSHServerPortForwarding.xml.in index 628fab5ecec7ec68f4728bf7f22ddaf638941cb9..997e637cd556b6c5eaf864a93d30a68162c8ed7d 100644 --- a/Clients/ParaView/Testing/XML/SSHServerPortForwarding.xml.in +++ b/Clients/ParaView/Testing/XML/SSHServerPortForwarding.xml.in @@ -6,6 +6,7 @@ + diff --git a/Clients/ParaView/Testing/XML/SimpleRCSSHServer.xml.in b/Clients/ParaView/Testing/XML/SimpleRCSSHServer.xml.in index f2f621bddbbd790daece3e30eb1aef664348e9c8..fe74cb11da4bfbf6473ed56e75e386dd5b26a66c 100644 --- a/Clients/ParaView/Testing/XML/SimpleRCSSHServer.xml.in +++ b/Clients/ParaView/Testing/XML/SimpleRCSSHServer.xml.in @@ -6,6 +6,7 @@ + diff --git a/Clients/ParaView/Testing/XML/SimpleSSHServer.xml.in b/Clients/ParaView/Testing/XML/SimpleSSHServer.xml.in index 0c7b2b07a73e22b43656cf201f22e8e757bd7ae0..3440cbfe88dfde86973b2dde12808106eeda31d5 100644 --- a/Clients/ParaView/Testing/XML/SimpleSSHServer.xml.in +++ b/Clients/ParaView/Testing/XML/SimpleSSHServer.xml.in @@ -6,6 +6,7 @@ + diff --git a/Clients/ParaView/Testing/XML/SimpleSSHServerAskPass.xml.in b/Clients/ParaView/Testing/XML/SimpleSSHServerAskPass.xml.in index a0328d70aecf1c1a0465e8bdf723b003746e6ded..b5df27e2230031ad52a9b35805ea4a4cafdf40f8 100644 --- a/Clients/ParaView/Testing/XML/SimpleSSHServerAskPass.xml.in +++ b/Clients/ParaView/Testing/XML/SimpleSSHServerAskPass.xml.in @@ -6,6 +6,7 @@ + diff --git a/Clients/ParaView/Testing/XML/SimpleSSHServerTermExec.xml.in b/Clients/ParaView/Testing/XML/SimpleSSHServerTermExec.xml.in index 9684e8cfdcb47d659bcaf435d006383762442df7..eb92880665bec8e461421622192d9f7b0b022a5a 100644 --- a/Clients/ParaView/Testing/XML/SimpleSSHServerTermExec.xml.in +++ b/Clients/ParaView/Testing/XML/SimpleSSHServerTermExec.xml.in @@ -6,6 +6,7 @@ + diff --git a/Clients/ParaView/Testing/XML/server.sh.in b/Clients/ParaView/Testing/XML/server.sh.in index 6ead484008f89aec8b5a408a32fedef22a22cc22..01dad792306eb87d1b545468e090b49e34d090d1 100644 --- a/Clients/ParaView/Testing/XML/server.sh.in +++ b/Clients/ParaView/Testing/XML/server.sh.in @@ -1,4 +1,4 @@ -DISPLAY=:0 @ParaView_BINARY_DIR@/bin/pvserver -sp=$1 2>&1 | tee sshServer.log & +DISPLAY=:0 @ParaView_BINARY_DIR@/bin/pvserver --sp=$1 2>&1 | tee sshServer.log & # DIRTY FIX # Wait 120s for all the SSH test to run, then make sure that all remaining instance of x-terminal-emulator are killed diff --git a/Clients/ParaView/Testing/XML/server_rc.sh.in b/Clients/ParaView/Testing/XML/server_rc.sh.in index a093643d12697b6ed502cc8703ee04b1ce65416b..af2150042b34ca1d9e9b2ad9d87966589d1fb6e5 100644 --- a/Clients/ParaView/Testing/XML/server_rc.sh.in +++ b/Clients/ParaView/Testing/XML/server_rc.sh.in @@ -1,4 +1,4 @@ -DISPLAY=:0 @ParaView_BINARY_DIR@/bin/pvserver -rc -ch=$1 -sp=$2 2>&1 | tee sshServer.log & +DISPLAY=:0 @ParaView_BINARY_DIR@/bin/pvserver --rc --client-host=$1 --sp=$2 2>&1 | tee sshServer.log & # DIRTY FIX # Wait 120s for all the SSH test to run, then make sure that all remaining instance of x-terminal-emulator are killed diff --git a/Clients/ParaView/Testing/XML/sshServers.pvsc.in b/Clients/ParaView/Testing/XML/sshServers.pvsc.in index b6a1c9fd6e74deeb20979cbde96e276ce2a6999c..e0c890b66cdd83c928b9a9dcb2c336a8a3a9a740 100644 --- a/Clients/ParaView/Testing/XML/sshServers.pvsc.in +++ b/Clients/ParaView/Testing/XML/sshServers.pvsc.in @@ -1,7 +1,7 @@ - + @@ -13,7 +13,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -38,7 +38,7 @@ - + @@ -51,7 +51,7 @@ - + @@ -64,7 +64,7 @@ - + diff --git a/Qt/ApplicationComponents/pqLoadDataReaction.cxx b/Qt/ApplicationComponents/pqLoadDataReaction.cxx index bfde3434b36976c0db0acf6e3b8a8806b91c3b2e..280fdd4b53e6bd0439bd782306ca3dfbb8f2039e 100644 --- a/Qt/ApplicationComponents/pqLoadDataReaction.cxx +++ b/Qt/ApplicationComponents/pqLoadDataReaction.cxx @@ -86,6 +86,17 @@ QList pqLoadDataReaction::loadData() QList pqLoadDataReaction::loadData(const ReaderSet& readerSet) { pqServer* server = pqActiveObjects::instance().activeServer(); + if (!server) + { + return QList(); + } + + vtkSMSession* session = server->session(); + if (!session) + { + return QList(); + } + vtkSMReaderFactory* readerFactory = vtkSMProxyManager::GetProxyManager()->GetReaderFactory(); std::vector filtersDetailed = @@ -243,8 +254,14 @@ QVector pqLoadDataReaction::loadFilesForSupportedTypes(QList< QVector pqLoadDataReaction::loadFilesForAllTypes( QList files, pqServer* server, vtkSMReaderFactory* readerFactory) { + vtkSMSession* session = server->session(); + if (!session) + { + return QVector(); + } + QVector newSources; - vtkStringList* list = readerFactory->GetReaders(server->session()); + vtkStringList* list = readerFactory->GetReaders(session); for (QStringList const& fileGroups : files) { pqSelectReaderDialog prompt(fileGroups[0], server, list, pqCoreUtilities::mainWidget()); @@ -408,15 +425,27 @@ pqPipelineSource* pqLoadDataReaction::loadData( bool pqLoadDataReaction::TestFileReadability( const QString& file, pqServer* server, vtkSMReaderFactory* vtkNotUsed(factory)) { - return vtkSMReaderFactory::TestFileReadability(file.toUtf8().data(), server->session()); + vtkSMSession* session = server->session(); + if (!session) + { + return false; + } + + return vtkSMReaderFactory::TestFileReadability(file.toUtf8().data(), session); } //----------------------------------------------------------------------------- bool pqLoadDataReaction::DetermineFileReader(const QString& filename, pqServer* server, vtkSMReaderFactory* factory, QPair& readerInfo) { + vtkSMSession* session = server->session(); + if (!session) + { + return false; + } + QString readerType, readerGroup; - vtkStringList* list = factory->GetReaders(filename.toUtf8().data(), server->session()); + vtkStringList* list = factory->GetReaders(filename.toUtf8().data(), session); if (list->GetLength() > 3) { // If more than one readers found. @@ -487,6 +516,12 @@ pqPipelineSource* pqLoadDataReaction::LoadFile( void pqLoadDataReaction::addReaderToDefaults(QString const& readerName, pqServer* server, vtkSMReaderFactory* readerFactory, QString const& customPattern) { + vtkSMSession* session = server->session(); + if (!session) + { + return; + } + auto pxm = server ? server->proxyManager() : nullptr; auto settingsProxy = pxm ? vtkSMSettingsProxy::SafeDownCast(pxm->GetProxy("settings", "RepresentedArrayListSettings")) @@ -498,7 +533,7 @@ void pqLoadDataReaction::addReaderToDefaults(QString const& readerName, pqServer std::string const readerNameString = readerName.toStdString(); - auto filtersDetailed = readerFactory->GetSupportedFileTypesDetailed(server->session()); + auto filtersDetailed = readerFactory->GetSupportedFileTypesDetailed(session); auto readerIt = std::find_if(filtersDetailed.begin(), filtersDetailed.end(), [&](FileTypeDetailed const& fileType) { return fileType.Name == readerNameString; });