@@ 399-411 (lines=13) @@ | ||
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): |
|
401 | ''' |
|
402 | target: set gpu |
|
403 | method: call set_config with invalid child values |
|
404 | expected: status not ok |
|
405 | ''' |
|
406 | for i in [-1, "1000\n", "1000\t", "1000.0", 1000.35]: |
|
407 | status, reply = connect.set_config("gpu", "use_blas_threshold", i) |
|
408 | assert not status.OK() |
|
409 | if str(connect._cmd("mode")[1]) == "GPU": |
|
410 | status, reply = connect.set_config("gpu", "gpu_search_threshold", i) |
|
411 | assert not status.OK() |
|
412 | ||
413 | @pytest.mark.timeout(CONFIG_TIMEOUT) |
|
414 | def reset_configs(self, connect): |
|
@@ 739-750 (lines=12) @@ | ||
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): |
|
741 | ''' |
|
742 | target: set search_devices |
|
743 | method: call set_config with invalid child values |
|
744 | expected: status not ok |
|
745 | ''' |
|
746 | if str(connect._cmd("mode")[1]) == "CPU": |
|
747 | pytest.skip("Only support GPU mode") |
|
748 | for i in [-1, "10", "gpu-1", "gpu0, gpu1", "gpu22,gpu44","gpu10000","gpu 0","-gpu0"]: |
|
749 | status, reply = connect.set_config("gpu", "search_devices", i) |
|
750 | assert not status.OK() |
|
751 | ||
752 | @pytest.mark.timeout(CONFIG_TIMEOUT) |
|
753 | def test_set_build_index_devices_invalid_parent_key(self, connect, collection): |
|
@@ 638-649 (lines=12) @@ | ||
635 | status, reply = connect.set_config("gpu", config, "true") |
|
636 | assert not status.OK() |
|
637 | ||
638 | @pytest.mark.timeout(CONFIG_TIMEOUT) |
|
639 | def test_set_gpu_enable_invalid_values(self, connect, collection): |
|
640 | ''' |
|
641 | target: set "enable" param |
|
642 | method: call set_config with invalid child values |
|
643 | expected: status not ok |
|
644 | ''' |
|
645 | if str(connect._cmd("mode")[1]) == "CPU": |
|
646 | pytest.skip("Only support GPU mode") |
|
647 | for i in [-1, -2, 100]: |
|
648 | status, reply = connect.set_config("gpu", "enable", i) |
|
649 | assert not status.OK() |
|
650 | ||
651 | @pytest.mark.timeout(CONFIG_TIMEOUT) |
|
652 | def test_set_gpu_enable_valid(self, connect, collection): |