Commit Graph

32 Commits

Author SHA1 Message Date
Jarek Kobus
8e931838ef Get rid of SshConnectionInfo
It's not used anymore.

Change-Id: Ie77c9d9bc8eb82c1f74cfdac2304bc6c2f92ee93
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-05-03 14:38:23 +00:00
Christian Stenger
0bd4d38002 Tests: Remove ignored message
This soft assert is no more triggered a second time and
results in a fail now.

Change-Id: Ica850a19993797d412e0b5ff954b5e9760e21f53
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-04-12 08:05:17 +00:00
Jarek Kobus
a6fc7727a1 Get rid of SftpSession
Should be substituted by FilePath actions using remote paths.

Change-Id: Ib1e3913cc94d417045cbe6b922284a2f8ab6d71f
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2022-04-08 15:12:22 +00:00
Jarek Kobus
ab11c4373b QtcProcess: Introduce done() signal
Introduce QtcProcess::done() signal. It's similar to
QtcProcess::finished() signal, but also emitted when
process failed to start (so after QProcess::FailedToStart
error occurred).

SshRemoteProcess::finished() signal was already behaving
like this. So, we remove special handling of
FailedToStart error in this class and connect all clients
of SshRemoteProcess to done() signal, instead of finished().

Task-number: QTCREATORBUG-27232
Change-Id: If4240e2172f3f706e812bca669a1d5b24bdc3285
Reviewed-by: hjk <hjk@qt.io>
2022-04-04 13:28:12 +00:00
Eike Ziller
9fd2a059f6 Merge remote-tracking branch 'origin/7.0'
Conflicts:
	src/plugins/android/androiddevice.cpp
	src/plugins/docker/dockerdevice.cpp

Change-Id: Id16ba0d9993c9f608242622aceae0a2a6691e05e
2022-03-17 08:48:28 +01:00
Christian Stenger
66c5b1e11e RemoteLinux: Avoid unexpected password dialog in tests
Make the test depend on environment variables and give some
hint how to run the test correctly.
Beside this make the test work on Windows and share the setup
with ssh unit test.

Change-Id: I6bbf1ec863449512646ca2c51d13fec537beedbc
Reviewed-by: hjk <hjk@qt.io>
2022-03-16 16:44:27 +00:00
Eike Ziller
cd8c4ced81 Merge remote-tracking branch 'origin/7.0'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri

Change-Id: Ic02df53b880d0861d9d9ea0df3e0d381ae99f350
2022-03-11 09:50:48 +01:00
Christian Stenger
a09c5baedb Tests: Fix expected assert on Windows
Paths are os specific in this context.

Change-Id: Ida8f7a661ca005d0b624f4ce75727df420f51e9b
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-03-09 15:22:29 +00:00
Jarek Kobus
53095f666f SshRemoteProcessRunner: Unify API
Make the API more similar to QtcProcess API.
Rename signals to started() and finished().

Change-Id: I01f3a148749b666b8f145d8769222a234ccc9bce
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-03-02 09:52:47 +00:00
Jarek Kobus
d3c1632a0f SshRemoteProcessRunner: Unify API
Make the API more similar to QtcProcess API.
Drop process prefix for getters.

Change-Id: I21b99bb5b11956d923c0e526c08bbea9686e5c95
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-03-02 09:52:09 +00:00
Jarek Kobus
0dfcc97a3e SshRemoteProcess: Rename done() -> finished()
Change-Id: I9c22d075f50b0a2a171cbda11c7579e4735f3f4e
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-02-28 16:12:27 +00:00
Jarek Kobus
97264e0591 Ssh: Drop ProcessMode from c'tors and creator methods
Change-Id: I2db51f26d9a841f60d5ab3722fa82b3a89d57146
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2022-02-18 10:49:29 +00:00
Jarek Kobus
1d15a934cd QtcProcess: Get rid of useTerminal
Remove SshRemoteProcessRunner::runInTerminal() method,
it wasn't used anywhere (just in test).
Remove QtcProcess::useTerminal, as process should be
created in TerminalOn mode when there is a need for terminal.
Add a parameter to
SshRemoteProcess::fullLocalCommandLine(bool inTerminal)
as this may still be needed when running application
through ssh from terminal (ssh -tt option).

