#include <ckmc/ckmc-type.h>
#include <ckm-common.h>
#include <tests_common.h>
-#include <access_provider2.h>
#include <ckm/ckm-control.h>
#include <ckm/ckm-manager.h>
#include <ckmc/ckmc-control.h>
#include <ckmc/ckmc-manager.h>
-#include <service_manager.h>
#include <fcntl.h>
#include <unistd.h>
}
}
-const char* SERVICE[] = {
- "central-key-manager-listener.service",
- "central-key-manager.service" };
-
-void start_service(ServiceIdx idx)
-{
- ServiceManager sm(SERVICE[idx]);
- sm.startService();
-}
-
-void stop_service(ServiceIdx idx)
-{
- ServiceManager sm(SERVICE[idx]);
- sm.stopService();
-}
-
std::string getLabel() {
int ret;
char* myLabel = NULL;
return std::string(alias);
}
-// changes process label
-void change_label(const char* label)
+std::string aliasWithLabelFromSelf(const char *alias)
{
- int ret = smack_set_label_for_self(label);
- RUNNER_ASSERT_MSG(0 == ret, "Error in smack_set_label_for_self("<<label<<"). Error: " << ret);
-}
+ std::ostringstream oss;
+ oss << getOwnerIdFromSelf() << ckmc_label_name_separator << alias;
-ScopedLabel::ScopedLabel(const char* label) : m_original_label(getLabel())
-{
- change_label(label);
-}
-
-ScopedLabel::~ScopedLabel()
-{
- /*
- * Let it throw. If we can't restore label then remaining tests results will be
- * unreliable anyway.
- */
- change_label(m_original_label.c_str());
+ return oss.str();
}
#define ERRORDESCRIBE(name) case name: return #name