From 82f9df088a78b284299ce9deb6bec317d48a51ca Mon Sep 17 00:00:00 2001 From: Andrey Berezin Date: Wed, 24 Jan 2024 15:23:26 +0300 Subject: [PATCH] [#167] Strip components for new xk6 archive and update unit tests Signed-off-by: Andrey Berezin --- src/frostfs_testlib/load/runners.py | 4 ++-- tests/test_load_config.py | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/frostfs_testlib/load/runners.py b/src/frostfs_testlib/load/runners.py index dd6d50e..532c590 100644 --- a/src/frostfs_testlib/load/runners.py +++ b/src/frostfs_testlib/load/runners.py @@ -4,6 +4,7 @@ import math import re import time from dataclasses import fields +from threading import Event from typing import Optional from urllib.parse import urlparse @@ -30,7 +31,6 @@ from frostfs_testlib.testing import parallel, run_optionally from frostfs_testlib.testing.test_control import retry from frostfs_testlib.utils import datetime_utils from frostfs_testlib.utils.file_keeper import FileKeeper -from threading import Event class RunnerBase(ScenarioRunner): @@ -314,7 +314,7 @@ class LocalRunner(RunnerBase): with reporter.step("Download K6"): shell.exec(f"sudo rm -rf {k6_dir};sudo mkdir {k6_dir}") shell.exec(f"sudo curl -so {k6_dir}/k6.tar.gz {load_params.k6_url}") - shell.exec(f"sudo tar xf {k6_dir}/k6.tar.gz -C {k6_dir}") + shell.exec(f"sudo tar xf {k6_dir}/k6.tar.gz --strip-components 2 -C {k6_dir}") shell.exec(f"sudo chmod -R 777 {k6_dir}") with reporter.step("Create empty_passwd"): diff --git a/tests/test_load_config.py b/tests/test_load_config.py index f4fa022..834d051 100644 --- a/tests/test_load_config.py +++ b/tests/test_load_config.py @@ -143,6 +143,7 @@ class TestLoadConfig: "--policy 'container_placement_policy'", "--ignore-errors", "--sleep '19'", + "--local", ] expected_env_vars = { "DURATION": 9, @@ -172,6 +173,7 @@ class TestLoadConfig: "--policy 'container_placement_policy'", "--ignore-errors", "--sleep '19'", + "--local", ] expected_env_vars = { "DURATION": 9, @@ -304,6 +306,7 @@ class TestLoadConfig: @pytest.mark.parametrize("load_params", [LoadScenario.HTTP], indirect=True) def test_argument_parsing_for_http_scenario(self, load_params: LoadParams): + load_params.preset.local = False expected_preset_args = [ "--no-verify-ssl", "--size '11'", @@ -334,6 +337,7 @@ class TestLoadConfig: @pytest.mark.parametrize("load_params", [LoadScenario.LOCAL], indirect=True) def test_argument_parsing_for_local_scenario(self, load_params: LoadParams): + load_params.preset.local = False expected_preset_args = [ "--size '11'", "--preload_obj '13'",