SET(VIST_PLUGIN_DIR "${VIST_RO_DIR}/plugin")
SET(VIST_SCRIPT_DIR "${VIST_RO_DIR}/script")
-SET(DEFAULT_ADMIN_PATH "/usr/bin/vist-cli")
+SET(DEFAULT_POLICY_ADMIN "vist-cli")
SET(DB_INSTALL_DIR "${VIST_DB_DIR}")
SET(PLUGIN_INSTALL_DIR "${VIST_PLUGIN_DIR}")
SET(SCRIPT_INSTALL_DIR "${VIST_SCRIPT_DIR}")
-DUSER_NAME=%{user_name} \
-DGROUP_NAME=%{group_name} \
-DSMACK_LABEL=%{smack_label} \
- -DDEFAULT_ADMIN_PATH=%{_bindir}/vist-cli \
+ -DDEFAULT_POLICY_ADMIN=vist-cli \
-DDB_INSTALL_DIR:PATH=%{vist_db_dir} \
-DPLUGIN_INSTALL_DIR:PATH=%{vist_plugin_dir} \
-DSCRIPT_INSTALL_DIR:PATH=%{vist_script_dir} \
INCLUDE_DIRECTORIES(SYSTEM . common ${VIST_COMMON_DEPS_INCLUDE_DIRS})
ADD_DEFINITIONS(-DDB_PATH="${DB_INSTALL_DIR}/.vist.db"
- -DDEFAULT_ADMIN_PATH="${DEFAULT_ADMIN_PATH}"
+ -DDEFAULT_POLICY_ADMIN="${DEFAULT_POLICY_ADMIN}"
-DPLUGIN_INSTALL_DIR="${PLUGIN_INSTALL_DIR}"
-DSCRIPT_INSTALL_DIR="${SCRIPT_INSTALL_DIR}")
/// Cannot disenroll default admin
try {
- storage->disenroll(DEFAULT_ADMIN_PATH);
+ storage->disenroll(DEFAULT_POLICY_ADMIN);
} catch (const std::exception& e) {
isRaised = true;
}
TEST_F(PolicyStorageTests, activate)
{
auto storage = getStorage();
- EXPECT_FALSE(storage->isActivated(DEFAULT_ADMIN_PATH));
+ EXPECT_FALSE(storage->isActivated(DEFAULT_POLICY_ADMIN));
- storage->activate(DEFAULT_ADMIN_PATH);
- EXPECT_TRUE(storage->isActivated(DEFAULT_ADMIN_PATH));
+ storage->activate(DEFAULT_POLICY_ADMIN);
+ EXPECT_TRUE(storage->isActivated(DEFAULT_POLICY_ADMIN));
- storage->activate(DEFAULT_ADMIN_PATH, true);
- EXPECT_TRUE(storage->isActivated(DEFAULT_ADMIN_PATH));
+ storage->activate(DEFAULT_POLICY_ADMIN, true);
+ EXPECT_TRUE(storage->isActivated(DEFAULT_POLICY_ADMIN));
- storage->activate(DEFAULT_ADMIN_PATH, false);
- EXPECT_FALSE(storage->isActivated(DEFAULT_ADMIN_PATH));
+ storage->activate(DEFAULT_POLICY_ADMIN, false);
+ EXPECT_FALSE(storage->isActivated(DEFAULT_POLICY_ADMIN));
- storage->activate(DEFAULT_ADMIN_PATH);
- EXPECT_TRUE(storage->isActivated(DEFAULT_ADMIN_PATH));
+ storage->activate(DEFAULT_POLICY_ADMIN);
+ EXPECT_TRUE(storage->isActivated(DEFAULT_POLICY_ADMIN));
- storage->activate(DEFAULT_ADMIN_PATH, false);
+ storage->activate(DEFAULT_POLICY_ADMIN, false);
}
TEST_F(PolicyStorageTests, activate_failed)