@@ 384-397 (lines=14) @@ | ||
381 | status, reply = connect.set_config(config, "gpu_search_threshold", 1000) |
|
382 | assert not status.OK() |
|
383 | ||
384 | @pytest.mark.timeout(CONFIG_TIMEOUT) |
|
385 | def test_set_gpu_search_threshold_valid(self, connect, collection): |
|
386 | ''' |
|
387 | target: set gpu_search_threshold |
|
388 | method: call set_config correctly |
|
389 | expected: status ok |
|
390 | ''' |
|
391 | if str(connect._cmd("mode")[1]) == "CPU": |
|
392 | pytest.skip("Only support GPU mode") |
|
393 | status, reply = connect.set_config("gpu", "gpu_search_threshold", 2000) |
|
394 | assert status.OK() |
|
395 | status, config_value = connect.get_config("gpu", "gpu_search_threshold") |
|
396 | assert status.OK() |
|
397 | assert config_value == '2000' |
|
398 | ||
399 | @pytest.mark.timeout(CONFIG_TIMEOUT) |
|
400 | def test_set_gpu_invalid_values(self, connect, collection): |
|
@@ 767-779 (lines=13) @@ | ||
764 | status, reply = connect.set_config(config, "build_index_devices", "gpu0") |
|
765 | assert not status.OK() |
|
766 | ||
767 | @pytest.mark.timeout(CONFIG_TIMEOUT) |
|
768 | def test_set_build_index_devices_valid(self, connect, collection): |
|
769 | ''' |
|
770 | target: set build_index_devices |
|
771 | method: call set_config correctly |
|
772 | expected: status ok |
|
773 | ''' |
|
774 | if str(connect._cmd("mode")[1]) == "CPU": |
|
775 | pytest.skip("Only support GPU mode") |
|
776 | status, reply = connect.set_config("gpu", "build_index_devices", "gpu0") |
|
777 | assert status.OK() |
|
778 | status, config_value = connect.get_config("gpu", "build_index_devices") |
|
779 | assert config_value == "gpu0" |
|
780 | ||
781 | @pytest.mark.timeout(CONFIG_TIMEOUT) |
|
782 | def test_set_build_index_devices_invalid_values(self, connect, collection): |
|
@@ 725-737 (lines=13) @@ | ||
722 | status, reply = connect.set_config(config, "search_devices", "gpu0") |
|
723 | assert not status.OK() |
|
724 | ||
725 | @pytest.mark.timeout(CONFIG_TIMEOUT) |
|
726 | def test_set_search_devices_valid(self, connect, collection): |
|
727 | ''' |
|
728 | target: set search_devices |
|
729 | method: call set_config correctly |
|
730 | expected: status ok |
|
731 | ''' |
|
732 | if str(connect._cmd("mode")[1]) == "CPU": |
|
733 | pytest.skip("Only support GPU mode") |
|
734 | status, reply = connect.set_config("gpu", "search_devices", "gpu0") |
|
735 | assert status.OK() |
|
736 | status, config_value = connect.get_config("gpu", "search_devices") |
|
737 | assert config_value == "gpu0" |
|
738 | ||
739 | @pytest.mark.timeout(CONFIG_TIMEOUT) |
|
740 | def test_set_search_devices_invalid_values(self, connect, collection): |