diff --git a/src/nidcpower/system_tests/grpc_server_config.json b/src/nidcpower/system_tests/grpc_server_config.json new file mode 100644 index 000000000..5e6da6c3c --- /dev/null +++ b/src/nidcpower/system_tests/grpc_server_config.json @@ -0,0 +1,9 @@ +{ + "address": "[::1]", + "port": 31760, + "security" : { + "server_cert": "", + "server_key": "", + "root_cert": "" + } + } diff --git a/src/nidcpower/system_tests/test_system_nidcpower.py b/src/nidcpower/system_tests/test_system_nidcpower.py index 6abacd27e..4b6ce4c61 100644 --- a/src/nidcpower/system_tests/test_system_nidcpower.py +++ b/src/nidcpower/system_tests/test_system_nidcpower.py @@ -1099,7 +1099,9 @@ def test_lcr_compensation_data(self, session): class TestGrpc(SystemTests): @pytest.fixture(scope='class') def grpc_channel(self): - with system_test_utilities.GrpcServerProcess() as proc: + current_directory = os.path.dirname(os.path.abspath(__file__)) + config_file_path = os.path.join(current_directory, 'grpc_server_config.json') + with system_test_utilities.GrpcServerProcess(config_file_path) as proc: channel = grpc.insecure_channel(f"localhost:{proc.server_port}") yield channel diff --git a/src/nidigital/system_tests/grpc_server_config.json b/src/nidigital/system_tests/grpc_server_config.json new file mode 100644 index 000000000..7692c8066 --- /dev/null +++ b/src/nidigital/system_tests/grpc_server_config.json @@ -0,0 +1,9 @@ +{ + "address": "[::1]", + "port": 31761, + "security" : { + "server_cert": "", + "server_key": "", + "root_cert": "" + } + } diff --git a/src/nidigital/system_tests/test_system_nidigital.py b/src/nidigital/system_tests/test_system_nidigital.py index 8e48f7714..ea477713f 100644 --- a/src/nidigital/system_tests/test_system_nidigital.py +++ b/src/nidigital/system_tests/test_system_nidigital.py @@ -1350,7 +1350,9 @@ def test_enable_match_fail_combination(self, multi_instrument_session): class TestGrpc(SystemTests): @pytest.fixture(scope='class') def grpc_channel(self): - with system_test_utilities.GrpcServerProcess() as proc: + current_directory = os.path.dirname(os.path.abspath(__file__)) + config_file_path = os.path.join(current_directory, 'grpc_server_config.json') + with system_test_utilities.GrpcServerProcess(config_file_path) as proc: channel = grpc.insecure_channel(f"localhost:{proc.server_port}") yield channel diff --git a/src/nidmm/system_tests/grpc_server_config.json b/src/nidmm/system_tests/grpc_server_config.json new file mode 100644 index 000000000..7e5bedc33 --- /dev/null +++ b/src/nidmm/system_tests/grpc_server_config.json @@ -0,0 +1,9 @@ +{ + "address": "[::1]", + "port": 31762, + "security" : { + "server_cert": "", + "server_key": "", + "root_cert": "" + } + } diff --git a/src/nidmm/system_tests/test_system_nidmm.py b/src/nidmm/system_tests/test_system_nidmm.py index 74d45ab98..55cdea398 100644 --- a/src/nidmm/system_tests/test_system_nidmm.py +++ b/src/nidmm/system_tests/test_system_nidmm.py @@ -330,7 +330,9 @@ def test_fetch_waveform_into(self, session): class TestGrpc(SystemTests): @pytest.fixture(scope='class') def grpc_channel(self): - with system_test_utilities.GrpcServerProcess() as proc: + current_directory = os.path.dirname(os.path.abspath(__file__)) + config_file_path = os.path.join(current_directory, 'grpc_server_config.json') + with system_test_utilities.GrpcServerProcess(config_file_path) as proc: channel = grpc.insecure_channel(f"localhost:{proc.server_port}") yield channel diff --git a/src/nifgen/system_tests/grpc_server_config.json b/src/nifgen/system_tests/grpc_server_config.json new file mode 100644 index 000000000..0da46cb2a --- /dev/null +++ b/src/nifgen/system_tests/grpc_server_config.json @@ -0,0 +1,9 @@ +{ + "address": "[::1]", + "port": 31763, + "security" : { + "server_cert": "", + "server_key": "", + "root_cert": "" + } + } diff --git a/src/nifgen/system_tests/test_system_nifgen.py b/src/nifgen/system_tests/test_system_nifgen.py index 8c8a1ce22..7f1902860 100644 --- a/src/nifgen/system_tests/test_system_nifgen.py +++ b/src/nifgen/system_tests/test_system_nifgen.py @@ -516,7 +516,9 @@ def test_write_named_waveform_numpy_array_int16(self, session): class TestGrpc(SystemTests): @pytest.fixture(scope='class') def grpc_channel(self): - with system_test_utilities.GrpcServerProcess() as proc: + current_directory = os.path.dirname(os.path.abspath(__file__)) + config_file_path = os.path.join(current_directory, 'grpc_server_config.json') + with system_test_utilities.GrpcServerProcess(config_file_path) as proc: channel = grpc.insecure_channel(f"localhost:{proc.server_port}") yield channel diff --git a/src/niscope/system_tests/grpc_server_config.json b/src/niscope/system_tests/grpc_server_config.json new file mode 100644 index 000000000..b7917b385 --- /dev/null +++ b/src/niscope/system_tests/grpc_server_config.json @@ -0,0 +1,9 @@ +{ + "address": "[::1]", + "port": 31764, + "security" : { + "server_cert": "", + "server_key": "", + "root_cert": "" + } + } diff --git a/src/niscope/system_tests/test_system_niscope.py b/src/niscope/system_tests/test_system_niscope.py index 263d5eb42..60702465e 100644 --- a/src/niscope/system_tests/test_system_niscope.py +++ b/src/niscope/system_tests/test_system_niscope.py @@ -612,7 +612,9 @@ def test_reset_with_defaults(self, single_instrument_session): class TestGrpc(SystemTests): @pytest.fixture(scope='class') def grpc_channel(self): - with system_test_utilities.GrpcServerProcess() as proc: + current_directory = os.path.dirname(os.path.abspath(__file__)) + config_file_path = os.path.join(current_directory, 'grpc_server_config.json') + with system_test_utilities.GrpcServerProcess(config_file_path) as proc: channel = grpc.insecure_channel(f"localhost:{proc.server_port}") yield channel diff --git a/src/niswitch/system_tests/grpc_server_config.json b/src/niswitch/system_tests/grpc_server_config.json new file mode 100644 index 000000000..69aa29677 --- /dev/null +++ b/src/niswitch/system_tests/grpc_server_config.json @@ -0,0 +1,9 @@ +{ + "address": "[::1]", + "port": 31765, + "security" : { + "server_cert": "", + "server_key": "", + "root_cert": "" + } + } diff --git a/src/niswitch/system_tests/test_system_niswitch.py b/src/niswitch/system_tests/test_system_niswitch.py index 22793b833..4bcfa0aad 100644 --- a/src/niswitch/system_tests/test_system_niswitch.py +++ b/src/niswitch/system_tests/test_system_niswitch.py @@ -195,7 +195,9 @@ def session_creation_kwargs(self): class TestGrpc(SystemTests): @pytest.fixture(scope='class') def grpc_channel(self): - with system_test_utilities.GrpcServerProcess() as proc: + current_directory = os.path.dirname(os.path.abspath(__file__)) + config_file_path = os.path.join(current_directory, 'grpc_server_config.json') + with system_test_utilities.GrpcServerProcess(config_file_path) as proc: channel = grpc.insecure_channel(f"localhost:{proc.server_port}") yield channel diff --git a/src/shared/system_test_utilities.py b/src/shared/system_test_utilities.py index 7938e4574..dea3b2d1c 100644 --- a/src/shared/system_test_utilities.py +++ b/src/shared/system_test_utilities.py @@ -8,9 +8,9 @@ class GrpcServerProcess: - def __init__(self): + def __init__(self, config_file_path): server_exe = self._get_grpc_server_exe() - self._proc = subprocess.Popen([str(server_exe)], stdout=subprocess.PIPE) + self._proc = subprocess.Popen([str(server_exe), config_file_path], stdout=subprocess.PIPE) # Read/parse output until we find the port number or the process exits; discard the rest. try: