Revert "Add listing running apps based on namespace" 88/242888/4
authorDariusz Michaluk <d.michaluk@samsung.com>
Tue, 1 Sep 2020 11:50:30 +0000 (13:50 +0200)
committerDariusz Michaluk <d.michaluk@samsung.com>
Tue, 29 Sep 2020 12:16:02 +0000 (12:16 +0000)
It seems that this tool is unused.

This reverts commit 1a680bb1d2592a4110ca5d026c06dd11222d4e7c.

Change-Id: Ic7bd3f469a771d97e6a07af21912cd33140be46c

packaging/security-manager.spec
test/CMakeLists.txt
test/list-running-apps-ns.cpp [deleted file]

index 877de35..b207d72 100644 (file)
@@ -345,7 +345,6 @@ chsmack -a System %{db_test_dir}/.security-manager-test-rules*.txt
 %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
index fef4bb3..ffa2fdc 100644 (file)
@@ -191,18 +191,3 @@ TARGET_LINK_LIBRARIES(${TARGET_SM_PERFORMANCE_TESTS}
 )
 
 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})
diff --git a/test/list-running-apps-ns.cpp b/test/list-running-apps-ns.cpp
deleted file mode 100644 (file)
index 806a17f..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * 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;
-}