Add inner security-tests tests 30/35130/5
authorLukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Mon, 9 Feb 2015 13:26:04 +0000 (14:26 +0100)
committerLukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Mon, 16 Feb 2015 12:36:27 +0000 (13:36 +0100)
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

CMakeLists.txt
README
packaging/security-tests.spec
tests/CMakeLists.txt [new file with mode: 0644]
tests/inner-test.cpp [new file with mode: 0644]

index 35e367ed982eb990bb0faaba1d48a3d1a219ba5e..e6e0572dba4294fc4c7d5d558cf144b0bf569a25 100644 (file)
@@ -85,3 +85,4 @@ ENDIF(SMACK_ENABLE)
 ############################# subdirectories ##################################
 
 ADD_SUBDIRECTORY(src)
+ADD_SUBDIRECTORY(tests)
diff --git a/README b/README
index 87a2bed3b4b6d2f0b87bc68fa191c01c458fd1c9..92d11b3b2b85f16c673b0fd56a07b14eb5eb22e6 100644 (file)
--- 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:
index 270ec2b23bcfce70f21a23d7db10b18c68910529..a028144bc9d59f805be425dd2d0d7eeac1944d89 100644 (file)
@@ -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 (file)
index 0000000..7e2f4d8
--- /dev/null
@@ -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 (file)
index 0000000..052acfa
--- /dev/null
@@ -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 <dpl/test/test_runner.h>
+
+int main (int argc, char *argv[])
+{
+    int status = DPL::Test::TestRunnerSingleton::Instance().ExecTestRunner(argc, argv);
+    return status;
+}