Revert "Add the tui-toolkit for testing the zone policies" 01/67501/2
authorSungbae Yoo <sungbae.yoo@samsung.com>
Wed, 27 Apr 2016 01:46:12 +0000 (10:46 +0900)
committerSungbae Yoo <sungbae.yoo@samsung.com>
Wed, 27 Apr 2016 05:19:40 +0000 (14:19 +0900)
This reverts commit b12dea620b711fde303cc0bee24dd792e5f2af93.

Change-Id: If9e3bf1d1162425c0169e9a21d0e5586be65768f

packaging/device-policy-manager.spec
tools/cli/CMakeLists.txt
tools/cli/zone-tui.cpp [deleted file]

index 96512df..8cb7194 100644 (file)
@@ -41,7 +41,6 @@ managing device policies.
 %defattr(644,root,root,755)
 %attr(755,root,root) %{_bindir}/device-policy-manager
 %attr(700,root,root) %{_bindir}/factory-reset
-%attr(755,root,root) %{_bindir}/zone-tui
 %dir %{TZ_SYS_DATA}/dpm
 %dir %{TZ_SYS_ETC}/dpm/policy
 %config %{TZ_SYS_ETC}/dpm/policy/PolicyManifest.xml
index 6d27bd3..5841131 100644 (file)
@@ -15,9 +15,3 @@
 #
 
 INSTALL(FILES factory-reset DESTINATION bin)
-
-ADD_EXECUTABLE(zone-tui zone-tui.cpp)
-INCLUDE_DIRECTORIES(SYSTEM ${DPM_LIBS})
-TARGET_LINK_LIBRARIES(zone-tui dpm)
-
-INSTALL(FILES zone-tui DESTINATION bin)
diff --git a/tools/cli/zone-tui.cpp b/tools/cli/zone-tui.cpp
deleted file mode 100644 (file)
index 98e1f16..0000000
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Contact: Sungbae Yoo <sungbae.yoo@samsung.com>
- *
- * 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 <string>
-#include <vector>
-#include <iostream>
-
-#include <unistd.h>
-#include <getopt.h>
-#include <dpm/zone.h>
-
-extern char** environ;
-
-static void usage(const std::string name)
-{
-    std::cout << "Usage: " << name << " [OPTIONS]" << std::endl
-              << "Manage the zones" << std::endl
-              << std::endl
-              << "Options :" << std::endl
-              << "   -c, --create=ZONE  create the specified zone" << std::endl
-              << "   -w, --wizard=PKG   specify the setup wizard" << std::endl
-              << "   -d, --destroy=ZONE destroy the specified zone" << std::endl
-              << "   -s, --state=ZONE   show the state of the zone" << std::endl
-              << "   -l, --list         show all of zones" << std::endl
-              << "   -h, --help         show this" << std::endl
-              << std::endl;
-}
-
-int main(int argc, char* argv[])
-{
-    int opt = 0, index, ret;
-    std::string create, wizard;
-
-    struct option options[] = {
-        {"create", required_argument, 0, 'c'},
-        {"wizard", required_argument, 0, 'w'},
-        {"destroy", required_argument, 0, 'd'},
-        {"state", required_argument, 0, 's'},
-        {"list", no_argument, 0, 'l'},
-        {"help", no_argument, 0, 'h'},
-        {0, 0, 0, 0}
-    };
-
-    if (argc <= 1) {
-        usage(argv[0]);
-        return EXIT_SUCCESS;
-    }
-
-    if (getuid() == 0) {
-        std::cerr << "this tool should be done as non-root user" << std::endl;
-        return EXIT_FAILURE;
-    }
-
-    dpm_context_h context = dpm_context_create();
-    if (context == NULL) {
-        std::cerr << "Failed to create client handle" << std::endl;
-        return EXIT_FAILURE;
-    }
-
-    dpm_zone_policy_h policy = dpm_context_acquire_zone_policy(context);
-    if (policy == NULL) {
-        std::cerr << "Failed to create zone policy handle" << std::endl;
-        dpm_context_destroy(context);
-        return EXIT_FAILURE;
-    }
-
-    while (opt != -1) {
-        opt = getopt_long(argc, argv, "c:w:d:s:lh", options, &index);
-        switch (opt) {
-        case 'c':
-            create = optarg;
-            break;
-        case 'w':
-            wizard = optarg;
-            break;
-        case 'd':
-            ret = dpm_zone_destroy(policy, optarg);
-            if (ret != 0) {
-                std::cerr << optarg << " can't be destroyed." << std::endl;
-            } else {
-                std::cerr << optarg << " will be removed." << std::endl;
-            }
-            break;
-        case 's':
-            dpm_zone_state_e state;
-            ret = dpm_zone_get_state(policy, optarg, &state);
-            std::cout << optarg << " state is " << state << "." << std::endl;
-            break;
-        case 'l':
-            break;
-        case 'h':
-            usage(argv[0]);
-            break;
-        }
-    }
-
-    if (create.size() > 0 && wizard.size() > 0) {
-        ret = dpm_zone_create(policy, create.c_str(), wizard.c_str());
-        if (ret != 0) {
-            std::cerr << create << " can't be created."<< std::endl;
-        } else {
-            std::cerr << create << " has been created."<< std::endl;
-        }
-    } else if (wizard.size() > 0) {
-        std::cerr << "Wizard option should be used with create option." << std::endl;
-    } else if (create.size() > 0) {
-        std::cerr << "Setup wizard package should be specified." << std::endl
-                  << "  ex) --wizard org.tizen.zone-setup-wizard" << std::endl;
-    }
-
-    dpm_context_release_zone_policy(context, policy);
-
-    dpm_context_destroy(context);
-
-    return EXIT_SUCCESS;
-}