Fix "(un)register_plugin(s)" C and Py tests (#15291)

* Fix "(un)register_plugin(s)" tests

* Remove test skips on Debian after tests are fixed
This commit is contained in:
Vitaliy Urusovskij
2023-01-27 09:54:43 +04:00
committed by GitHub
parent 369bce2e07
commit ea48786bc6
6 changed files with 74 additions and 132 deletions

View File

@@ -127,21 +127,10 @@ TEST(ie_core_register_plugin, registerPlugin) {
IE_ASSERT_OK(ie_core_create("", &core));
ASSERT_NE(nullptr, core);
ie_network_t *network = nullptr;
IE_EXPECT_OK(ie_core_read_network(core, xml, bin, &network));
EXPECT_NE(nullptr, network);
const char *plugin_name = "openvino_intel_cpu_plugin";
const char *plugin_name = "test_plugin";
const char *device_name = "BLA";
IE_EXPECT_OK(ie_core_register_plugin(core, plugin_name, device_name));
ie_config_t config = {nullptr, nullptr, nullptr};
ie_executable_network_t *exe_network = nullptr;
IE_EXPECT_OK(ie_core_load_network(core, network, device_name, &config, &exe_network));
EXPECT_NE(nullptr, exe_network);
ie_exec_network_free(&exe_network);
ie_network_free(&network);
ie_core_free(&core);
}
@@ -150,43 +139,24 @@ TEST(ie_core_register_plugins, registerPlugins) {
IE_ASSERT_OK(ie_core_create("", &core));
ASSERT_NE(nullptr, core);
ie_network_t *network = nullptr;
IE_EXPECT_OK(ie_core_read_network(core, xml, bin, &network));
EXPECT_NE(nullptr, network);
IE_EXPECT_OK(ie_core_register_plugins(core, plugins_xml));
ie_config_t config = {nullptr, nullptr, nullptr};
const char *device_name = "CUSTOM";
ie_executable_network_t *exe_network = nullptr;
IE_EXPECT_OK(ie_core_load_network(core, network, device_name, &config, &exe_network));
EXPECT_NE(nullptr, exe_network);
ie_exec_network_free(&exe_network);
ie_network_free(&network);
ie_core_free(&core);
}
TEST(ie_core_unregister_plugin, unregisterPlugin) {
TEST(ie_core_unload_plugin, unloadPlugin) {
ie_core_t *core = nullptr;
IE_ASSERT_OK(ie_core_create(plugins_xml, &core));
IE_ASSERT_OK(ie_core_create("", &core));
ASSERT_NE(nullptr, core);
ie_network_t *network = nullptr;
IE_EXPECT_OK(ie_core_read_network(core, xml, bin, &network));
EXPECT_NE(nullptr, network);
ie_config_t config = {nullptr, nullptr, nullptr};
const char *device_name = "CUSTOM";
ie_executable_network_t *exe_network = nullptr;
IE_EXPECT_OK(ie_core_load_network(core, network, device_name, &config, &exe_network));
EXPECT_NE(nullptr, exe_network);
ie_exec_network_free(&exe_network);
ie_network_free(&network);
const char *device_name = "CPU";
ie_core_versions_t versions = {0};
// Trigger plugin loading
IE_EXPECT_OK(ie_core_get_versions(core, device_name, &versions));
// Unload plugin
IE_EXPECT_OK(ie_core_unregister_plugin(core, device_name));
ie_core_versions_free(&versions);
ie_core_free(&core);
}