Change-Id: I71911082fcca190b82a1106a2ca1ca48dc5d4c79
Reviewed-by: hjk <hjk@qt.io>
(cherry picked from commit 95a9b22f6f)
2022-01-28 12:19:12 +00:00
Jarek Kobus
95a9b22f6f QtcProcess: Get rid of useTerminal
Remove SshRemoteProcessRunner::runInTerminal() method,
it wasn't used anywhere (just in test).
Remove QtcProcess::useTerminal, as process should be
created in TerminalOn mode when there is a need for terminal.
Add a parameter to
SshRemoteProcess::fullLocalCommandLine(bool inTerminal)
as this may still be needed when running application
through ssh from terminal (ssh -tt option).

Change-Id: I71911082fcca190b82a1106a2ca1ca48dc5d4c79
Reviewed-by: hjk <hjk@qt.io>
2022-01-28 11:56:30 +00:00
Jarek Kobus
ee2960989e Remove unused SshConnection::dataAvailable() signal
Change-Id: I1e12965931a7623ed03d0e703b275eb02ddaf6c7
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-01-03 12:34:24 +00:00
Jarek Kobus
7c674e0a5b Ignore expected assert messages in tst_ssh test
Ignore the:
"state() == Connected" in file [PATH]/sshconnection.cpp, line [LINE]
message when running pristineConnectionObject() test function
of tst_ssh test.

Change-Id: I28e19165d9e540b47252d44b198fd07b15c89cc8
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2021-12-16 08:31:54 +00:00
Eike Ziller
050af56000 Merge remote-tracking branch 'origin/6.0'
Change-Id: If773f217a9708ce0ad0b8adeefe3266ba0371a32
2021-09-29 12:54:38 +02:00
Jarek Kobus
7958de05f5 Introduce Utils::Singleton
Introduce Utils::Singleton class and
Utils::SingletonWithOptionalDependencies class template
that helps implementing singletons that depend on other
singletons. It's guaranteed that whenever singleton B depends
on singleton A, than A is always created before B is being
created, and that the order of destruction is always
opposite to the order of creation.

Dependencies of singleton are listed as template arguments
for SingletonWithOptionalDependencies class template.
The first argument of SingletonWithOptionalDependencies
class template is always a singleton class itself.

Prepare a common interface for all singleton subclasses:
SingletonSubClass *SingletonWithOptionalDependencies::instance();

Make instantiating singletons and its dependencies thread-safe.

Create singletons on demand (only if some code needs them).
It's not needed anymore to explicitly instantiate
all required singletons in tests.

Make it possible (and thread-safe) to instantiate ProcessReaper
and LauncherInterface singletons in non-main threads.

Make the following dependencies between existing singletons:
   SshConnectionManager depends on:
-> LauncherInterface depends on:
-> ProcessReaper

Change-Id: Iefaacab561c2b3dcf07e7fafbb87339ea6a15278
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-09-28 10:25:29 +00:00
hjk
aa4b825809 Ssh: Use FilePath for SshConnectionParameters::privateKeyFile
Change-Id: Ifaf97cc744f80e1fa0f4000aabf83671b2ffd972
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-09-28 09:57:41 +00:00
Jarek Kobus
4b81483b4d Add some explanation about how to run this test
Change-Id: I748e13db89dc79bbf11f663ce6914513d2912766
Reviewed-by: Alp Öz <aoz@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-09-13 10:50:44 +00:00
Jarek Kobus
f72c4cb8ac Ssh: Re-base SshProcess on top of QtcProcess
Change-Id: I266820e0e2ea12d6e4a5a83a679a7279fab9cd83
Reviewed-by: hjk <hjk@qt.io>
2021-09-13 09:26:09 +00:00
Jarek Kobus
33f1a96005 Control the lifetime of SshProcessManager
Make it possible to control when the SshProcessManager is
being constructed / destructed. Expose public constructor.

