Add integration tests

Tests if repository json files conform to the json schema.
If all resources (images/icons/website URLs) they mention actually
exists.

And can also test writing images and the FAT modification code.
This commit is contained in:
Floris Bos 2022-11-19 23:49:43 +01:00
parent fce80b2a67
commit 05f1c4dbb5
11 changed files with 319 additions and 8 deletions

View file

@ -66,7 +66,7 @@
ImageWriter::ImageWriter(QObject *parent)
: QObject(parent), _repo(QUrl(QString(OSLIST_URL))), _dlnow(0), _verifynow(0),
_engine(nullptr), _thread(nullptr), _verifyEnabled(false), _cachingEnabled(false),
_embeddedMode(false), _online(false), _trans(nullptr)
_embeddedMode(false), _online(false), _customCacheFile(false), _trans(nullptr)
{
connect(&_polltimer, SIGNAL(timeout()), SLOT(pollProgress()));
@ -349,8 +349,11 @@ void ImageWriter::startWrite()
void ImageWriter::onCacheFileUpdated(QByteArray sha256)
{
_settings.setValue("caching/lastDownloadSHA256", sha256);
_settings.sync();
if (!_customCacheFile)
{
_settings.setValue("caching/lastDownloadSHA256", sha256);
_settings.sync();
}
_cachedFileHash = sha256;
qDebug() << "Done writing cache file";
}
@ -421,6 +424,14 @@ void ImageWriter::setCustomOsListUrl(const QUrl &url)
_repo = url;
}
void ImageWriter::setCustomCacheFile(const QString &cacheFile, const QByteArray &sha256)
{
_cacheFileName = cacheFile;
_cachedFileHash = QFile::exists(cacheFile) ? sha256 : "";
_customCacheFile = true;
_cachingEnabled = true;
}
/* Start polling the list of available drives */
void ImageWriter::startDriveListPolling()
{