From c87d4fa69e812113104a8a71baa8bd46ee1df2e6 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 29 Dec 2020 19:41:00 +0000 Subject: [PATCH 1/3] Fixes for 3.5 testing --- release_tester/arangodb/installers/base.py | 19 ++++++++++--------- release_tester/arangodb/installers/tar.py | 2 +- .../arangodb/starter/deployments/dc2dc.py | 12 ++++++------ .../starter/deployments/leaderfollower.py | 12 ++++++------ .../arangodb/starter/deployments/runner.py | 3 ++- release_tester/arangodb/starter/manager.py | 5 +++-- 6 files changed, 28 insertions(+), 25 deletions(-) diff --git a/release_tester/arangodb/installers/base.py b/release_tester/arangodb/installers/base.py index bb1365c26..b0816f0bb 100644 --- a/release_tester/arangodb/installers/base.py +++ b/release_tester/arangodb/installers/base.py @@ -77,10 +77,11 @@ def __repr__(self): def check_installed(self, version, enterprise, check_stripped, check_symlink): """ check all attributes of this file in reality """ - #TODO consider only certain versions - #use semver package - - self.check_path(enterprise) + if semver.compare(self.version_min, version) == 1: + self.check_path(enterprise, False) + return + else: + self.check_path(enterprise) if not enterprise and self.enterprise: #checks do not need to continue in this case @@ -91,10 +92,10 @@ def check_installed(self, version, enterprise, check_stripped, check_symlink): self.check_symlink() - def check_path(self, enterprise): + def check_path(self, enterprise, in_version = True): """ check whether the file rightfully exists or not """ if enterprise and self.enterprise: - if not self.path.is_file(): + if not self.path.is_file() and in_version: raise Exception("Binary missing from enterprise package!" + str(self.path)) #file must not exist @@ -224,7 +225,7 @@ def get_arangod_conf(self): def supports_hot_backup(self): """ by default hot backup is supported by the targets, there may be execptions.""" - return True + return semver.compare(self.cfg.version, "3.5.1") >=0 def calc_config_file_name(self): """ store our config to disk - so we can be invoked partly """ @@ -354,7 +355,7 @@ def caclulate_file_locations(self): # enterprise self.arango_binaries.append(BinaryDescription( self.cfg.real_bin_dir, 'arangobackup', - True, True, "1.0.0", "4.0.0", [], 'c++')) + True, True, "3.5.1", "4.0.0", [], 'c++')) self.arango_binaries.append(BinaryDescription( self.cfg.real_sbin_dir, 'arangosync', @@ -364,7 +365,7 @@ def caclulate_file_locations(self): self.arango_binaries.append(BinaryDescription( self.cfg.real_sbin_dir, 'rclone-arangodb', - True, True, "1.0.0", "4.0.0", [], 'go')) + True, True, "3.5.1", "4.0.0", [], 'go')) def check_installed_files(self): """ check for the files whether they're installed """ diff --git a/release_tester/arangodb/installers/tar.py b/release_tester/arangodb/installers/tar.py index fcb0e9356..e10ef58f7 100644 --- a/release_tester/arangodb/installers/tar.py +++ b/release_tester/arangodb/installers/tar.py @@ -101,7 +101,7 @@ def install_package(self): logging.debug("package dir: {0.cfg.package_dir}- server_package: {0.server_package}".format(self)) cmd = [self.tar, - '-xzf', + '-xf', str(self.cfg.package_dir / self.server_package), '-C', '/tmp/'] diff --git a/release_tester/arangodb/starter/deployments/dc2dc.py b/release_tester/arangodb/starter/deployments/dc2dc.py index e7b3c9924..604214321 100644 --- a/release_tester/arangodb/starter/deployments/dc2dc.py +++ b/release_tester/arangodb/starter/deployments/dc2dc.py @@ -170,12 +170,12 @@ def test_setup_impl(self): self.sync_manager.get_sync_tasks(0) self.sync_manager.get_sync_tasks(1) self.cluster2['instance'].arangosh.check_test_data("dc2dc (post setup - dc2)") - if not self.cluster1['instance'].arangosh.run_in_arangosh( - Path('test_data/tests/js/server/replication/fuzz/replication-fuzz-global.js'), - [], - [self.cluster2['instance'].get_frontend().get_public_url('')] - ): - raise Exception("replication fuzzing test failed") + #if not self.cluster1['instance'].arangosh.run_in_arangosh( + # Path('test_data/tests/js/server/replication/fuzz/replication-fuzz-global.js'), + # [], + # [self.cluster2['instance'].get_frontend().get_public_url('')] + # ): + # raise Exception("replication fuzzing test failed") if not self.sync_manager.check_sync(): raise Exception("failed to get the sync status") diff --git a/release_tester/arangodb/starter/deployments/leaderfollower.py b/release_tester/arangodb/starter/deployments/leaderfollower.py index ab388036a..af2fe9a36 100644 --- a/release_tester/arangodb/starter/deployments/leaderfollower.py +++ b/release_tester/arangodb/starter/deployments/leaderfollower.py @@ -164,12 +164,12 @@ def jam_attempt_impl(self): logging.info("running the replication fuzzing test") # add instace where makedata will be run on self.tcp_ping_all_nodes() - if not self.leader_starter_instance.arangosh.run_in_arangosh( - Path('test_data/tests/js/server/replication/fuzz/replication-fuzz-global.js'), - [], - [self.follower_starter_instance.get_frontend().get_public_url('')] - ): - raise Exception("replication fuzzing test failed") +# if not self.leader_starter_instance.arangosh.run_in_arangosh( +# Path('test_data/tests/js/server/replication/fuzz/replication-fuzz-global.js'), +# [], +# [self.follower_starter_instance.get_frontend().get_public_url('')] +# ): +# raise Exception("replication fuzzing test failed") prompt_user(self.basecfg, "please test the installation.") diff --git a/release_tester/arangodb/starter/deployments/runner.py b/release_tester/arangodb/starter/deployments/runner.py index d94d4adb3..61311872b 100644 --- a/release_tester/arangodb/starter/deployments/runner.py +++ b/release_tester/arangodb/starter/deployments/runner.py @@ -14,6 +14,7 @@ import requests import time import platform +import semver from arangodb.installers.base import InstallerBase from arangodb.installers import InstallerConfig @@ -402,7 +403,7 @@ def check_data_impl(self): raise Exception("no frontend found.") def supports_backup_impl(self): - return True + return semver.compare(self.cfg.version, "3.5.1") >= 0 def create_non_backup_data(self): for starter in self.makedata_instances: diff --git a/release_tester/arangodb/starter/manager.py b/release_tester/arangodb/starter/manager.py index 0dd4f59fd..0dbb10c23 100644 --- a/release_tester/arangodb/starter/manager.py +++ b/release_tester/arangodb/starter/manager.py @@ -16,6 +16,7 @@ # from typing import List, Dict, NamedTuple import psutil +import semver import http.client as http_client from tools.asciiprint import ascii_print, print_progress as progress @@ -57,7 +58,7 @@ def __init__(self, self.moreopts += ["--starter.port", "%d" % self.starter_port] self.hotbackup = [] - if self.cfg.enterprise: + if self.cfg.enterprise and semver.compare(self.cfg.version, "3.5.1") >=0: self.hotbackup = ['--all.rclone.executable', self.cfg.real_sbin_dir / 'rclone-arangodb'] # arg - jwtstr @@ -328,7 +329,7 @@ def replace_binary_for_upgrade(self, new_install_cfg): """ # On windows the install prefix may change, since we can't overwrite open files: self.cfg.set_directories(new_install_cfg) - if self.cfg.enterprise: + if self.cfg.enterprise and semver.compare(self.cfg.version, "3.5.1") >= 0: self.hotbackup = ['--all.rclone.executable', self.cfg.sbin_dir / 'rclone-arangodb'] logging.info("StarterManager: Killing my instance [%s]", str(self.instance.pid)) self.kill_instance() From 6dd10c0f3436e42e31cf56012de4445648143ba0 Mon Sep 17 00:00:00 2001 From: Vadim Date: Tue, 5 Jan 2021 15:21:35 +0300 Subject: [PATCH 2/3] Update dc2dc.py --- release_tester/arangodb/starter/deployments/dc2dc.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/release_tester/arangodb/starter/deployments/dc2dc.py b/release_tester/arangodb/starter/deployments/dc2dc.py index 604214321..e7b3c9924 100644 --- a/release_tester/arangodb/starter/deployments/dc2dc.py +++ b/release_tester/arangodb/starter/deployments/dc2dc.py @@ -170,12 +170,12 @@ def test_setup_impl(self): self.sync_manager.get_sync_tasks(0) self.sync_manager.get_sync_tasks(1) self.cluster2['instance'].arangosh.check_test_data("dc2dc (post setup - dc2)") - #if not self.cluster1['instance'].arangosh.run_in_arangosh( - # Path('test_data/tests/js/server/replication/fuzz/replication-fuzz-global.js'), - # [], - # [self.cluster2['instance'].get_frontend().get_public_url('')] - # ): - # raise Exception("replication fuzzing test failed") + if not self.cluster1['instance'].arangosh.run_in_arangosh( + Path('test_data/tests/js/server/replication/fuzz/replication-fuzz-global.js'), + [], + [self.cluster2['instance'].get_frontend().get_public_url('')] + ): + raise Exception("replication fuzzing test failed") if not self.sync_manager.check_sync(): raise Exception("failed to get the sync status") From c55744809b63633b0dacb13f6b17096d2a975ee3 Mon Sep 17 00:00:00 2001 From: Vadim Date: Tue, 5 Jan 2021 15:21:49 +0300 Subject: [PATCH 3/3] Update leaderfollower.py --- .../arangodb/starter/deployments/leaderfollower.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/release_tester/arangodb/starter/deployments/leaderfollower.py b/release_tester/arangodb/starter/deployments/leaderfollower.py index af2fe9a36..ab388036a 100644 --- a/release_tester/arangodb/starter/deployments/leaderfollower.py +++ b/release_tester/arangodb/starter/deployments/leaderfollower.py @@ -164,12 +164,12 @@ def jam_attempt_impl(self): logging.info("running the replication fuzzing test") # add instace where makedata will be run on self.tcp_ping_all_nodes() -# if not self.leader_starter_instance.arangosh.run_in_arangosh( -# Path('test_data/tests/js/server/replication/fuzz/replication-fuzz-global.js'), -# [], -# [self.follower_starter_instance.get_frontend().get_public_url('')] -# ): -# raise Exception("replication fuzzing test failed") + if not self.leader_starter_instance.arangosh.run_in_arangosh( + Path('test_data/tests/js/server/replication/fuzz/replication-fuzz-global.js'), + [], + [self.follower_starter_instance.get_frontend().get_public_url('')] + ): + raise Exception("replication fuzzing test failed") prompt_user(self.basecfg, "please test the installation.")