#include <tests_common.h>
#include <cynara_test_client.h>
#include <cynara_test_admin.h>
+#include <cynara_test_env.h>
+#include <plugins.h>
#include <climits>
}
}
+void testPlugins(const std::vector<std::string> &plugins)
+{
+ using namespace CynaraTestPlugins;
+
+ DirectoryPaths paths;
+ Descriptions expectedDescriptions(POLICY_DESCRIPTIONS.at(DEFAULT_POLICY));
+
+ for (auto &plugin : plugins) {
+ paths.push_back(TEST_PLUGIN_PATH + plugin);
+
+ const Descriptions &pluginDescriptions = POLICY_DESCRIPTIONS.at(plugin);
+ expectedDescriptions.insert(expectedDescriptions.end(),
+ pluginDescriptions.begin(), pluginDescriptions.end());
+ }
+
+ loadServicePlugins(paths);
+
+ Admin admin;
+ admin.listPoliciesDescriptions(expectedDescriptions);
+}
+
+void tc30_admin_list_descriptions_no_plugins_func()
+{
+ testPlugins({});
+}
+
+void tc31_admin_list_descriptions_1_plugin_single_policy_func()
+{
+ testPlugins({CynaraTestPlugins::SINGLE_POLICY});
+}
+
+void tc32_admin_list_descriptions_1_plugin_multiple_policy_func()
+{
+ testPlugins({CynaraTestPlugins::MULTIPLE_POLICY});
+}
+
+void tc33_admin_list_descriptions_multiple_plugins_func()
+{
+ testPlugins({CynaraTestPlugins::SINGLE_POLICY,
+ CynaraTestPlugins::MULTIPLE_POLICY});
+}
+
RUNNER_TEST_GROUP_INIT(cynara_tests)
RUN_CYNARA_TEST(tc01_cynara_initialize)
RUN_CYNARA_TEST(tc27_admin_erase_recursive_linked_buckets)
RUN_CYNARA_TEST(tc28_admin_erase_non_recursive_linked_buckets)
RUN_CYNARA_TEST(tc29_admin_erase_recursive_from_sub_bucket)
+RUN_CYNARA_TEST(tc30_admin_list_descriptions_no_plugins)
+RUN_CYNARA_TEST(tc31_admin_list_descriptions_1_plugin_single_policy)
+RUN_CYNARA_TEST(tc32_admin_list_descriptions_1_plugin_multiple_policy)
+RUN_CYNARA_TEST(tc33_admin_list_descriptions_multiple_plugins)