diff --git a/arangod/RestServer/arangod.cpp b/arangod/RestServer/arangod.cpp index 2bee31bbfd..5e456fcdd9 100644 --- a/arangod/RestServer/arangod.cpp +++ b/arangod/RestServer/arangod.cpp @@ -256,11 +256,11 @@ int main(int argc, char* argv[]) { ARGV = argv; SERVICE_TABLE_ENTRY ste[] = { - {TEXT(""), (LPSERVICE_MAIN_FUNCTION)ServiceMain}, {nullptr, nullptr}}; + {TEXT(""), (LPSERVICE_MAIN_FUNCTION)ServiceMain}, {nullptr, nullptr}}; if (!StartServiceCtrlDispatcher(ste)) { std::cerr << "FATAL: StartServiceCtrlDispatcher has failed with " - << GetLastError() << std::endl; + << GetLastError() << std::endl; exit(EXIT_FAILURE); } } else diff --git a/arangosh/Restore/RestoreFeature.cpp b/arangosh/Restore/RestoreFeature.cpp index ca22ef7e63..ee1a8acb83 100644 --- a/arangosh/Restore/RestoreFeature.cpp +++ b/arangosh/Restore/RestoreFeature.cpp @@ -589,8 +589,6 @@ int RestoreFeature::processInputDirectory(std::string& errorMsg) { length = found - buffer.begin(); } - TRI_ASSERT(length > 0); - _stats._totalBatches++; int res = diff --git a/arangosh/Shell/ClientFeature.cpp b/arangosh/Shell/ClientFeature.cpp index 6c5a39cc57..7871cf74cf 100644 --- a/arangosh/Shell/ClientFeature.cpp +++ b/arangosh/Shell/ClientFeature.cpp @@ -49,7 +49,8 @@ ClientFeature::ClientFeature(application_features::ApplicationServer* server, _maxPacketSize(128 * 1024 * 1024), _sslProtocol(4), _retries(DEFAULT_RETRIES), - _warn(false) { + _warn(false), + _haveServerPassword(false){ setOptional(true); requiresElevatedPrivileges(false); startsAfter("Logger"); @@ -135,9 +136,16 @@ void ClientFeature::validateOptions(std::shared_ptr options) { FATAL_ERROR_EXIT(); } + _haveServerPassword = !options->processingResult().touched("server.password"); + + SimpleHttpClient::setMaxPacketSize(_maxPacketSize); +} + +void ClientFeature::prepare() { // ask for a password if (_authentication && - !options->processingResult().touched("server.password")) { + isEnabled() && + _haveServerPassword) { usleep(10 * 1000); try { @@ -155,8 +163,6 @@ void ClientFeature::validateOptions(std::shared_ptr options) { _password = ConsoleFeature::readPassword(); std::cout << std::endl << std::flush; } - - SimpleHttpClient::setMaxPacketSize(_maxPacketSize); } std::unique_ptr ClientFeature::createConnection() { diff --git a/arangosh/Shell/ClientFeature.h b/arangosh/Shell/ClientFeature.h index 269c80e9f6..659e56cadd 100644 --- a/arangosh/Shell/ClientFeature.h +++ b/arangosh/Shell/ClientFeature.h @@ -50,6 +50,7 @@ class ClientFeature final : public application_features::ApplicationFeature, public: void collectOptions(std::shared_ptr) override final; void validateOptions(std::shared_ptr) override final; + void prepare() override final; public: std::string const& databaseName() const { return _databaseName; } @@ -99,6 +100,7 @@ class ClientFeature final : public application_features::ApplicationFeature, private: size_t _retries; bool _warn; + bool _haveServerPassword; }; } diff --git a/js/client/modules/@arangodb/testsuites/foxxmanager.js b/js/client/modules/@arangodb/testsuites/foxxmanager.js index ad9334e6c6..e56055fde3 100644 --- a/js/client/modules/@arangodb/testsuites/foxxmanager.js +++ b/js/client/modules/@arangodb/testsuites/foxxmanager.js @@ -71,138 +71,6 @@ function foxxManager (options) { return results; } - -// TODO write test for 2.6-style queues -// testFuncs.queue_legacy = function (options) { -// if (options.skipFoxxQueues) { -// print('skipping test of legacy queue job types') -// return {} -// } -// var startTime -// var queueAppMountPath = '/test-queue-legacy' -// print('Testing legacy queue job types') -// var instanceInfo = pu.startInstance('tcp', options, [], 'queue_legacy') -// if (instanceInfo === false) { -// return {status: false, message: 'failed to start server!'} -// } -// var data = { -// naive: {_key: 'potato', hello: 'world'}, -// forced: {_key: 'tomato', hello: 'world'}, -// plain: {_key: 'banana', hello: 'world'} -// } -// var results = {} -// results.install = pu.run.arangoshCmd(options, instanceInfo, { -// 'configuration': 'etc/testing/foxx-manager.conf' -// }, [ -// 'install', -// 'js/common/test-data/apps/queue-legacy-test', -// queueAppMountPath -// ]) - -// print('Restarting without foxx-queues-warmup-exports...') -// pu.shutdownInstance(instanceInfo, options) -// instanceInfo = pu.startInstance('tcp', options, { -// 'server.foxx-queues-warmup-exports': 'false' -// }, 'queue_legacy', instanceInfo.flatTmpDataDir) -// if (instanceInfo === false) { -// return {status: false, message: 'failed to restart server!'} -// } -// print('done.') - -// var res, body -// startTime = time() -// try { -// res = download( -// instanceInfo.url + queueAppMountPath + '/', -// JSON.stringify(data.naive), -// {method: 'POST'} -// ) -// body = JSON.parse(res.body) -// results.naive = {status: body.success === false, message: JSON.stringify({body: res.body, code: res.code})} -// } catch (e) { -// results.naive = {status: true, message: JSON.stringify({body: res.body, code: res.code})} -// } -// results.naive.duration = time() - startTime - -// startTime = time() -// try { -// res = download( -// instanceInfo.url + queueAppMountPath + '/?allowUnknown=true', -// JSON.stringify(data.forced), -// {method: 'POST'} -// ) -// body = JSON.parse(res.body) -// results.forced = ( -// body.success -// ? {status: true} -// : {status: false, message: body.error, stacktrace: body.stacktrace} -// ) -// } catch (e) { -// results.forced = {status: false, message: JSON.stringify({body: res.body, code: res.code})} -// } -// results.forced.duration = time() - startTime - -// print('Restarting with foxx-queues-warmup-exports...') -// pu.shutdownInstance(instanceInfo, options) -// instanceInfo = pu.startInstance('tcp', options, { -// 'server.foxx-queues-warmup-exports': 'true' -// }, 'queue_legacy', instanceInfo.flatTmpDataDir) -// if (instanceInfo === false) { -// return {status: false, message: 'failed to restart server!'} -// } -// print('done.') - -// startTime = time() -// try { -// res = download(instanceInfo.url + queueAppMountPath + '/', JSON.stringify(data.plain), {method: 'POST'}) -// body = JSON.parse(res.body) -// results.plain = ( -// body.success -// ? {status: true} -// : {status: false, message: JSON.stringify({body: res.body, code: res.code})} -// ) -// } catch (e) { -// results.plain = {status: false, message: JSON.stringify({body: res.body, code: res.code})} -// } -// results.plain.duration = time() - startTime - -// startTime = time() -// try { -// for (var i = 0; i < 60; i++) { -// wait(1) -// res = download(instanceInfo.url + queueAppMountPath + '/') -// body = JSON.parse(res.body) -// if (body.length === 2) { -// break -// } -// } -// results.final = ( -// body.length === 2 && body[0]._key === data.forced._key && body[1]._key === data.plain._key -// ? {status: true} -// : {status: false, message: JSON.stringify({body: res.body, code: res.code})} -// ) -// } catch (e) { -// results.final = {status: false, message: JSON.stringify({body: res.body, code: res.code})} -// } -// results.final.duration = time() - startTime - -// results.uninstall = pu.run.arangoshCmd(options, instanceInfo, { -// 'configuration': 'etc/testing/foxx-manager.conf' -// }, [ -// 'uninstall', -// queueAppMountPath -// ]) -// print('Shutting down...') -// pu.shutdownInstance(instanceInfo, options) -// print('done.') -// if ((!options.skipLogAnalysis) && -// instanceInfo.hasOwnProperty('importantLogLines') && -// Object.keys(instanceInfo.importantLogLines).length > 0) { -// print('Found messages in the server logs: \n' + yaml.safeDump(instanceInfo.importantLogLines)) -// } -// return results -// } - function setup (testFns, defaultFns, opts, fnDocs, optionsDoc) { testFns['foxx_manager'] = foxxManager; for (var attrname in functionsDocumentation) { fnDocs[attrname] = functionsDocumentation[attrname]; }