|
1 | 1 | import json
|
| 2 | +import os |
2 | 3 | import requests
|
3 |
| -import subprocess |
4 | 4 | import socket
|
| 5 | +import subprocess |
5 | 6 | import time
|
6 | 7 |
|
7 | 8 | from .config import NbsConfigurator
|
|
22 | 23 | ensure_path_exists
|
23 | 24 |
|
24 | 25 |
|
| 26 | +def __get_bin_path(name, default): |
| 27 | + return yatest_common.binary_path( |
| 28 | + yatest_common.get_param(name) or os.environ.get(name, default)) |
| 29 | + |
| 30 | + |
25 | 31 | def _match(labels, query):
|
26 | 32 | for name, value in query.items():
|
27 | 33 | v = labels.get(name)
|
@@ -145,7 +151,10 @@ def wait_for_registration(self, delay_sec=1, max_retry_number=None):
|
145 | 151 |
|
146 | 152 |
|
147 | 153 | def start_nbs(config: NbsConfigurator, name='nbs-server'):
|
148 |
| - exe_path = yatest_common.binary_path("cloud/blockstore/apps/server/nbsd") |
| 154 | + |
| 155 | + exe_path = __get_bin_path( |
| 156 | + "NBS_SERVER_PATH", |
| 157 | + "cloud/blockstore/apps/server/nbsd") |
149 | 158 |
|
150 | 159 | cwd = get_unique_path_for_current_test(
|
151 | 160 | output_path=yatest_common.output_path(),
|
@@ -176,7 +185,10 @@ def start_nbs(config: NbsConfigurator, name='nbs-server'):
|
176 | 185 |
|
177 | 186 |
|
178 | 187 | def start_disk_agent(config: NbsConfigurator, name='disk-agent'):
|
179 |
| - exe_path = yatest_common.binary_path("cloud/blockstore/apps/disk_agent/diskagentd") |
| 188 | + |
| 189 | + exe_path = __get_bin_path( |
| 190 | + "DISK_AGENT_PATH", |
| 191 | + "cloud/blockstore/apps/disk_agent/diskagentd") |
180 | 192 |
|
181 | 193 | cwd = get_unique_path_for_current_test(
|
182 | 194 | output_path=yatest_common.output_path(),
|
|
0 commit comments