mirror of
https://git.jami.net/savoirfairelinux/jami-daemon.git
synced 2025-08-12 22:09:25 +08:00
unitTest: fix fileTransfer, syncHistory
Change-Id: I087ee6e3e0e8f1530272a28f6f940571d542ebc4
This commit is contained in:
File diff suppressed because one or more lines are too long
@ -22,6 +22,7 @@
|
||||
|
||||
#include <condition_variable>
|
||||
#include <string>
|
||||
#include <filesystem>
|
||||
|
||||
#include "fileutils.h"
|
||||
#include "manager.h"
|
||||
@ -59,6 +60,10 @@ public:
|
||||
std::string bobId;
|
||||
std::string carlaId;
|
||||
|
||||
std::string sendPath {std::filesystem::current_path() / "SEND"};
|
||||
std::string recvPath {std::filesystem::current_path() / "RECV"};
|
||||
std::string recv2Path {std::filesystem::current_path() / "RECV2"};
|
||||
|
||||
private:
|
||||
void testFileTransfer();
|
||||
void testDataTransferInfo();
|
||||
@ -157,7 +162,7 @@ FileTransferTest::testFileTransfer()
|
||||
DRing::registerSignalHandlers(confHandlers);
|
||||
|
||||
// Create file to send
|
||||
std::ofstream sendFile("SEND");
|
||||
std::ofstream sendFile(sendPath);
|
||||
CPPUNIT_ASSERT(sendFile.is_open());
|
||||
sendFile << std::string(64000, 'A');
|
||||
sendFile.close();
|
||||
@ -167,7 +172,7 @@ FileTransferTest::testFileTransfer()
|
||||
uint64_t id;
|
||||
info.accountId = aliceAccount->getAccountID();
|
||||
info.peer = bobUri;
|
||||
info.path = "SEND";
|
||||
info.path = sendPath;
|
||||
info.displayName = "SEND";
|
||||
info.bytesProgress = 0;
|
||||
CPPUNIT_ASSERT(DRing::sendFileLegacy(info, id) == DRing::DataTransferError::success);
|
||||
@ -175,8 +180,7 @@ FileTransferTest::testFileTransfer()
|
||||
cv.wait_for(lk, std::chrono::seconds(30));
|
||||
CPPUNIT_ASSERT(transferWaiting);
|
||||
|
||||
auto rcv_path = "RECV";
|
||||
CPPUNIT_ASSERT(DRing::acceptFileTransfer(bobId, finalId, rcv_path)
|
||||
CPPUNIT_ASSERT(DRing::acceptFileTransfer(bobId, finalId, recvPath)
|
||||
== DRing::DataTransferError::success);
|
||||
|
||||
// Wait 2 times, both sides will got a finished status
|
||||
@ -184,12 +188,12 @@ FileTransferTest::testFileTransfer()
|
||||
cv.wait_for(lk, std::chrono::seconds(30));
|
||||
CPPUNIT_ASSERT(transferFinished);
|
||||
|
||||
CPPUNIT_ASSERT(compare(info.path, rcv_path));
|
||||
CPPUNIT_ASSERT(compare(info.path, recvPath));
|
||||
|
||||
// TODO FIX ME. The ICE take some time to stop and it doesn't seems to like
|
||||
// when stopping the daemon and removing the accounts to soon.
|
||||
std::remove("SEND");
|
||||
std::remove("RECV");
|
||||
std::remove(sendPath.c_str());
|
||||
std::remove(recvPath.c_str());
|
||||
JAMI_INFO("Waiting....");
|
||||
std::this_thread::sleep_for(std::chrono::seconds(3));
|
||||
}
|
||||
@ -235,7 +239,7 @@ FileTransferTest::testDataTransferInfo()
|
||||
DRing::registerSignalHandlers(confHandlers);
|
||||
|
||||
// Create file to send
|
||||
std::ofstream sendFile("SEND");
|
||||
std::ofstream sendFile(sendPath);
|
||||
CPPUNIT_ASSERT(sendFile.is_open());
|
||||
sendFile << std::string(64000, 'A');
|
||||
sendFile.close();
|
||||
@ -245,7 +249,7 @@ FileTransferTest::testDataTransferInfo()
|
||||
uint64_t id;
|
||||
info.accountId = aliceAccount->getAccountID();
|
||||
info.peer = bobUri;
|
||||
info.path = "SEND";
|
||||
info.path = sendPath;
|
||||
info.displayName = "SEND";
|
||||
info.bytesProgress = 0;
|
||||
CPPUNIT_ASSERT(DRing::sendFileLegacy(info, id) == DRing::DataTransferError::success);
|
||||
@ -267,8 +271,7 @@ FileTransferTest::testDataTransferInfo()
|
||||
CPPUNIT_ASSERT(info.bytesProgress == 0);
|
||||
CPPUNIT_ASSERT(info.totalSize == 64000);
|
||||
|
||||
auto rcv_path = "RECV";
|
||||
CPPUNIT_ASSERT(DRing::acceptFileTransfer(bobId, finalId, rcv_path)
|
||||
CPPUNIT_ASSERT(DRing::acceptFileTransfer(bobId, finalId, recvPath)
|
||||
== DRing::DataTransferError::success);
|
||||
|
||||
// Wait 2 times, both sides will got a finished status
|
||||
@ -276,7 +279,7 @@ FileTransferTest::testDataTransferInfo()
|
||||
cv.wait_for(lk, std::chrono::seconds(30));
|
||||
CPPUNIT_ASSERT(transferFinished);
|
||||
|
||||
CPPUNIT_ASSERT(compare(info.path, rcv_path));
|
||||
CPPUNIT_ASSERT(compare(info.path, recvPath));
|
||||
|
||||
CPPUNIT_ASSERT(DRing::dataTransferInfo(bobId, std::to_string(id), info)
|
||||
== DRing::DataTransferError::success);
|
||||
@ -287,8 +290,8 @@ FileTransferTest::testDataTransferInfo()
|
||||
|
||||
// TODO FIX ME. The ICE take some time to stop and it doesn't seems to like
|
||||
// when stopping the daemon and removing the accounts to soon.
|
||||
std::remove("SEND");
|
||||
std::remove("RECV");
|
||||
std::remove(sendPath.c_str());
|
||||
std::remove(recvPath.c_str());
|
||||
JAMI_INFO("Waiting....");
|
||||
std::this_thread::sleep_for(std::chrono::seconds(3));
|
||||
}
|
||||
@ -330,11 +333,12 @@ FileTransferTest::testMultipleFileTransfer()
|
||||
DRing::registerSignalHandlers(confHandlers);
|
||||
|
||||
// Create file to send
|
||||
std::ofstream sendFile("SEND");
|
||||
std::ofstream sendFile(sendPath);
|
||||
CPPUNIT_ASSERT(sendFile.is_open());
|
||||
sendFile << std::string(64000, 'A');
|
||||
sendFile.close();
|
||||
std::ofstream sendFile2("SEND2");
|
||||
auto sendPath2 = std::filesystem::current_path().u8string() + DIR_SEPARATOR_CH + "SEND2";
|
||||
std::ofstream sendFile2(sendPath2);
|
||||
CPPUNIT_ASSERT(sendFile2.is_open());
|
||||
sendFile2 << std::string(64000, 'B');
|
||||
sendFile2.close();
|
||||
@ -344,7 +348,7 @@ FileTransferTest::testMultipleFileTransfer()
|
||||
uint64_t id;
|
||||
info.accountId = aliceAccount->getAccountID();
|
||||
info.peer = bobUri;
|
||||
info.path = "SEND";
|
||||
info.path = sendPath;
|
||||
info.displayName = "SEND";
|
||||
info.bytesProgress = 0;
|
||||
CPPUNIT_ASSERT(DRing::sendFileLegacy(info, id) == DRing::DataTransferError::success);
|
||||
@ -353,8 +357,7 @@ FileTransferTest::testMultipleFileTransfer()
|
||||
CPPUNIT_ASSERT(transferWaiting);
|
||||
transferWaiting = false;
|
||||
|
||||
auto rcv_path = "RECV";
|
||||
CPPUNIT_ASSERT(DRing::acceptFileTransfer(bobId, finalId, rcv_path)
|
||||
CPPUNIT_ASSERT(DRing::acceptFileTransfer(bobId, finalId, recvPath)
|
||||
== DRing::DataTransferError::success);
|
||||
|
||||
// Wait 2 times, both sides will got a finished status
|
||||
@ -362,13 +365,13 @@ FileTransferTest::testMultipleFileTransfer()
|
||||
cv.wait_for(lk, std::chrono::seconds(30));
|
||||
CPPUNIT_ASSERT(transferFinished);
|
||||
|
||||
CPPUNIT_ASSERT(compare(info.path, rcv_path));
|
||||
CPPUNIT_ASSERT(compare(info.path, recvPath));
|
||||
|
||||
// Send File
|
||||
DRing::DataTransferInfo info2;
|
||||
info2.accountId = aliceAccount->getAccountID();
|
||||
info2.peer = bobUri;
|
||||
info2.path = "SEND2";
|
||||
info2.path = sendPath2;
|
||||
info2.displayName = "SEND2";
|
||||
info2.bytesProgress = 0;
|
||||
CPPUNIT_ASSERT(DRing::sendFileLegacy(info2, id) == DRing::DataTransferError::success);
|
||||
@ -376,8 +379,7 @@ FileTransferTest::testMultipleFileTransfer()
|
||||
cv.wait_for(lk, std::chrono::seconds(30));
|
||||
CPPUNIT_ASSERT(transferWaiting);
|
||||
|
||||
rcv_path = "RECV2";
|
||||
CPPUNIT_ASSERT(DRing::acceptFileTransfer(bobId, finalId, rcv_path)
|
||||
CPPUNIT_ASSERT(DRing::acceptFileTransfer(bobId, finalId, recv2Path)
|
||||
== DRing::DataTransferError::success);
|
||||
|
||||
// Wait 2 times, both sides will got a finished status
|
||||
@ -385,14 +387,14 @@ FileTransferTest::testMultipleFileTransfer()
|
||||
cv.wait_for(lk, std::chrono::seconds(30));
|
||||
CPPUNIT_ASSERT(transferFinished);
|
||||
|
||||
CPPUNIT_ASSERT(compare(info2.path, rcv_path));
|
||||
CPPUNIT_ASSERT(compare(info2.path, recv2Path));
|
||||
|
||||
// TODO FIX ME. The ICE take some time to stop and it doesn't seems to like
|
||||
// when stopping the daemon and removing the accounts to soon.
|
||||
std::remove("SEND");
|
||||
std::remove("SEND2");
|
||||
std::remove("RECV");
|
||||
std::remove("RECV2");
|
||||
std::remove(sendPath.c_str());
|
||||
std::remove(sendPath2.c_str());
|
||||
std::remove(recvPath.c_str());
|
||||
std::remove(recv2Path.c_str());
|
||||
JAMI_INFO("Waiting....");
|
||||
std::this_thread::sleep_for(std::chrono::seconds(3));
|
||||
}
|
||||
@ -408,26 +410,13 @@ FileTransferTest::testConversationFileTransfer()
|
||||
aliceAccount->trackBuddyPresence(carlaUri, true);
|
||||
|
||||
// Enable carla
|
||||
Manager::instance().sendRegister(carlaId, true);
|
||||
wait_for_announcement_of(carlaId);
|
||||
|
||||
std::map<std::string, std::shared_ptr<DRing::CallbackWrapperBase>> confHandlers;
|
||||
std::mutex mtx;
|
||||
std::unique_lock<std::mutex> lk {mtx};
|
||||
std::condition_variable cv;
|
||||
confHandlers.insert(
|
||||
DRing::exportable_callback<DRing::ConfigurationSignal::VolatileDetailsChanged>(
|
||||
[&](const std::string&, const std::map<std::string, std::string>&) {
|
||||
auto details = carlaAccount->getVolatileAccountDetails();
|
||||
auto daemonStatus = details[DRing::Account::ConfProperties::Registration::STATUS];
|
||||
if (daemonStatus == "REGISTERED") {
|
||||
cv.notify_one();
|
||||
}
|
||||
}));
|
||||
DRing::registerSignalHandlers(confHandlers);
|
||||
|
||||
Manager::instance().sendRegister(carlaId, true);
|
||||
cv.wait_for(lk, std::chrono::seconds(30));
|
||||
confHandlers.clear();
|
||||
DRing::unregisterSignalHandlers();
|
||||
|
||||
auto requestReceived = 0;
|
||||
auto conversationReady = 0;
|
||||
auto memberJoined = 0;
|
||||
@ -469,10 +458,12 @@ FileTransferTest::testConversationFileTransfer()
|
||||
}));
|
||||
confHandlers.insert(DRing::exportable_callback<DRing::DataTransferSignal::DataTransferEvent>(
|
||||
[&](const std::string& accountId,
|
||||
const std::string&,
|
||||
const std::string& conversationId,
|
||||
const std::string&,
|
||||
const std::string& fileId,
|
||||
int code) {
|
||||
if (conversationId.empty())
|
||||
return;
|
||||
if (code == static_cast<int>(DRing::DataTransferEventCode::wait_host_acceptance)) {
|
||||
if (accountId == bobId)
|
||||
hostAcceptanceBob = fileId;
|
||||
@ -503,26 +494,26 @@ FileTransferTest::testConversationFileTransfer()
|
||||
});
|
||||
|
||||
// Send file
|
||||
std::ofstream sendFile("SEND");
|
||||
std::ofstream sendFile(sendPath);
|
||||
CPPUNIT_ASSERT(sendFile.is_open());
|
||||
sendFile << std::string(64000, 'A');
|
||||
sendFile.close();
|
||||
|
||||
DRing::sendFile(aliceId, convId, "SEND", "SEND", "");
|
||||
DRing::sendFile(aliceId, convId, sendPath, "SEND", "");
|
||||
|
||||
CPPUNIT_ASSERT(cv.wait_for(lk, std::chrono::seconds(45), [&]() {
|
||||
return !tidBob.empty() && !tidCarla.empty();
|
||||
}));
|
||||
|
||||
DRing::downloadFile(bobId, convId, iidBob, tidBob, "RCV");
|
||||
DRing::downloadFile(carlaId, convId, iidCarla, tidCarla, "RCV2");
|
||||
DRing::downloadFile(bobId, convId, iidBob, tidBob, recvPath);
|
||||
DRing::downloadFile(carlaId, convId, iidCarla, tidCarla, recv2Path);
|
||||
|
||||
CPPUNIT_ASSERT(
|
||||
cv.wait_for(lk, std::chrono::seconds(45), [&]() { return finished.size() == 3; }));
|
||||
|
||||
std::remove("SEND");
|
||||
std::remove("RCV");
|
||||
std::remove("RCV2");
|
||||
std::remove(sendPath.c_str());
|
||||
std::remove(recvPath.c_str());
|
||||
std::remove(recv2Path.c_str());
|
||||
|
||||
DRing::unregisterSignalHandlers();
|
||||
}
|
||||
@ -606,24 +597,24 @@ FileTransferTest::testFileTransferInConversation()
|
||||
}));
|
||||
|
||||
// Create file to send
|
||||
std::ofstream sendFile("SEND");
|
||||
std::ofstream sendFile(sendPath);
|
||||
CPPUNIT_ASSERT(sendFile.is_open());
|
||||
sendFile << std::string(64000, 'A');
|
||||
sendFile.close();
|
||||
|
||||
DRing::sendFile(aliceId, convId, "SEND", "SEND", "");
|
||||
DRing::sendFile(aliceId, convId, sendPath, "SEND", "");
|
||||
|
||||
CPPUNIT_ASSERT(cv.wait_for(lk, std::chrono::seconds(30), [&]() { return !tidBob.empty(); }));
|
||||
|
||||
transferAFinished = false;
|
||||
transferBFinished = false;
|
||||
DRing::downloadFile(bobId, convId, iidBob, tidBob, "RECV");
|
||||
DRing::downloadFile(bobId, convId, iidBob, tidBob, recvPath);
|
||||
CPPUNIT_ASSERT(cv.wait_for(lk, std::chrono::seconds(30), [&]() {
|
||||
return transferAFinished && transferBFinished;
|
||||
}));
|
||||
|
||||
std::remove("SEND");
|
||||
std::remove("RECV");
|
||||
std::remove(sendPath.c_str());
|
||||
std::remove(recvPath.c_str());
|
||||
DRing::unregisterSignalHandlers();
|
||||
std::this_thread::sleep_for(std::chrono::seconds(5));
|
||||
}
|
||||
@ -716,32 +707,31 @@ FileTransferTest::testBadSha3sumOut()
|
||||
}));
|
||||
|
||||
// Create file to send
|
||||
std::ofstream sendFile("SEND");
|
||||
std::ofstream sendFile(sendPath);
|
||||
CPPUNIT_ASSERT(sendFile.is_open());
|
||||
sendFile << std::string(64000, 'A');
|
||||
sendFile.close();
|
||||
|
||||
DRing::sendFile(aliceId, convId, "SEND", "SEND", "");
|
||||
DRing::sendFile(aliceId, convId, sendPath, "SEND", "");
|
||||
|
||||
CPPUNIT_ASSERT(cv.wait_for(lk, std::chrono::seconds(30), [&]() { return !mid.empty(); }));
|
||||
|
||||
// modifiy file
|
||||
sendFile = std::ofstream("SEND");
|
||||
sendFile = std::ofstream(sendPath);
|
||||
CPPUNIT_ASSERT(sendFile.is_open());
|
||||
// Avoid ASAN error on big alloc sendFile << std::string("B", 64000);
|
||||
for (int i = 0; i < 64000; ++i)
|
||||
sendFile << "B";
|
||||
sendFile << std::string(64000, 'B');
|
||||
sendFile.close();
|
||||
|
||||
transferAFinished = false;
|
||||
transferBFinished = false;
|
||||
DRing::downloadFile(bobId, convId, iid, mid, "RECV");
|
||||
DRing::downloadFile(bobId, convId, iid, mid, recvPath);
|
||||
|
||||
// The file transfer will not be sent as modified
|
||||
CPPUNIT_ASSERT(!cv.wait_for(lk, std::chrono::seconds(30), [&]() { return transferAFinished; }));
|
||||
CPPUNIT_ASSERT(!cv.wait_for(lk, std::chrono::seconds(30), [&]() { return transferBFinished; }));
|
||||
CPPUNIT_ASSERT(!cv.wait_for(lk, std::chrono::seconds(30), [&]() {
|
||||
return transferAFinished || transferBFinished;
|
||||
}));
|
||||
|
||||
std::remove("SEND");
|
||||
std::remove(sendPath.c_str());
|
||||
DRing::unregisterSignalHandlers();
|
||||
}
|
||||
|
||||
@ -833,17 +823,17 @@ FileTransferTest::testBadSha3sumIn()
|
||||
}));
|
||||
|
||||
// Create file to send
|
||||
std::ofstream sendFile("SEND");
|
||||
std::ofstream sendFile(sendPath);
|
||||
CPPUNIT_ASSERT(sendFile.is_open());
|
||||
sendFile << std::string(64000, 'A');
|
||||
sendFile.close();
|
||||
|
||||
aliceAccount->noSha3sumVerification(true);
|
||||
DRing::sendFile(aliceId, convId, "SEND", "SEND", "");
|
||||
DRing::sendFile(aliceId, convId, sendPath, "SEND", "");
|
||||
CPPUNIT_ASSERT(cv.wait_for(lk, std::chrono::seconds(30), [&]() { return !mid.empty(); }));
|
||||
|
||||
// modifiy file
|
||||
sendFile = std::ofstream("SEND");
|
||||
sendFile = std::ofstream(sendPath);
|
||||
CPPUNIT_ASSERT(sendFile.is_open());
|
||||
// Avoid ASAN error on big alloc sendFile << std::string("B", 64000);
|
||||
sendFile << std::string(64000, 'B');
|
||||
@ -851,13 +841,13 @@ FileTransferTest::testBadSha3sumIn()
|
||||
|
||||
transferAFinished = false;
|
||||
transferBFinished = false;
|
||||
DRing::downloadFile(bobId, convId, iid, mid, "RECV");
|
||||
DRing::downloadFile(bobId, convId, iid, mid, recvPath);
|
||||
|
||||
// The file transfer will be sent but refused by bob
|
||||
CPPUNIT_ASSERT(cv.wait_for(lk, std::chrono::seconds(30), [&]() { return transferAFinished; }));
|
||||
CPPUNIT_ASSERT(!cv.wait_for(lk, std::chrono::seconds(30), [&]() { return transferBFinished; }));
|
||||
|
||||
std::remove("SEND");
|
||||
std::remove(sendPath.c_str());
|
||||
DRing::unregisterSignalHandlers();
|
||||
}
|
||||
|
||||
@ -966,30 +956,30 @@ FileTransferTest::testAskToMultipleParticipants()
|
||||
}));
|
||||
|
||||
// Create file to send
|
||||
std::ofstream sendFile("SEND");
|
||||
std::ofstream sendFile(sendPath);
|
||||
CPPUNIT_ASSERT(sendFile.is_open());
|
||||
sendFile << std::string(64000, 'A');
|
||||
sendFile.close();
|
||||
|
||||
DRing::sendFile(aliceId, convId, "SEND", "SEND", "");
|
||||
DRing::sendFile(aliceId, convId, sendPath, "SEND", "");
|
||||
|
||||
CPPUNIT_ASSERT(cv.wait_for(lk, std::chrono::seconds(30), [&]() {
|
||||
return !bobTid.empty() && !carlaTid.empty();
|
||||
}));
|
||||
|
||||
transferCFinished = false;
|
||||
DRing::downloadFile(carlaId, convId, iidCarla, carlaTid, "RECV2");
|
||||
DRing::downloadFile(carlaId, convId, iidCarla, carlaTid, recv2Path);
|
||||
CPPUNIT_ASSERT(cv.wait_for(lk, std::chrono::seconds(30), [&]() { return transferCFinished; }));
|
||||
CPPUNIT_ASSERT(fileutils::isFile("RECV2"));
|
||||
CPPUNIT_ASSERT(fileutils::isFile(recv2Path));
|
||||
|
||||
transferBFinished = false;
|
||||
DRing::downloadFile(bobId, convId, iidBob, bobTid, "RECV");
|
||||
DRing::downloadFile(bobId, convId, iidBob, bobTid, recvPath);
|
||||
CPPUNIT_ASSERT(cv.wait_for(lk, std::chrono::seconds(30), [&]() { return transferBFinished; }));
|
||||
CPPUNIT_ASSERT(fileutils::isFile("RECV"));
|
||||
CPPUNIT_ASSERT(fileutils::isFile(recvPath));
|
||||
|
||||
std::remove("SEND");
|
||||
std::remove("RECV");
|
||||
std::remove("RECV2");
|
||||
std::remove(sendPath.c_str());
|
||||
std::remove(recvPath.c_str());
|
||||
std::remove(recv2Path.c_str());
|
||||
DRing::unregisterSignalHandlers();
|
||||
}
|
||||
|
||||
@ -1074,24 +1064,24 @@ FileTransferTest::testCancelInTransfer()
|
||||
}));
|
||||
|
||||
// Create file to send
|
||||
std::ofstream sendFile("SEND");
|
||||
std::ofstream sendFile(sendPath);
|
||||
CPPUNIT_ASSERT(sendFile.is_open());
|
||||
sendFile << std::string(64000, 'A');
|
||||
sendFile.close();
|
||||
|
||||
DRing::sendFile(aliceId, convId, "SEND", "SEND", "");
|
||||
DRing::sendFile(aliceId, convId, sendPath, "SEND", "");
|
||||
|
||||
CPPUNIT_ASSERT(cv.wait_for(lk, std::chrono::seconds(30), [&]() { return !tidBob.empty(); }));
|
||||
|
||||
transferBOngoing = false;
|
||||
CPPUNIT_ASSERT(DRing::downloadFile(bobId, convId, iidBob, tidBob, "RECV"));
|
||||
CPPUNIT_ASSERT(DRing::downloadFile(bobId, convId, iidBob, tidBob, recvPath));
|
||||
CPPUNIT_ASSERT(cv.wait_for(lk, std::chrono::seconds(30), [&]() { return transferBOngoing; }));
|
||||
transferBFinished = false;
|
||||
DRing::cancelDataTransfer(bobId, convId, tidBob);
|
||||
CPPUNIT_ASSERT(cv.wait_for(lk, std::chrono::seconds(30), [&]() { return transferBFinished; }));
|
||||
CPPUNIT_ASSERT(!fileutils::isFile("RECV"));
|
||||
CPPUNIT_ASSERT(!fileutils::isFile(recvPath));
|
||||
|
||||
std::remove("SEND");
|
||||
std::remove(sendPath.c_str());
|
||||
DRing::unregisterSignalHandlers();
|
||||
}
|
||||
|
||||
@ -1174,12 +1164,12 @@ FileTransferTest::testTransferInfo()
|
||||
}));
|
||||
|
||||
// Create file to send
|
||||
std::ofstream sendFile("SEND");
|
||||
std::ofstream sendFile(sendPath);
|
||||
CPPUNIT_ASSERT(sendFile.is_open());
|
||||
sendFile << std::string(64000, 'A');
|
||||
sendFile.close();
|
||||
|
||||
DRing::sendFile(aliceId, convId, "SEND", "SEND", "");
|
||||
DRing::sendFile(aliceId, convId, sendPath, "SEND", "");
|
||||
CPPUNIT_ASSERT(cv.wait_for(lk, std::chrono::seconds(30), [&]() { return !tidBob.empty(); }));
|
||||
|
||||
int64_t totalSize, bytesProgress;
|
||||
@ -1192,7 +1182,7 @@ FileTransferTest::testTransferInfo()
|
||||
|
||||
transferAFinished = false;
|
||||
transferBFinished = false;
|
||||
DRing::downloadFile(bobId, convId, iidBob, tidBob, "RECV");
|
||||
DRing::downloadFile(bobId, convId, iidBob, tidBob, recvPath);
|
||||
CPPUNIT_ASSERT(cv.wait_for(lk, std::chrono::seconds(30), [&]() {
|
||||
return transferAFinished && transferBFinished;
|
||||
}));
|
||||
@ -1203,8 +1193,8 @@ FileTransferTest::testTransferInfo()
|
||||
CPPUNIT_ASSERT(totalSize == 64000);
|
||||
CPPUNIT_ASSERT(fileutils::isFile(path));
|
||||
|
||||
std::remove("SEND");
|
||||
std::remove("RECV");
|
||||
std::remove(sendPath.c_str());
|
||||
std::remove(recvPath.c_str());
|
||||
DRing::unregisterSignalHandlers();
|
||||
std::this_thread::sleep_for(std::chrono::seconds(5));
|
||||
}
|
||||
|
@ -121,15 +121,12 @@ SyncHistoryTest::testCreateConversationThenSync()
|
||||
details[ConfProperties::ARCHIVE_PASSWORD] = "";
|
||||
details[ConfProperties::ARCHIVE_PIN] = "";
|
||||
details[ConfProperties::ARCHIVE_PATH] = aliceArchive;
|
||||
alice2Id = Manager::instance().addAccount(details);
|
||||
|
||||
wait_for_announcement_of(alice2Id);
|
||||
|
||||
std::mutex mtx;
|
||||
std::unique_lock<std::mutex> lk {mtx};
|
||||
std::condition_variable cv;
|
||||
std::map<std::string, std::shared_ptr<DRing::CallbackWrapperBase>> confHandlers;
|
||||
auto conversationReady = false;
|
||||
auto conversationReady = false, alice2Ready = false;
|
||||
confHandlers.insert(DRing::exportable_callback<DRing::ConversationSignal::ConversationReady>(
|
||||
[&](const std::string& accountId, const std::string& conversationId) {
|
||||
if (accountId == alice2Id && conversationId == convId) {
|
||||
@ -137,8 +134,22 @@ SyncHistoryTest::testCreateConversationThenSync()
|
||||
cv.notify_one();
|
||||
}
|
||||
}));
|
||||
confHandlers.insert(
|
||||
DRing::exportable_callback<DRing::ConfigurationSignal::VolatileDetailsChanged>(
|
||||
[&](const std::string& accountId, const std::map<std::string, std::string>& details) {
|
||||
if (alice2Id != accountId) {
|
||||
return;
|
||||
}
|
||||
alice2Ready = details.at(DRing::Account::VolatileProperties::DEVICE_ANNOUNCED)
|
||||
== "true";
|
||||
cv.notify_one();
|
||||
}));
|
||||
DRing::registerSignalHandlers(confHandlers);
|
||||
CPPUNIT_ASSERT(cv.wait_for(lk, std::chrono::seconds(30), [&] { return conversationReady; }));
|
||||
alice2Id = Manager::instance().addAccount(details);
|
||||
CPPUNIT_ASSERT(cv.wait_for(lk, std::chrono::seconds(30), [&] {
|
||||
return alice2Ready && conversationReady;
|
||||
}));
|
||||
std::remove(aliceArchive.c_str());
|
||||
}
|
||||
|
||||
void
|
||||
@ -158,8 +169,6 @@ SyncHistoryTest::testCreateConversationWithOnlineDevice()
|
||||
details[ConfProperties::ARCHIVE_PASSWORD] = "";
|
||||
details[ConfProperties::ARCHIVE_PIN] = "";
|
||||
details[ConfProperties::ARCHIVE_PATH] = aliceArchive;
|
||||
alice2Id = Manager::instance().addAccount(details);
|
||||
wait_for_announcement_of(alice2Id);
|
||||
|
||||
std::mutex mtx;
|
||||
std::unique_lock<std::mutex> lk {mtx};
|
||||
@ -168,7 +177,7 @@ SyncHistoryTest::testCreateConversationWithOnlineDevice()
|
||||
|
||||
// Start conversation now
|
||||
auto convId = aliceAccount->startConversation();
|
||||
auto conversationReady = false;
|
||||
auto conversationReady = false, alice2Ready = false;
|
||||
confHandlers.insert(DRing::exportable_callback<DRing::ConversationSignal::ConversationReady>(
|
||||
[&](const std::string& accountId, const std::string& conversationId) {
|
||||
if (accountId == alice2Id && conversationId == convId) {
|
||||
@ -176,9 +185,23 @@ SyncHistoryTest::testCreateConversationWithOnlineDevice()
|
||||
cv.notify_one();
|
||||
}
|
||||
}));
|
||||
confHandlers.insert(
|
||||
DRing::exportable_callback<DRing::ConfigurationSignal::VolatileDetailsChanged>(
|
||||
[&](const std::string& accountId, const std::map<std::string, std::string>& details) {
|
||||
if (alice2Id != accountId) {
|
||||
return;
|
||||
}
|
||||
alice2Ready = details.at(DRing::Account::VolatileProperties::DEVICE_ANNOUNCED)
|
||||
== "true";
|
||||
cv.notify_one();
|
||||
}));
|
||||
DRing::registerSignalHandlers(confHandlers);
|
||||
CPPUNIT_ASSERT(cv.wait_for(lk, std::chrono::seconds(30), [&] { return conversationReady; }));
|
||||
alice2Id = Manager::instance().addAccount(details);
|
||||
CPPUNIT_ASSERT(cv.wait_for(lk, std::chrono::seconds(60), [&] {
|
||||
return alice2Ready && conversationReady;
|
||||
}));
|
||||
DRing::unregisterSignalHandlers();
|
||||
std::remove(aliceArchive.c_str());
|
||||
}
|
||||
|
||||
void
|
||||
@ -210,15 +233,6 @@ SyncHistoryTest::testCreateConversationWithMessagesThenAddDevice()
|
||||
std::condition_variable cv;
|
||||
std::map<std::string, std::shared_ptr<DRing::CallbackWrapperBase>> confHandlers;
|
||||
auto conversationReady = false;
|
||||
confHandlers.insert(
|
||||
DRing::exportable_callback<DRing::ConfigurationSignal::VolatileDetailsChanged>(
|
||||
[&](const std::string&, const std::map<std::string, std::string>&) {
|
||||
auto alice2Account = Manager::instance().getAccount<JamiAccount>(alice2Id);
|
||||
auto details = alice2Account->getVolatileAccountDetails();
|
||||
auto daemonStatus = details[DRing::Account::ConfProperties::Registration::STATUS];
|
||||
if (daemonStatus == "REGISTERED")
|
||||
cv.notify_one();
|
||||
}));
|
||||
confHandlers.insert(DRing::exportable_callback<DRing::ConversationSignal::ConversationReady>(
|
||||
[&](const std::string& accountId, const std::string& conversationId) {
|
||||
if (accountId == alice2Id && conversationId == convId) {
|
||||
@ -254,6 +268,7 @@ SyncHistoryTest::testCreateConversationWithMessagesThenAddDevice()
|
||||
CPPUNIT_ASSERT(messages[0]["body"] == "Message 3");
|
||||
CPPUNIT_ASSERT(messages[1]["body"] == "Message 2");
|
||||
CPPUNIT_ASSERT(messages[2]["body"] == "Message 1");
|
||||
std::remove(aliceArchive.c_str());
|
||||
}
|
||||
|
||||
void
|
||||
@ -300,19 +315,8 @@ SyncHistoryTest::testCreateMultipleConversationThenAddDevice()
|
||||
std::condition_variable cv;
|
||||
std::map<std::string, std::shared_ptr<DRing::CallbackWrapperBase>> confHandlers;
|
||||
std::atomic_int conversationReady = 0;
|
||||
confHandlers.insert(
|
||||
DRing::exportable_callback<DRing::ConfigurationSignal::VolatileDetailsChanged>(
|
||||
[&](const std::string&, const std::map<std::string, std::string>&) {
|
||||
auto alice2Account = Manager::instance().getAccount<JamiAccount>(alice2Id);
|
||||
if (!alice2Account)
|
||||
return;
|
||||
auto details = alice2Account->getVolatileAccountDetails();
|
||||
auto daemonStatus = details[DRing::Account::ConfProperties::Registration::STATUS];
|
||||
if (daemonStatus == "REGISTERED")
|
||||
cv.notify_one();
|
||||
}));
|
||||
confHandlers.insert(DRing::exportable_callback<DRing::ConversationSignal::ConversationReady>(
|
||||
[&](const std::string& accountId, const std::string& conversationId) {
|
||||
[&](const std::string& accountId, const std::string&) {
|
||||
if (accountId == alice2Id) {
|
||||
conversationReady += 1;
|
||||
cv.notify_one();
|
||||
@ -325,6 +329,7 @@ SyncHistoryTest::testCreateMultipleConversationThenAddDevice()
|
||||
CPPUNIT_ASSERT(
|
||||
cv.wait_for(lk, std::chrono::seconds(60), [&]() { return conversationReady == 4; }));
|
||||
DRing::unregisterSignalHandlers();
|
||||
std::remove(aliceArchive.c_str());
|
||||
}
|
||||
|
||||
void
|
||||
@ -403,6 +408,7 @@ SyncHistoryTest::testReceivesInviteThenAddDevice()
|
||||
|
||||
CPPUNIT_ASSERT(cv.wait_for(lk, std::chrono::seconds(30), [&] { return requestReceived; }));
|
||||
DRing::unregisterSignalHandlers();
|
||||
std::remove(aliceArchive.c_str());
|
||||
}
|
||||
|
||||
void
|
||||
@ -422,8 +428,6 @@ SyncHistoryTest::testRemoveConversationOnAllDevices()
|
||||
details[ConfProperties::ARCHIVE_PASSWORD] = "";
|
||||
details[ConfProperties::ARCHIVE_PIN] = "";
|
||||
details[ConfProperties::ARCHIVE_PATH] = aliceArchive;
|
||||
alice2Id = Manager::instance().addAccount(details);
|
||||
wait_for_announcement_of(alice2Id);
|
||||
|
||||
std::mutex mtx;
|
||||
std::unique_lock<std::mutex> lk {mtx};
|
||||
@ -432,6 +436,7 @@ SyncHistoryTest::testRemoveConversationOnAllDevices()
|
||||
|
||||
// Start conversation now
|
||||
auto convId = aliceAccount->startConversation();
|
||||
bool alice2Ready = false;
|
||||
auto conversationReady = false, conversationRemoved = false;
|
||||
confHandlers.insert(DRing::exportable_callback<DRing::ConversationSignal::ConversationReady>(
|
||||
[&](const std::string& accountId, const std::string& conversationId) {
|
||||
@ -447,12 +452,27 @@ SyncHistoryTest::testRemoveConversationOnAllDevices()
|
||||
cv.notify_one();
|
||||
}
|
||||
}));
|
||||
confHandlers.insert(
|
||||
DRing::exportable_callback<DRing::ConfigurationSignal::VolatileDetailsChanged>(
|
||||
[&](const std::string& accountId, const std::map<std::string, std::string>& details) {
|
||||
if (alice2Id != accountId) {
|
||||
return;
|
||||
}
|
||||
alice2Ready = details.at(DRing::Account::VolatileProperties::DEVICE_ANNOUNCED)
|
||||
== "true";
|
||||
cv.notify_one();
|
||||
}));
|
||||
DRing::registerSignalHandlers(confHandlers);
|
||||
CPPUNIT_ASSERT(cv.wait_for(lk, std::chrono::seconds(30), [&] { return conversationReady; }));
|
||||
|
||||
alice2Id = Manager::instance().addAccount(details);
|
||||
CPPUNIT_ASSERT(cv.wait_for(lk, std::chrono::seconds(60), [&] {
|
||||
return alice2Ready && conversationReady;
|
||||
}));
|
||||
aliceAccount->removeConversation(convId);
|
||||
CPPUNIT_ASSERT(cv.wait_for(lk, std::chrono::seconds(30), [&] { return conversationRemoved; }));
|
||||
|
||||
DRing::unregisterSignalHandlers();
|
||||
std::remove(aliceArchive.c_str());
|
||||
}
|
||||
|
||||
void
|
||||
@ -478,7 +498,7 @@ SyncHistoryTest::testSyncCreateAccountExportDeleteReimportOldBackup()
|
||||
auto messageBobReceived = 0, messageAliceReceived = 0;
|
||||
bool requestReceived = false;
|
||||
bool conversationReady = false;
|
||||
bool aliceReady = false;
|
||||
bool alice2Ready = false;
|
||||
confHandlers.insert(DRing::exportable_callback<DRing::ConversationSignal::MessageReceived>(
|
||||
[&](const std::string& accountId,
|
||||
const std::string& /* conversationId */,
|
||||
@ -512,16 +532,13 @@ SyncHistoryTest::testSyncCreateAccountExportDeleteReimportOldBackup()
|
||||
}));
|
||||
confHandlers.insert(
|
||||
DRing::exportable_callback<DRing::ConfigurationSignal::VolatileDetailsChanged>(
|
||||
[&](const std::string&, const std::map<std::string, std::string>&) {
|
||||
auto alice2Account = Manager::instance().getAccount<JamiAccount>(alice2Id);
|
||||
if (!alice2Account)
|
||||
[&](const std::string& accountId, const std::map<std::string, std::string>& details) {
|
||||
if (alice2Id != accountId) {
|
||||
return;
|
||||
auto details = alice2Account->getVolatileAccountDetails();
|
||||
auto daemonStatus = details[DRing::Account::ConfProperties::Registration::STATUS];
|
||||
if (daemonStatus == "REGISTERED") {
|
||||
aliceReady = true;
|
||||
cv.notify_one();
|
||||
}
|
||||
alice2Ready = details.at(DRing::Account::VolatileProperties::DEVICE_ANNOUNCED)
|
||||
== "true";
|
||||
cv.notify_one();
|
||||
}));
|
||||
DRing::registerSignalHandlers(confHandlers);
|
||||
|
||||
@ -549,8 +566,7 @@ SyncHistoryTest::testSyncCreateAccountExportDeleteReimportOldBackup()
|
||||
requestReceived = false;
|
||||
conversationReady = false;
|
||||
alice2Id = Manager::instance().addAccount(details);
|
||||
CPPUNIT_ASSERT(cv.wait_for(lk, std::chrono::seconds(30), [&] { return aliceReady; }));
|
||||
std::this_thread::sleep_for(std::chrono::seconds(10));
|
||||
CPPUNIT_ASSERT(cv.wait_for(lk, std::chrono::seconds(30), [&] { return alice2Ready; }));
|
||||
aliceAccount = Manager::instance().getAccount<JamiAccount>(alice2Id);
|
||||
|
||||
// This will trigger a conversation request. Cause alice2 can't know first conversation
|
||||
@ -563,6 +579,7 @@ SyncHistoryTest::testSyncCreateAccountExportDeleteReimportOldBackup()
|
||||
messageBobReceived = 0;
|
||||
aliceAccount->sendMessage(convId, std::string("hi"));
|
||||
cv.wait_for(lk, std::chrono::seconds(30), [&]() { return messageBobReceived == 1; });
|
||||
std::remove(aliceArchive.c_str());
|
||||
}
|
||||
|
||||
void
|
||||
@ -571,6 +588,7 @@ SyncHistoryTest::testSyncCreateAccountExportDeleteReimportWithConvId()
|
||||
std::this_thread::sleep_for(std::chrono::seconds(10));
|
||||
auto aliceAccount = Manager::instance().getAccount<JamiAccount>(aliceId);
|
||||
auto bobAccount = Manager::instance().getAccount<JamiAccount>(bobId);
|
||||
auto aliceUri = aliceAccount->getUsername();
|
||||
auto bobUri = bobAccount->getUsername();
|
||||
|
||||
// Start conversation
|
||||
@ -580,21 +598,32 @@ SyncHistoryTest::testSyncCreateAccountExportDeleteReimportWithConvId()
|
||||
std::unique_lock<std::mutex> lk {mtx};
|
||||
std::condition_variable cv;
|
||||
std::map<std::string, std::shared_ptr<DRing::CallbackWrapperBase>> confHandlers;
|
||||
auto messageBobReceived = 0, messageAliceReceived = 0;
|
||||
auto messageBobReceived = 0;
|
||||
bool requestReceived = false;
|
||||
bool conversationReady = false;
|
||||
bool aliceReady = false;
|
||||
bool alice2Ready = false;
|
||||
bool memberAddGenerated = false;
|
||||
confHandlers.insert(DRing::exportable_callback<DRing::ConversationSignal::MessageReceived>(
|
||||
[&](const std::string& accountId,
|
||||
const std::string& /* conversationId */,
|
||||
std::map<std::string, std::string> /*message*/) {
|
||||
if (accountId == bobId) {
|
||||
messageBobReceived += 1;
|
||||
} else {
|
||||
messageAliceReceived += 1;
|
||||
}
|
||||
cv.notify_one();
|
||||
}));
|
||||
confHandlers.insert(
|
||||
DRing::exportable_callback<DRing::ConversationSignal::ConversationMemberEvent>(
|
||||
[&](const std::string& accountId,
|
||||
const std::string& conversationId,
|
||||
const std::string& uri,
|
||||
int event) {
|
||||
if (accountId == aliceId && conversationId == convId && uri == bobUri
|
||||
&& event == 0) {
|
||||
memberAddGenerated = true;
|
||||
}
|
||||
cv.notify_one();
|
||||
}));
|
||||
confHandlers.insert(
|
||||
DRing::exportable_callback<DRing::ConversationSignal::ConversationRequestReceived>(
|
||||
[&](const std::string& /*accountId*/,
|
||||
@ -605,28 +634,21 @@ SyncHistoryTest::testSyncCreateAccountExportDeleteReimportWithConvId()
|
||||
}));
|
||||
confHandlers.insert(DRing::exportable_callback<DRing::ConversationSignal::ConversationReady>(
|
||||
[&](const std::string& accountId, const std::string& conversationId) {
|
||||
if (accountId == bobId) {
|
||||
if (conversationId != convId)
|
||||
return;
|
||||
if (accountId == bobId || accountId == alice2Id)
|
||||
conversationReady = true;
|
||||
cv.notify_one();
|
||||
}
|
||||
|
||||
if (accountId == alice2Id && conversationId == convId) {
|
||||
conversationReady = true;
|
||||
cv.notify_one();
|
||||
}
|
||||
cv.notify_one();
|
||||
}));
|
||||
confHandlers.insert(
|
||||
DRing::exportable_callback<DRing::ConfigurationSignal::VolatileDetailsChanged>(
|
||||
[&](const std::string&, const std::map<std::string, std::string>&) {
|
||||
auto alice2Account = Manager::instance().getAccount<JamiAccount>(alice2Id);
|
||||
if (!alice2Account)
|
||||
[&](const std::string& accountId, const std::map<std::string, std::string>& details) {
|
||||
if (alice2Id != accountId) {
|
||||
return;
|
||||
auto details = alice2Account->getVolatileAccountDetails();
|
||||
auto daemonStatus = details[DRing::Account::ConfProperties::Registration::STATUS];
|
||||
if (daemonStatus == "REGISTERED") {
|
||||
aliceReady = true;
|
||||
cv.notify_one();
|
||||
}
|
||||
alice2Ready = details.at(DRing::Account::VolatileProperties::DEVICE_ANNOUNCED)
|
||||
== "true";
|
||||
cv.notify_one();
|
||||
}));
|
||||
DRing::registerSignalHandlers(confHandlers);
|
||||
|
||||
@ -636,8 +658,11 @@ SyncHistoryTest::testSyncCreateAccountExportDeleteReimportWithConvId()
|
||||
bobAccount->acceptConversationRequest(convId);
|
||||
CPPUNIT_ASSERT(cv.wait_for(lk, std::chrono::seconds(30), [&]() { return conversationReady; }));
|
||||
|
||||
// We need to track presence to know when to sync
|
||||
bobAccount->trackBuddyPresence(aliceUri, true);
|
||||
|
||||
// Wait that alice sees Bob
|
||||
cv.wait_for(lk, std::chrono::seconds(30), [&]() { return messageAliceReceived == 1; });
|
||||
cv.wait_for(lk, std::chrono::seconds(30), [&]() { return memberAddGenerated; });
|
||||
|
||||
// Backup alice after startConversation with member
|
||||
auto aliceArchive = std::filesystem::current_path().string() + "/alice.gz";
|
||||
@ -659,16 +684,15 @@ SyncHistoryTest::testSyncCreateAccountExportDeleteReimportWithConvId()
|
||||
requestReceived = false;
|
||||
conversationReady = false;
|
||||
alice2Id = Manager::instance().addAccount(details);
|
||||
CPPUNIT_ASSERT(cv.wait_for(lk, std::chrono::seconds(30), [&] { return aliceReady; }));
|
||||
std::this_thread::sleep_for(std::chrono::seconds(10));
|
||||
aliceAccount = Manager::instance().getAccount<JamiAccount>(alice2Id);
|
||||
|
||||
// Should retrieve conversation, no need for action as the convInfos is in the archive
|
||||
CPPUNIT_ASSERT(cv.wait_for(lk, std::chrono::seconds(30), [&] { return alice2Ready; }));
|
||||
CPPUNIT_ASSERT(cv.wait_for(lk, std::chrono::seconds(30), [&] { return conversationReady; }));
|
||||
|
||||
messageBobReceived = 0;
|
||||
aliceAccount = Manager::instance().getAccount<JamiAccount>(alice2Id);
|
||||
aliceAccount->sendMessage(convId, std::string("hi"));
|
||||
cv.wait_for(lk, std::chrono::seconds(30), [&]() { return messageBobReceived == 1; });
|
||||
std::remove(aliceArchive.c_str());
|
||||
}
|
||||
|
||||
void
|
||||
@ -690,7 +714,7 @@ SyncHistoryTest::testSyncCreateAccountExportDeleteReimportWithConvReq()
|
||||
auto messageBobReceived = 0, messageAliceReceived = 0;
|
||||
bool requestReceived = false;
|
||||
bool conversationReady = false;
|
||||
bool aliceReady = false;
|
||||
bool alice2Ready = false;
|
||||
confHandlers.insert(DRing::exportable_callback<DRing::ConversationSignal::MessageReceived>(
|
||||
[&](const std::string& accountId,
|
||||
const std::string& /* conversationId */,
|
||||
@ -724,16 +748,13 @@ SyncHistoryTest::testSyncCreateAccountExportDeleteReimportWithConvReq()
|
||||
}));
|
||||
confHandlers.insert(
|
||||
DRing::exportable_callback<DRing::ConfigurationSignal::VolatileDetailsChanged>(
|
||||
[&](const std::string&, const std::map<std::string, std::string>&) {
|
||||
auto alice2Account = Manager::instance().getAccount<JamiAccount>(alice2Id);
|
||||
if (!alice2Account)
|
||||
[&](const std::string& accountId, const std::map<std::string, std::string>& details) {
|
||||
if (alice2Id != accountId) {
|
||||
return;
|
||||
auto details = alice2Account->getVolatileAccountDetails();
|
||||
auto daemonStatus = details[DRing::Account::ConfProperties::Registration::STATUS];
|
||||
if (daemonStatus == "REGISTERED") {
|
||||
aliceReady = true;
|
||||
cv.notify_one();
|
||||
}
|
||||
alice2Ready = details.at(DRing::Account::VolatileProperties::DEVICE_ANNOUNCED)
|
||||
== "true";
|
||||
cv.notify_one();
|
||||
}));
|
||||
DRing::registerSignalHandlers(confHandlers);
|
||||
|
||||
@ -759,8 +780,7 @@ SyncHistoryTest::testSyncCreateAccountExportDeleteReimportWithConvReq()
|
||||
details[ConfProperties::ARCHIVE_PATH] = aliceArchive;
|
||||
conversationReady = false;
|
||||
alice2Id = Manager::instance().addAccount(details);
|
||||
CPPUNIT_ASSERT(cv.wait_for(lk, std::chrono::seconds(30), [&] { return aliceReady; }));
|
||||
std::this_thread::sleep_for(std::chrono::seconds(10));
|
||||
CPPUNIT_ASSERT(cv.wait_for(lk, std::chrono::seconds(30), [&] { return alice2Ready; }));
|
||||
aliceAccount = Manager::instance().getAccount<JamiAccount>(alice2Id);
|
||||
|
||||
// Should get the same request as before.
|
||||
@ -768,6 +788,7 @@ SyncHistoryTest::testSyncCreateAccountExportDeleteReimportWithConvReq()
|
||||
CPPUNIT_ASSERT(cv.wait_for(lk, std::chrono::seconds(30), [&]() {
|
||||
return conversationReady && messageBobReceived == 1;
|
||||
}));
|
||||
std::remove(aliceArchive.c_str());
|
||||
}
|
||||
|
||||
} // namespace test
|
||||
|
Reference in New Issue
Block a user