Additional QNX compatibility checks

cut, df and tail are required for the disk space deploy check.

The QNX code creates PID files in /var/run.

rm is used by the /var/run device test. The QNX Qt Creator code
should be using it to to remove the .pid files that it creates.
Currently, it does not do this.  That'll be a separate fix.

Change-Id: Ie6bbe480b10ad5ac6396e882c993b90c61dcfe70
Reviewed-by: Sami Nurmenniemi <sami.nurmenniemi@qt.io>
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
James McDonnell
2018-12-19 16:28:52 -05:00
committed by hjk
parent e5fbeb6219
commit a2224881b4
2 changed files with 39 additions and 0 deletions

View File

@@ -54,6 +54,8 @@ QnxDeviceTester::QnxDeviceTester(QObject *parent)
m_commandsToTest << QLatin1String("awk") m_commandsToTest << QLatin1String("awk")
<< QLatin1String("cat") << QLatin1String("cat")
<< QLatin1String("cut")
<< QLatin1String("df")
<< QLatin1String("grep") << QLatin1String("grep")
<< QLatin1String("kill") << QLatin1String("kill")
<< QLatin1String("netstat") << QLatin1String("netstat")
@@ -61,8 +63,10 @@ QnxDeviceTester::QnxDeviceTester(QObject *parent)
<< QLatin1String("printf") << QLatin1String("printf")
<< QLatin1String("ps") << QLatin1String("ps")
<< QLatin1String("read") << QLatin1String("read")
<< QLatin1String("rm")
<< QLatin1String("sed") << QLatin1String("sed")
<< QLatin1String("sleep") << QLatin1String("sleep")
<< QLatin1String("tail")
<< QLatin1String("uname"); << QLatin1String("uname");
} }
@@ -86,6 +90,7 @@ void QnxDeviceTester::stopTest()
case GenericTest: case GenericTest:
m_genericTester->stopTest(); m_genericTester->stopTest();
break; break;
case VarRunTest:
case CommandsTest: case CommandsTest:
m_processRunner->cancel(); m_processRunner->cancel();
break; break;
@@ -105,6 +110,32 @@ void QnxDeviceTester::handleGenericTestFinished(TestResult result)
return; return;
} }
m_state = VarRunTest;
emit progressMessage(tr("Checking that files can be created in /var/run..."));
m_processRunner->run(QStringLiteral("rm %1 > /dev/null 2>&1; echo ABC > %1 && rm %1")
.arg("/var/run/qtc_xxxx.pid")
.toLatin1(),
m_deviceConfiguration->sshParameters());
}
void QnxDeviceTester::handleVarRunProcessFinished(const QString &error)
{
QTC_ASSERT(m_state == VarRunTest, return);
if (error.isEmpty()) {
if (m_processRunner->processExitCode() == 0) {
emit progressMessage(tr("Files can be created in /var/run.") + QLatin1Char('\n'));
} else {
emit errorMessage(tr("Files cannot be created in /var/run.") + QLatin1Char('\n'));
m_result = TestFailure;
}
} else {
emit errorMessage(tr("An error occurred checking that"
" files can be created in /var/run.")
+ QLatin1Char('\n'));
m_result = TestFailure;
}
m_state = CommandsTest; m_state = CommandsTest;
QnxDevice::ConstPtr qnxDevice = m_deviceConfiguration.dynamicCast<const QnxDevice>(); QnxDevice::ConstPtr qnxDevice = m_deviceConfiguration.dynamicCast<const QnxDevice>();
@@ -115,6 +146,11 @@ void QnxDeviceTester::handleGenericTestFinished(TestResult result)
void QnxDeviceTester::handleProcessFinished(const QString &error) void QnxDeviceTester::handleProcessFinished(const QString &error)
{ {
if (m_state == VarRunTest) {
handleVarRunProcessFinished(error);
return;
}
QTC_ASSERT(m_state == CommandsTest, return); QTC_ASSERT(m_state == CommandsTest, return);
const QString command = m_commandsToTest[m_currentCommandIndex]; const QString command = m_commandsToTest[m_currentCommandIndex];

View File

@@ -53,6 +53,7 @@ private:
enum State { enum State {
Inactive, Inactive,
GenericTest, GenericTest,
VarRunTest,
CommandsTest CommandsTest
}; };
@@ -61,6 +62,8 @@ private:
QStringList versionSpecificCommandsToTest(int versionNumber) const; QStringList versionSpecificCommandsToTest(int versionNumber) const;
void handleVarRunProcessFinished(const QString &error);
RemoteLinux::GenericLinuxDeviceTester *m_genericTester; RemoteLinux::GenericLinuxDeviceTester *m_genericTester;
ProjectExplorer::IDevice::ConstPtr m_deviceConfiguration; ProjectExplorer::IDevice::ConstPtr m_deviceConfiguration;
ProjectExplorer::DeviceTester::TestResult m_result; ProjectExplorer::DeviceTester::TestResult m_result;