%attr(755,root,root) %{_bindir}/security-manager-unit-tests
%attr(755,root,root) %{_bindir}/security-manager-performance-tests
%attr(755,root,root) %{_bindir}/security-manager-test-rules-loader
-%attr(755,root,root) %{_bindir}/list-running-apps-ns
%attr(0600,root,root) %{db_test_dir}/.security-manager-test.db
%attr(0600,root,root) %{db_test_dir}/.security-manager-test.db-journal
%attr(0600,root,root) %{db_test_dir}/.security-manager-test-v0.db
)
INSTALL(TARGETS ${TARGET_SM_TESTS} ${TARGET_SM_PERFORMANCE_TESTS} DESTINATION ${BIN_INSTALL_DIR})
-
-########################### list running apps based on namespace ################################
-
-SET(LIST_SOURCES
- ${SM_TEST_SRC}/list-running-apps-ns.cpp)
-
-SET(LIST_TARGET "list-running-apps-ns")
-
-ADD_EXECUTABLE(${LIST_TARGET} ${LIST_SOURCES})
-
-TARGET_LINK_LIBRARIES(${LIST_TARGET}
- boost_regex
- boost_filesystem)
-
-INSTALL(TARGETS ${LIST_TARGET} DESTINATION ${BIN_INSTALL_DIR})
+++ /dev/null
-/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * This file is licensed under the terms of MIT License or the Apache License
- * Version 2.0 of your choice. See the LICENSE.MIT file for MIT license details.
- * See the LICENSE file or the notice below for Apache License Version 2.0
- * details.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <boost/filesystem.hpp>
-#include <boost/regex.hpp>
-#include <boost/tokenizer.hpp>
-#include <string>
-#include <iostream>
-
-std::string ROOT_DIR = "/run/user";
-
-std::string default_regexp =
- "/run/user/(\\d*)/apps/(User::Pkg::([^/]*))|(User::Pkg::User::App::([^/]*))";
-
-int main(int argc, char **argv) {
- std::string regexp = default_regexp;
- if (argc > 1) {
- regexp = argv[1];
- }
-
- boost::system::error_code ec;
- boost::filesystem::path root(ROOT_DIR);
- boost::regex appFilter(regexp);
-
- if (boost::filesystem::is_directory(root)) {
- for (boost::filesystem::recursive_directory_iterator it(root, ec), eit;
- it != eit;
- it.increment(ec))
- {
- if (ec) {
- it.pop();
- continue;
- }
-
- boost::smatch matches;
- std::string path = it->path().string();
- if (boost::regex_match(path, matches, appFilter)) {
- if (matches.size() < 4) {
- std::cerr << "Something went wrong with regexp!" << std::endl;
- continue;
- }
- std::string uidStr = matches[1];
- std::string appLabel = matches[2];
- std::string appId = matches[3];
-
- std::cout << uidStr << " : " << appLabel << " : " << appId << std::endl;
- }
- }
- }
- else {
- std::cerr << ROOT_DIR << " is not a directory" << std::endl;
- }
- return 0;
-}