From: Lukasz Wojciechowski Date: Mon, 9 Feb 2015 13:26:04 +0000 (+0100) Subject: Add inner security-tests tests X-Git-Tag: security-manager_5.5_testing~122^2~11 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c2bcc149f378df41c38a575a1800ebd635ac28f4;p=platform%2Fcore%2Ftest%2Fsecurity-tests.git Add inner security-tests tests Inner tests might be useful in case of: * verification of advanced security-tests mechanisms; * testing if platform/image support features used in tests. Change-Id: Ibd9b5d97af33742434d00fd3d682456c1a8d51ff --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 35e367ed..e6e0572d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -85,3 +85,4 @@ ENDIF(SMACK_ENABLE) ############################# subdirectories ################################## ADD_SUBDIRECTORY(src) +ADD_SUBDIRECTORY(tests) diff --git a/README b/README index 87a2bed3..92d11b3b 100644 --- a/README +++ b/README @@ -26,6 +26,10 @@ security-manager cynara cynara-test +There are also inner-tests for testing complex security-tests framework +mechanisms with binary: + security-tests-inner-test + ==HOW TO RUN=================================================================== Each test suite may be run with options: diff --git a/packaging/security-tests.spec b/packaging/security-tests.spec index 270ec2b2..a028144b 100644 --- a/packaging/security-tests.spec +++ b/packaging/security-tests.spec @@ -108,3 +108,4 @@ echo "security-tests postinst done ..." /usr/lib/security-tests/cynara-tests/plugins/single-policy/* /usr/lib/security-tests/cynara-tests/plugins/multiple-policy/* /usr/lib/security-tests/cynara-tests/plugins/test-agent/* +/usr/bin/security-tests-inner-test diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt new file mode 100644 index 00000000..7e2f4d8d --- /dev/null +++ b/tests/CMakeLists.txt @@ -0,0 +1,59 @@ +# Copyright (c) 2015 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. +# + +cmake_minimum_required(VERSION 2.8.3) + +INCLUDE(FindPkgConfig) +SET(INNER_TARGET_TEST "security-tests-inner-test") + +PKG_CHECK_MODULES(INNER_TARGET_DEP + REQUIRED + glib-2.0 + ) + +#files to compile +SET(INNER_TARGET_TEST_SOURCES + ${PROJECT_SOURCE_DIR}/tests/inner-test.cpp + ) + +#header directories +INCLUDE_DIRECTORIES(SYSTEM + ${INNER_TARGET_DEP_INCLUDE_DIRS} + ) + +INCLUDE_DIRECTORIES( + ${PROJECT_SOURCE_DIR}/src/framework/include/ + ) + +#output format +ADD_EXECUTABLE(${INNER_TARGET_TEST} ${INNER_TARGET_TEST_SOURCES}) + +#linker directories +TARGET_LINK_LIBRARIES(${INNER_TARGET_TEST} + ${INNER_TARGET_DEP_LIBRARIES} + dpl-test-framework + ) + +#place for output file +INSTALL(TARGETS ${INNER_TARGET_TEST} + DESTINATION /usr/bin + PERMISSIONS OWNER_READ + OWNER_WRITE + OWNER_EXECUTE + GROUP_READ + GROUP_EXECUTE + WORLD_READ + WORLD_EXECUTE + ) diff --git a/tests/inner-test.cpp b/tests/inner-test.cpp new file mode 100644 index 00000000..052acfa2 --- /dev/null +++ b/tests/inner-test.cpp @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2015 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. + */ + +#include + +int main (int argc, char *argv[]) +{ + int status = DPL::Test::TestRunnerSingleton::Instance().ExecTestRunner(argc, argv); + return status; +}