修复:完善终端开机及串流交接并接入云管平台
This commit is contained in:
1 parent
8276da0d45
commit
18a9ce995d
25 files changed
+922
-48
No files matched your search
@@ -12,6 +12,7 @@ private slots:
|
||||
void requiresBothReadyMarkers();
|
||||
void acceptsSeparateHardwareTestDecoder();
|
||||
void rejectsSecondStart();
|
||||
void reportsKioskLaunchFailure();
|
||||
void buildsConsistentStreamArguments();
|
||||
void selectsProfileWithoutLosingStats();
|
||||
void rejectsInvalidDecoderOverride();
|
||||
@@ -107,6 +108,41 @@ void MoonlightSessionTest::rejectsSecondStart() {
|
||||
qputenv("PATH", oldPath);
|
||||
}
|
||||
|
||||
void MoonlightSessionTest::reportsKioskLaunchFailure() {
|
||||
QTemporaryDir tempDir;
|
||||
QVERIFY(tempDir.isValid());
|
||||
const QString executable = tempDir.filePath(QStringLiteral("failed-client"));
|
||||
QFile script(executable);
|
||||
QVERIFY(script.open(QIODevice::WriteOnly | QIODevice::Text));
|
||||
script.write("#!/bin/sh\n"
|
||||
"test \"$VDI_KIOSK_STREAM\" = 1 || exit 2\n"
|
||||
"exit 1\n");
|
||||
script.close();
|
||||
QVERIFY(script.setPermissions(QFileDevice::ReadOwner | QFileDevice::WriteOwner |
|
||||
QFileDevice::ExeOwner));
|
||||
MoonlightSession session;
|
||||
MoonlightSession::Options options;
|
||||
options.program = executable;
|
||||
session.setOptions(options);
|
||||
ConnectionTicket ticket;
|
||||
ticket.endpoint = QStringLiteral("127.0.0.1");
|
||||
ticket.app = QStringLiteral("MissingApplication");
|
||||
int failed = 0;
|
||||
int finished = 0;
|
||||
QString message;
|
||||
QVERIFY(session.start(ticket, [&](const MoonlightSession::Event& event) {
|
||||
if (event.type == MoonlightSession::EventType::kFailed) {
|
||||
++failed;
|
||||
message = event.message;
|
||||
} else if (event.type == MoonlightSession::EventType::kFinished) {
|
||||
++finished;
|
||||
}
|
||||
}));
|
||||
QTRY_COMPARE_WITH_TIMEOUT(failed, 1, 2000);
|
||||
QCOMPARE(finished, 0);
|
||||
QVERIFY(message.contains(QStringLiteral("code=1")));
|
||||
}
|
||||
|
||||
void MoonlightSessionTest::buildsConsistentStreamArguments() {
|
||||
ConnectionTicket ticket;
|
||||
ticket.endpoint = QStringLiteral("192.168.1.70");
|
||||
|
||||
Reference in new issue
Block a user