Skip to content

Commit

Permalink
[NBS] ability to override the NBS's binary file path; tweak encryptio…
Browse files Browse the repository at this point in the history
…n_at_rest
  • Loading branch information
sharpeye committed Jan 14, 2025
1 parent ca5d0e3 commit c5fbeee
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cloud/blockstore/tests/encryption_at_rest/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
21 changes: 18 additions & 3 deletions cloud/blockstore/tests/python/lib/daemon.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import json
import os
import requests
import subprocess
import socket
import subprocess
import time

from .config import NbsConfigurator
Expand All @@ -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)
Expand Down Expand Up @@ -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(),
Expand Down Expand Up @@ -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(),
Expand Down

0 comments on commit c5fbeee

Please sign in to comment.