From c5fbeeefb1709283699da279d80a3fcc01d8003d Mon Sep 17 00:00:00 2001 From: Pavel Misko Date: Tue, 14 Jan 2025 19:45:38 +0100 Subject: [PATCH] [NBS] ability to override the NBS's binary file path; tweak encryption_at_rest --- .../tests/encryption_at_rest/test.py | 2 +- cloud/blockstore/tests/python/lib/daemon.py | 21 ++++++++++++++++--- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/cloud/blockstore/tests/encryption_at_rest/test.py b/cloud/blockstore/tests/encryption_at_rest/test.py index 0c05a8e6b0b..3d1f2d45c99 100644 --- a/cloud/blockstore/tests/encryption_at_rest/test.py +++ b/cloud/blockstore/tests/encryption_at_rest/test.py @@ -177,7 +177,7 @@ def read_first_block(): assert vol0.EncryptionDesc.Mode == ENCRYPTION_DEFAULT_AES_XTS assert vol0.EncryptionDesc.EncryptionKey.KekId == KEK_ID - assert len(vol0.EncryptionDesc.EncryptionKey.EncryptedDEK) == 512 + assert len(vol0.EncryptionDesc.EncryptionKey.EncryptedDEK) >= 32 expected_data = os.urandom(4096) diff --git a/cloud/blockstore/tests/python/lib/daemon.py b/cloud/blockstore/tests/python/lib/daemon.py index 6ab21814c45..a6ea0bf2362 100644 --- a/cloud/blockstore/tests/python/lib/daemon.py +++ b/cloud/blockstore/tests/python/lib/daemon.py @@ -1,7 +1,8 @@ import json +import os import requests -import subprocess import socket +import subprocess import time from .config import NbsConfigurator @@ -22,6 +23,14 @@ ensure_path_exists +def __get_bin_path(name, default): + p = yatest_common.get_param(name) + if p is None: + p = os.environ.get(name, f"{default}|{p}|{name}") + + return yatest_common.binary_path(p) + + def _match(labels, query): for name, value in query.items(): v = labels.get(name) @@ -145,7 +154,10 @@ def wait_for_registration(self, delay_sec=1, max_retry_number=None): def start_nbs(config: NbsConfigurator, name='nbs-server'): - exe_path = yatest_common.binary_path("cloud/blockstore/apps/server/nbsd") + + exe_path = __get_bin_path( + "NBS_SERVER_PATH", + "cloud/blockstore/apps/server/nbsd") cwd = get_unique_path_for_current_test( output_path=yatest_common.output_path(), @@ -176,7 +188,10 @@ def start_nbs(config: NbsConfigurator, name='nbs-server'): def start_disk_agent(config: NbsConfigurator, name='disk-agent'): - exe_path = yatest_common.binary_path("cloud/blockstore/apps/disk_agent/diskagentd") + + exe_path = __get_bin_path( + "DISK_AGENT_PATH", + "cloud/blockstore/apps/disk_agent/diskagentd") cwd = get_unique_path_for_current_test( output_path=yatest_common.output_path(),