From: Michal Eljasiewicz Date: Wed, 5 Nov 2014 13:04:51 +0000 (+0100) Subject: security_server_tests_dbus moved to separate directory X-Git-Tag: security-manager_5.5_testing~122^2~40 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=332a3c87282e2eabc283ca706ca56c46dbdd15e9;p=platform%2Fcore%2Ftest%2Fsecurity-tests.git security_server_tests_dbus moved to separate directory tests moved out of security_server directory and renamed Change-Id: If3a3aedecc91f43803dfb349ac6a06a79ed4eccd Signed-off-by: Michal Eljasiewicz --- diff --git a/packaging/security-tests.spec b/packaging/security-tests.spec index 10deacb..3bbb932 100644 --- a/packaging/security-tests.spec +++ b/packaging/security-tests.spec @@ -71,13 +71,13 @@ echo "security-tests postinst done ..." /etc/dbus-1/system.d/security-tests.conf /usr/bin/libsmack-test +/usr/bin/smack-dbus-tests /usr/bin/libprivilege-control-test /usr/bin/security-server-tests-client-smack /usr/bin/security-server-tests-server /usr/bin/security-server-tests-password /usr/bin/security-server-tests-privilege /usr/bin/security-server-tests-stress -/usr/bin/security-server-tests-dbus /etc/smack/test_smack_rules_full /etc/smack/test_smack_rules2 /etc/smack/test_smack_rules3 diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index c658424..57212c5 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -97,6 +97,7 @@ ADD_SUBDIRECTORY(common) ADD_SUBDIRECTORY(ckm) ADD_SUBDIRECTORY(libprivilege-control-tests) ADD_SUBDIRECTORY(libsmack-tests) +ADD_SUBDIRECTORY(smack-dbus-tests) ADD_SUBDIRECTORY(security-server-tests) ADD_SUBDIRECTORY(security-manager-tests) ADD_SUBDIRECTORY(cynara-tests) diff --git a/tests/security-server-tests/CMakeLists.txt b/tests/security-server-tests/CMakeLists.txt index d0497a9..6340140 100644 --- a/tests/security-server-tests/CMakeLists.txt +++ b/tests/security-server-tests/CMakeLists.txt @@ -1,5 +1,5 @@ # -#Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved +#Copyright (c) 2013-2014 Samsung Electronics Co., Ltd All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -40,7 +40,6 @@ SET(TARGET_SEC_SRV_PWD_TESTS "security-server-tests-password") SET(TARGET_SEC_SRV_PRIVILEGE_TESTS "security-server-tests-privilege") SET(TARGET_SEC_SRV_STRESS_TESTS "security-server-tests-stress") SET(TARGET_SEC_SRV_MT_TESTS "security-server-tests-mt") -SET(TARGET_SEC_SRV_DBUS_TESTS "security-server-tests-dbus") SET(TARGET_SEC_SRV_MEASURER "security-server-tests-api-speed") @@ -80,10 +79,6 @@ SET(SEC_SRV_MT_SOURCES ${PROJECT_SOURCE_DIR}/tests/security-server-tests/security_server_tests_mt.cpp ) -SET(SEC_SRV_DBUS_SOURCES - ${PROJECT_SOURCE_DIR}/tests/security-server-tests/security_server_tests_dbus.cpp - ) - SET(SEC_SRV_MEASURER_SOURCES ${PROJECT_SOURCE_DIR}/tests/security-server-tests/security_server_measurer_API_speed.cpp ${PROJECT_SOURCE_DIR}/tests/security-server-tests/security_server_mockup.cpp @@ -110,7 +105,6 @@ ADD_EXECUTABLE(${TARGET_SEC_SRV_PWD_TESTS} ${SEC_SRV_PWD_SOURCES}) ADD_EXECUTABLE(${TARGET_SEC_SRV_PRIVILEGE_TESTS} ${SEC_SRV_PRIVILEGE_SOURCES}) ADD_EXECUTABLE(${TARGET_SEC_SRV_STRESS_TESTS} ${SEC_SRV_STRESS_SOURCES}) ADD_EXECUTABLE(${TARGET_SEC_SRV_MT_TESTS} ${SEC_SRV_MT_SOURCES}) -ADD_EXECUTABLE(${TARGET_SEC_SRV_DBUS_TESTS} ${SEC_SRV_DBUS_SOURCES}) ADD_EXECUTABLE(${TARGET_SEC_SRV_MEASURER} ${SEC_SRV_MEASURER_SOURCES}) @@ -152,12 +146,6 @@ TARGET_LINK_LIBRARIES(${TARGET_SEC_SRV_MT_TESTS} tests-common ) -TARGET_LINK_LIBRARIES(${TARGET_SEC_SRV_DBUS_TESTS} - ${SEC_SRV_TESTS_DEP_LIBRARIES} - dpl-test-framework - tests-common - ) - TARGET_LINK_LIBRARIES(${TARGET_SEC_SRV_MEASURER} ${TARGET_SEC_SRV_COMMON} ${SEC_SRV_TESTS_DEP_LIBRARIES} @@ -173,7 +161,6 @@ INSTALL(TARGETS ${TARGET_SEC_SRV_PWD_TESTS} DESTINATION /usr/bin) INSTALL(TARGETS ${TARGET_SEC_SRV_PRIVILEGE_TESTS} DESTINATION /usr/bin) INSTALL(TARGETS ${TARGET_SEC_SRV_STRESS_TESTS} DESTINATION /usr/bin) INSTALL(TARGETS ${TARGET_SEC_SRV_MT_TESTS} DESTINATION /usr/bin) -INSTALL(TARGETS ${TARGET_SEC_SRV_DBUS_TESTS} DESTINATION /usr/bin) INSTALL(TARGETS ${TARGET_SEC_SRV_MEASURER} DESTINATION /usr/bin) INSTALL(FILES diff --git a/tests/security-tests-all.sh b/tests/security-tests-all.sh index f64bc45..0fbb597 100644 --- a/tests/security-tests-all.sh +++ b/tests/security-tests-all.sh @@ -16,12 +16,12 @@ fi # 'text' - console output # 'summary' - used for summary view security-tests.sh smack --output=text --output=summary $ign +security-tests.sh smack-dbus --output=text --output=summary $ign #security-tests.sh libprivilege-control --output=text --output=summary $ign security-tests.sh ss-clientsmack --output=text --output=summary $ign security-tests.sh ss-server --output=text --output=summary $ign security-tests.sh ss-password --output=text --output=summary $ign security-tests.sh ss-privilege --output=text --output=summary $ign -security-tests.sh ss-dbus --output=text --output=summary $ign security-tests.sh ss-stress --output=text --output=summary $ign security-tests.sh security-manager --output=text --output=summary $ign security-tests.sh cynara --output=text --output=summary $ign diff --git a/tests/security-tests.sh b/tests/security-tests.sh index d175ef8..db3221c 100644 --- a/tests/security-tests.sh +++ b/tests/security-tests.sh @@ -1,7 +1,7 @@ #!/bin/sh ##################################################################### -# Copyright (c) 2012 Samsung Electronics Co., Ltd All Rights Reserved +# Copyright (c) 2012-2014 Samsung Electronics Co., Ltd All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -28,6 +28,12 @@ case $1 in echo libsmack-test "${@:2}" # propagate all remaining arguments (except first) ;; +"smack-dbus") + echo "=========================================================================" + echo "SMACK DBUS TEST" + echo + smack-dbus-tests "${@:2}" + ;; "libprivilege-control") echo "=========================================================================" echo $1 @@ -70,12 +76,6 @@ case $1 in echo security-server-tests-privilege "${@:2}" ;; -"ss-dbus") - echo "=========================================================================" - echo "SECURITY SERVER TEST DBUS" - echo - security-server-tests-dbus "${@:2}" - ;; "security-manager") echo "=========================================================================" echo "SECURITY MANAGER TESTS" @@ -92,7 +92,7 @@ case $1 in echo "Correct using:" echo " security_test.sh " echo - echo "modules: smack, libprivilege-control, ss-clientsmack" + echo "modules: smack, smack-dbus, libprivilege-control, ss-clientsmack" echo " ss-server, ss-api-speed, ss-password, ss-stress" echo " ss-privilege, security-manager, cynara" ;; diff --git a/tests/smack-dbus-tests/CMakeLists.txt b/tests/smack-dbus-tests/CMakeLists.txt new file mode 100644 index 0000000..ed4026d --- /dev/null +++ b/tests/smack-dbus-tests/CMakeLists.txt @@ -0,0 +1,60 @@ +# +#Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved +# +# 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. +# +# @file CMakeLists.txt +# @author Michal Eljasiewicz (m.eljasiewic@samsung.com) +# @brief +# + +INCLUDE(FindPkgConfig) + +# Dependencies +PKG_CHECK_MODULES(SMACK_DBUS_TESTS_DEP + libsmack + dbus-1 + dbus-glib-1 + REQUIRED) + +# Targets definition + +INCLUDE_DIRECTORIES(SYSTEM + ${SMACK_DBUS_TESTS_DEP_INCLUDE_DIRS} + ) + +SET(TARGET_SMACK_DBUS_TESTS "smack-dbus-tests") + +# Sources definition + +SET(SMACK_DBUS_SOURCES + ${PROJECT_SOURCE_DIR}/tests/smack-dbus-tests/smack_dbus_tests.cpp + ) + +INCLUDE_DIRECTORIES( + ${PROJECT_SOURCE_DIR}/tests/common/ + ) + +ADD_DEFINITIONS("-I/usr/include/dbus-1.0") + +ADD_EXECUTABLE(${TARGET_SMACK_DBUS_TESTS} ${SMACK_DBUS_SOURCES}) + +TARGET_LINK_LIBRARIES(${TARGET_SMACK_DBUS_TESTS} + ${SMACK_DBUS_TESTS_DEP_LIBRARIES} + dpl-test-framework + tests-common + ) + +# Installation + +INSTALL(TARGETS ${TARGET_SMACK_DBUS_TESTS} DESTINATION /usr/bin) diff --git a/tests/security-server-tests/security_server_tests_dbus.cpp b/tests/smack-dbus-tests/smack_dbus_tests.cpp similarity index 96% rename from tests/security-server-tests/security_server_tests_dbus.cpp rename to tests/smack-dbus-tests/smack_dbus_tests.cpp index 3a59530..08b0df4 100644 --- a/tests/security-server-tests/security_server_tests_dbus.cpp +++ b/tests/smack-dbus-tests/smack_dbus_tests.cpp @@ -1,16 +1,11 @@ -#include +#include #include #include #include #include -#include #include -#include -#include #include #include "tests_common.h" -#include "security-server.h" -#include "privilege-control.h" #define DBUS_SERVER_NAME "test.method.server" #define DBUS_CALLER_NAME "test.method.caller" @@ -20,7 +15,7 @@ #define DBUS_SMACK_INTERFACE "org.freedesktop.DBus" #define DBUS_SMACK_METHOD "GetConnectionCredentials" -RUNNER_TEST_GROUP_INIT(SECURITY_SERVER_TESTS_DBUS); +RUNNER_TEST_GROUP_INIT(SMACK_DBUS); RUNNER_MULTIPROCESS_TEST_SMACK(tc01_smack_context_from_DBus) { @@ -168,12 +163,6 @@ RUNNER_MULTIPROCESS_TEST_SMACK(tc01_smack_context_from_DBus) //////NOSMACK ENV TESTS//////////////// /////////////////////////////////////// -/** - * NOSMACK version of tc01 test. - * - * This is almost an exact copy of the original SMACK DBus test. As in previous security-server - * tests, parts where SMACK is used are skipped, because most important functions will return error. - */ RUNNER_MULTIPROCESS_TEST_NOSMACK(tc01_smack_context_from_DBus_nosmack) { int ret = -1;