Since different singletons depend on each other, we need
to control the order of creation and destruction of them.

The order of creation is like that:

1. QCoreApplication
2. ProcessReaper
3. ProcessLauncher
4. SshConnectionManager

The order of destruction must be opposite to the above.

Change-Id: Ice07eb751cd61c03cb461816fa1b74ab040a53de
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-09-10 14:02:21 +00:00
Christian Kandeler
a42d252054 SSH: Fix non-session based download operation
Apparently this one never worked, but as we don't use it in our own
code, that went unnoticed.

Fixes: QTCREATORBUG-25236
Change-Id: Ia013baf3ca2fd01cc14b72d9c6a5f73426539d00
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-01-15 10:41:32 +00:00
Eike Ziller
d54f7b0eb2 Fix building tests with Qt6
Task-number: QTCREATORBUG-24098
Change-Id: I192245125f04f8350597bbe481d80d3f8ba0cae0
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-10-30 15:15:25 +00:00
Cristian Adam
486aaabd21 CMake Build: Use same Qt compiler defines for tests
Source code needed adjustments though.

Change-Id: I78b4610a6bb895a385c7c30a6c92c97a276b89dd
Reviewed-by: hjk <hjk@qt.io>
2019-09-10 15:05:59 +00:00
Christian Stenger
1c438aadde Tests: Skip ssh related test conditionally
If there is no ssh tool present in PATH the test will
fail, so do not expect all machines having ssh explicitly
defined in PATH.

Change-Id: Ic56898ac6a31e75cd2efae6f10464a9aab04b326
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-07-16 04:54:16 +00:00
Christian Kandeler
32afe83108 SSH: Fix autotest
- Consider the case of connection sharing being disabled.
- Adapt to slower environments.

Change-Id: I088622034c26ea343eb78161b24c43b3286b0512
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-06-11 12:02:17 +00:00
hjk
0c3f4b0d85 Ssh: Tiny test simplification
Change-Id: I199e2b422288d29d0a3a059ddc0d145bcb27082b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-06-05 05:42:44 +00:00
Christian Kandeler
d7178b88c4 SSH: Use OpenSSH tools
... instead of our own SSH library.

Advantages:
    - Full compatibility with OpenSSH behavior guaranteed.
    - Minimal maintenance effort.
    - Less code to build.
    - Big chunk of 3rd party sources can be removed from our repository.

One the downside, Windows users now need to install OpenSSH for
RemoteLinux support. Hoewever, people doing embedded development
probably have it installed anyway.

[ChangeLog] Switched SSH backend to OpenSSH

Fixes: QTCREATORBUG-15744
Fixes: QTCREATORBUG-15807
Fixes: QTCREATORBUG-19306
Fixes: QTCREATORBUG-20210
Change-Id: Ifcfefdd39401e45ba1f4aca35d2c5bf7046c7aab
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-12-13 15:10:11 +00:00
Christian Kandeler
1fc2b12ffc SSH: Fix autotest
The SshX11InfoRetriever object must not be allocated on the stack, and
the failure signal was potentially emitted too early for the test to
catch it.

Change-Id: Iac53546deee183c8f02bafdcc11a7910f3e392c0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-12-03 13:47:26 +00:00
Christian Kandeler
424923817c SSH: Implement X11 forwarding
Change-Id: Ia7b15e784cb098bc7c6c6be2748d772192187e97
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-11-19 09:12:31 +00:00
Christian Kandeler
1c6c64df20 SSH: Turn some manual tests into autotests
Change-Id: Id098709ff74dfc31a26ef42d559ce35d0120c0c3
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-10-23 08:28:55 +00:00