Revert "Add base codes of unit tests" 36/124136/4
authorSungbae Yoo <sungbae.yoo@samsung.com>
Mon, 10 Apr 2017 09:29:09 +0000 (02:29 -0700)
committerSungbae Yoo <sungbae.yoo@samsung.com>
Wed, 12 Apr 2017 06:05:01 +0000 (15:05 +0900)
This reverts commit 7859e2369451b65c712e3de157e4f408eb89138f.

Change-Id: I5d12dcd9be167e0c36815c5944b9442c6a763419

packaging/audit-trail.spec
tests/CMakeLists.txt [deleted file]
tests/main.cpp [deleted file]
tests/module.cpp [deleted file]

index 5ab6c993ed0f212d6c0469b3a1498292ab28334d..dcf1be3a99ddbe2dbd1da443dba2570d3c95a458 100755 (executable)
@@ -30,34 +30,12 @@ The audit-trail-kernel package provides a kernel module which is responsible for
 %build
 make %{?jobs:-j%jobs} KERNEL_DEV_PATH=%{kernel_dev_path}
 
-cd tests
-%cmake . -DKERNEL_MOD_PATH=%{kernel_mod_path}
-make %{?jobs:-j%jobs}
-
 %install
 mkdir -p %{buildroot}%{kernel_mod_path}
 make %{?jobs:-j%jobs} KERNEL_DEV_PATH=%{kernel_dev_path} KERNEL_MOD_PATH=%{buildroot}%{kernel_mod_path} install
 
-cd tests
-%make_install
-
 %clean
 make %{?jobs:-j%jobs} KERNEL_DEV_PATH=%{kernel_dev_path} clean
 rm -rf %{buildroot}
 
 %postun
-
-## Test package #######################################################
-%package -n %{name}-unit-tests
-Summary: Unit tests to verify audit-trail module
-Group: Security/Testing
-Requires: %{name} = %{version}-%{release}
-BuildRequires: pkgconfig(klay)
-
-%description -n %{name}-unit-tests
-The audit-trail-unit-test package includes the unit test program to verify the module
-
-%files -n %{name}-unit-tests
-%manifest audit-trail.manifest
-%defattr(644,root,root,755)
-%attr(755,root,root) %{_bindir}/audit-trail-unit-tests
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
deleted file mode 100755 (executable)
index 4d96c64..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-#
-#  Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
-
-PROJECT(audit-trail-unit-tests)
-
-INCLUDE(FindPkgConfig)
-
-IF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7)
-       SET(CXX_STD "c++0x")
-else()
-       SET(CXX_STD "c++11")
-endif()
-
-SET(COMPILE_BASE_FLAGS "-g -fPIC -Werror -Wall -Wl,--as-needed -Wl,--no-whole-archive")
-SET(CMAKE_C_FLAGS              "${COMPILE_BASE_FLAGS} -O0 -ggdb")
-SET(CMAKE_CXX_FLAGS            "${COMPILE_BASE_FLAGS} -O0 -ggdb -std=${CXX_STD} -fno-rtti")
-
-SET(TEST_SRC   main.cpp
-                               module.cpp
-)
-
-ADD_EXECUTABLE(${PROJECT_NAME} ${TEST_SRC})
-SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES  PREFIX ""
-       COMPILE_DEFINITIONS KERNEL_MOD_PATH="${KERNEL_MOD_PATH}"
-)
-
-PKG_CHECK_MODULES(TEST_DEPS REQUIRED   klay
-)
-
-TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${TEST_DEPS_LIBRARIES})
-
-INSTALL(TARGETS        ${PROJECT_NAME} DESTINATION bin)
diff --git a/tests/main.cpp b/tests/main.cpp
deleted file mode 100644 (file)
index d32624f..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- *  Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- */
-#include <klay/testbench.h>
-#include <klay/audit/logger.h>
-
-int main(int argc, char** argv)
-{
-       audit::Logger::setLogLevel(audit::LogLevel::Trace);
-
-       system("/sbin/insmod " KERNEL_MOD_PATH "/audit-trail.ko");
-
-       testbench::Testbench::runAllTestSuites();
-
-       system("/sbin/rmmod audit-trail");
-
-       return EXIT_SUCCESS;
-}
diff --git a/tests/module.cpp b/tests/module.cpp
deleted file mode 100644 (file)
index a560e2f..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- *  Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- */
-#include <fstream>
-
-#include <klay/error.h>
-#include <klay/exception.h>
-#include <klay/testbench.h>
-#include <klay/process.h>
-
-TESTCASE(ModuleLoadable)
-{
-       std::ifstream modules("/proc/modules");
-       std::string moduleName;
-
-       modules >> moduleName;
-
-       if (moduleName != "audit_trail") {
-               TEST_FAIL("The module isn't loaded");
-       }
-}