diff --git a/inference-engine/ie_bridges/python/tests/test_ExecutableNetwork.py b/inference-engine/ie_bridges/python/tests/test_ExecutableNetwork.py index 2193a6501c24bb..73c240b9036a14 100644 --- a/inference-engine/ie_bridges/python/tests/test_ExecutableNetwork.py +++ b/inference-engine/ie_bridges/python/tests/test_ExecutableNetwork.py @@ -304,3 +304,35 @@ def test_get_config(device): exec_net = ie_core.load_network(net, device) config = exec_net.get_config("PERF_COUNT") assert config == "NO" + + +# issue 28996 +# checks that objects can deallocate in this order, if not - segfault happends +def test_input_info_deallocation(device): + ie_core = ie.IECore() + net = ie_core.read_network(model=test_net_xml, weights=test_net_bin) + exec_net = ie_core.load_network(net, device) + input_info = exec_net.input_info["data"] + del ie_core + del exec_net + del input_info + + +def test_outputs_deallocation(device): + ie_core = ie.IECore() + net = ie_core.read_network(model=test_net_xml, weights=test_net_bin) + exec_net = ie_core.load_network(net, device) + output = exec_net.outputs["fc_out"] + del ie_core + del exec_net + del output + + +def test_exec_graph_info_deallocation(device): + ie_core = ie.IECore() + net = ie_core.read_network(model=test_net_xml, weights=test_net_bin) + exec_net = ie_core.load_network(net, device) + exec_graph_info = exec_net.get_exec_graph_info() + del ie_core + del exec_net + del exec_graph_info diff --git a/inference-engine/ie_bridges/python/tests/test_InputInfoCPtr.py b/inference-engine/ie_bridges/python/tests/test_InputInfoCPtr.py index abfab2ce1b35dd..4631f108441239 100644 --- a/inference-engine/ie_bridges/python/tests/test_InputInfoCPtr.py +++ b/inference-engine/ie_bridges/python/tests/test_InputInfoCPtr.py @@ -16,6 +16,7 @@ def test_name(device): exec_net = ie.load_network(net, device, num_requests=5) assert isinstance(exec_net.input_info['data'], InputInfoCPtr) assert exec_net.input_info['data'].name == "data", "Incorrect name" + del ie del exec_net @@ -25,6 +26,7 @@ def test_precision(device): exec_net = ie.load_network(net, device, num_requests=5) assert isinstance(exec_net.input_info['data'], InputInfoCPtr) assert exec_net.input_info['data'].precision == "FP32", "Incorrect precision" + del ie del exec_net @@ -36,6 +38,7 @@ def test_no_precision_setter(device): exec_net.input_info['data'].precision = "I8" assert "attribute 'precision' of 'openvino.inference_engine.ie_api.InputInfoCPtr' " \ "objects is not writable" in str(e.value) + del ie del exec_net @@ -45,9 +48,24 @@ def test_input_data(device): exec_net = ie.load_network(net, device, num_requests=5) assert isinstance(exec_net.input_info['data'], InputInfoCPtr) assert isinstance(exec_net.input_info['data'].input_data, DataPtr), "Incorrect precision for layer 'fc_out'" + del ie del exec_net +# issue 28996 +# checks that objects can deallocate in this order, if not - segfault happends +def test_input_data_deallocation(device): + ie = IECore() + net = ie.read_network(model=test_net_xml, weights=test_net_bin) + exec_net = ie.load_network(net, device) + input_info = exec_net.input_info['data'] + input_data = input_info.input_data + del ie + del exec_net + del input_info + del input_data + + def test_tensor_desc(device): ie = IECore() net = ie.read_network(model=test_net_xml, weights=test_net_bin)