Add testcases of trust-anchor library 05/120005/2
authorsangwan.kwon <sangwan.kwon@samsung.com>
Mon, 20 Mar 2017 08:24:46 +0000 (17:24 +0900)
committersangwan.kwon <sangwan.kwon@samsung.com>
Tue, 21 Mar 2017 06:28:19 +0000 (15:28 +0900)
Change-Id: Ia31dedd92c33000df652a55824a95b8918e0e5b7
Signed-off-by: sangwan.kwon <sangwan.kwon@samsung.com>
28 files changed:
CMakeLists.txt
packaging/trust-anchor.spec
src/init-lib.cpp
tests/CMakeLists.txt [new file with mode: 0644]
tests/main.cpp [new file with mode: 0644]
tests/res/CMakeLists.txt [new file with mode: 0644]
tests/res/certs/02265526.0 [new file with mode: 0644]
tests/res/certs/024dc131.0 [new file with mode: 0644]
tests/res/certs/03179a64.0 [new file with mode: 0644]
tests/res/certs/034868d6.0 [new file with mode: 0644]
tests/res/certs/062cdee6.0 [new file with mode: 0644]
tests/res/certs/064e0aa9.0 [new file with mode: 0644]
tests/res/certs/080911ac.0 [new file with mode: 0644]
tests/res/certs/0810ba98.0 [new file with mode: 0644]
tests/res/certs/09789157.0 [new file with mode: 0644]
tests/res/certs/0b1b94ef.0 [new file with mode: 0644]
tests/res/certs/0c4c9b6c.0 [new file with mode: 0644]
tests/res/certs/0d1b923b.0 [new file with mode: 0644]
tests/script/CMakeLists.txt [new file with mode: 0644]
tests/script/pre-test.sh.in [new file with mode: 0755]
tests/test-capi-installer.cpp [new file with mode: 0644]
tests/test-capi-launcher.cpp [new file with mode: 0644]
tests/test-certificate.cpp [new file with mode: 0644]
tests/test-installer.cpp [new file with mode: 0644]
tests/test-launcher.cpp [new file with mode: 0644]
tests/test-resource.hxx [new file with mode: 0644]
tests/test-util.cpp [new file with mode: 0644]
tests/test-util.hxx [new file with mode: 0644]

index 79b4dfe..313e990 100644 (file)
@@ -31,9 +31,11 @@ STRING(REGEX MATCH "([^.]*)" API_VERSION "${LIB_VERSION}")
 SET(TANCHOR_INCLUDE ${PROJECT_SOURCE_DIR}/api)
 SET(TANCHOR_SRC ${PROJECT_SOURCE_DIR}/src)
 SET(TARGET_TANCHOR_LIB ${LIB_NAME})
+SET(TARGET_TANCHOR_TEST ${LIB_NAME}-test)
 
 ADD_DEFINITIONS("-DTANCHOR_USR_DIR=\"${TANCHOR_USR}\"")
 ADD_DEFINITIONS("-DTANCHOR_GLOBAL_DIR=\"${TANCHOR_GLOBAL}\"")
+ADD_DEFINITIONS("-DTANCHOR_TEST_DIR=\"${TANCHOR_TEST}\"")
 ADD_DEFINITIONS("-DTANCHOR_BUNDLE=\"${TANCHOR_BUNDLE}\"")
 ADD_DEFINITIONS("-DTZ_SYS_CA_CERTS=\"${TZ_SYS_CA_CERTS}\"")
 ADD_DEFINITIONS("-DTZ_SYS_CA_BUNDLE=\"${TZ_SYS_CA_BUNDLE}\"")
@@ -71,8 +73,13 @@ IF(NOT DEFINED INCLUDE_INSTALL_DIR)
        SET(INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}")
 ENDIF(NOT DEFINED INCLUDE_INSTALL_DIR)
 
+IF(NOT DEFINED BIN_INSTALL_DIR)
+       SET(BIN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}")
+ENDIF(NOT DEFINED BIN_INSTALL_DIR)
+
 CONFIGURE_FILE(packaging/trust-anchor.manifest.in trust-anchor.manifest @ONLY)
 
 ADD_SUBDIRECTORY(api)
 ADD_SUBDIRECTORY(lib)
 ADD_SUBDIRECTORY(src)
+ADD_SUBDIRECTORY(tests)
index e21c10f..ad51802 100644 (file)
@@ -21,11 +21,12 @@ Requires(postun): /sbin/ldconfig
 %global group_name      security_fw
 %global smack_label     System
 
-%global tanchor_base    %{TZ_SYS_DATA}
+%global tanchor_base    %{TZ_SYS_DATA}/%{lib_name}
 %global tanchor_res     %{tanchor_base}/res
 %global tanchor_usr     %{tanchor_base}/usr
 %global tanchor_global  %{tanchor_base}/global
 %global tanchor_bundle  %{tanchor_base}/ca-bundle.pem
+%global tanchor_test    %{tanchor_base}/test
 
 %description
 The package provides trust-anchor which the application can assign
@@ -46,6 +47,11 @@ SSL root certificates for its HTTPS communication.
 %build
 %{!?build_type:%define build_type "RELEASE"}
 
+%if %{build_type} == "DEBUG" || %{build_type} == "PROFILING" || %{build_type} == "CCOV"
+       CFLAGS="$CFLAGS -Wp,-U_FORTIFY_SOURCE"
+       CXXFLAGS="$CXXFLAGS -Wp,-U_FORTIFY_SOURCE"
+%endif
+
 %cmake . -DCMAKE_BUILD_TYPE=%{build_type} \
                 -DLIB_NAME=%{lib_name} \
                 -DLIB_VERSION=%{version} \
@@ -57,8 +63,11 @@ SSL root certificates for its HTTPS communication.
                 -DTANCHOR_USR=%{tanchor_usr} \
                 -DTANCHOR_GLOBAL=%{tanchor_global} \
                 -DTANCHOR_BUNDLE=%{tanchor_bundle} \
+                -DTANCHOR_TEST=%{tanchor_test} \
                 -DTZ_SYS_CA_CERTS=%{TZ_SYS_CA_CERTS} \
-                -DTZ_SYS_CA_BUNDLE=%{TZ_SYS_CA_BUNDLE}
+                -DTZ_SYS_CA_BUNDLE=%{TZ_SYS_CA_BUNDLE} \
+                -DTZ_SYS_RO_CA_CERTS=%{TZ_SYS_RO_CA_CERTS} \
+                -DTZ_SYS_RO_CA_BUNDLE=%{TZ_SYS_RO_CA_BUNDLE}
 
 make %{?_smp_mflags}
 
@@ -90,3 +99,20 @@ The package provides Trust Anchor API development files.
 %{_includedir}/%{lib_name}/trust-anchor.hxx
 %{_libdir}/lib%{lib_name}.so
 %{_libdir}/pkgconfig/%{lib_name}.pc
+
+## Test Package ##############################################################
+%package -n trust-anchor-test
+Summary: Trust Anchor API test
+Group: Development/Libraries
+
+%description -n trust-anchor-test
+Testcases for trust anchor library
+
+%files -n trust-anchor-test
+%{_bindir}/%{lib_name}-test-installer
+%{_bindir}/%{lib_name}-test-launcher
+%{_bindir}/%{lib_name}-test-capi-launcher
+%{_bindir}/%{lib_name}-test-internal
+%{TZ_SYS_DATA}/%{lib_name}/test
+%{TZ_SYS_DATA}/%{lib_name}/test/certs
+%{TZ_SYS_DATA}/%{lib_name}/test/script
index 760c6b1..05099d1 100644 (file)
@@ -33,7 +33,7 @@ public:
        InitLib()
        {
                audit::Logger::setBackend(new audit::DlogLogSink());
-               audit::Logger::setTag("CERT_SVC");
+               audit::Logger::setTag("TRUST_ANCHOR");
        };
        ~InitLib() = default;
 };
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
new file mode 100644 (file)
index 0000000..536635c
--- /dev/null
@@ -0,0 +1,63 @@
+#  Copyright (c) 2017 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      Sangwan Kwon (sangwan.kwon@samsung.com)
+# @breif       Make trust anchor test program
+#
+
+INCLUDE_DIRECTORIES(SYSTEM .
+                                                  ${TANCHOR_INCLUDE}
+                                                  ${TANCHOR_SRC}
+                                                  ${${TARGET_TANCHOR_LIB}_DEP_INCLUDE_DIRS})
+
+FUNCTION(BUILD_TEST TEST_NAME TEST_SRCS)
+       ADD_EXECUTABLE(${TEST_NAME} ${TEST_SRCS})
+       TARGET_LINK_LIBRARIES(${TEST_NAME} ${TARGET_TANCHOR_LIB})
+       SET_SOURCE_FILES_PROPERTIES(${TEST_SRCS}
+               PROPERTIES
+                       COMPILE_FLAGS "-D_GNU_SOURCE -fPIE")
+       INSTALL(TARGETS ${TEST_NAME}
+                       DESTINATION ${BIN_INSTALL_DIR}
+                       PERMISSIONS OWNER_READ
+                                               OWNER_WRITE
+                                               OWNER_EXECUTE
+                                               GROUP_READ
+                                               GROUP_EXECUTE
+                                               WORLD_READ
+                                               WORLD_EXECUTE)
+ENDFUNCTION(BUILD_TEST)
+
+ADD_DEFINITIONS("-DTZ_SYS_RO_CA_CERTS=\"${TZ_SYS_RO_CA_CERTS}\"")
+ADD_DEFINITIONS("-DTZ_SYS_RO_CA_BUNDLE=\"${TZ_SYS_RO_CA_BUNDLE}\"")
+
+SET(INSTALLER_SRCS main.cpp
+                                  test-capi-installer.cpp
+                                  test-installer.cpp)
+SET(LAUNCHER_SRCS main.cpp
+                                 test-util.cpp
+                                 test-launcher.cpp)
+SET(CAPI_LAUNCHER_SRCS main.cpp
+                                          test-util.cpp
+                                          test-capi-launcher.cpp)
+SET(INTERNAL_SRCS main.cpp
+                                 test-certificate.cpp)
+
+BUILD_TEST("${TARGET_TANCHOR_TEST}-installer" "${INSTALLER_SRCS}")
+BUILD_TEST("${TARGET_TANCHOR_TEST}-launcher" "${LAUNCHER_SRCS}")
+BUILD_TEST("${TARGET_TANCHOR_TEST}-capi-launcher" "${CAPI_LAUNCHER_SRCS}")
+BUILD_TEST("${TARGET_TANCHOR_TEST}-internal" "${INTERNAL_SRCS}")
+
+ADD_SUBDIRECTORY(res)
+ADD_SUBDIRECTORY(script)
diff --git a/tests/main.cpp b/tests/main.cpp
new file mode 100644 (file)
index 0000000..2704320
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ *  Copyright (c) 2017 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        main.cpp
+ * @author      Sangwan Kwon (sangwan.kwon@samsung.com)
+ * @version     0.1
+ * @brief       Implemetation of testbench driver
+ */
+
+#include <klay/audit/logger.h>
+
+#include <klay/testbench.h>
+
+int main(int /*argc*/, char** /*argv*/)
+{
+       audit::Logger::setLogLevel(audit::LogLevel::Trace);
+
+       testbench::Testbench::runAllTestSuites();
+
+       return 0;
+}
diff --git a/tests/res/CMakeLists.txt b/tests/res/CMakeLists.txt
new file mode 100644 (file)
index 0000000..310fe75
--- /dev/null
@@ -0,0 +1,20 @@
+#  Copyright (c) 2017 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      Sangwan Kwon (sangwan.kwon@samsung.com)
+# @breif       Install trust anchor test resource
+#
+
+INSTALL(DIRECTORY certs DESTINATION ${TANCHOR_TEST})
diff --git a/tests/res/certs/02265526.0 b/tests/res/certs/02265526.0
new file mode 100644 (file)
index 0000000..5084b67
--- /dev/null
@@ -0,0 +1,31 @@
+# alias=Entrust Root Certification Authority - G2
+# trust=CKA_TRUST_CODE_SIGNING CKA_TRUST_EMAIL_PROTECTION CKA_TRUST_SERVER_AUTH
+# distrust=
+# openssl-trust=codeSigning emailProtection serverAuth
+-----BEGIN TRUSTED CERTIFICATE-----
+MIIEPjCCAyagAwIBAgIESlOMKDANBgkqhkiG9w0BAQsFADCBvjELMAkGA1UEBhMC
+VVMxFjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xKDAmBgNVBAsTH1NlZSB3d3cuZW50
+cnVzdC5uZXQvbGVnYWwtdGVybXMxOTA3BgNVBAsTMChjKSAyMDA5IEVudHJ1c3Qs
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XSt/S1mja/qYh2iARVBCuch38aNzx+LaUa2NSJXsq9rD1s2G2v
+1fN2D807iDginWyTmsQ9v4IbZT+mD12q/OWyFcq1rca8PdCE6OoGcrBNOTJ4vz4R
+nAuknZoh8/CbCzB428Hch0P+vGOaysXCHMnHjf87ElgI5rY97HosTvuDls4MPGmH
+VHOkc8KT/1EQrBVUAdj8BbGJoX90g5pJ19xOe4pIb4tF9jBLMB4GCCsGAQUFBwMD
+BggrBgEFBQcDBAYIKwYBBQUHAwEMKUVudHJ1c3QgUm9vdCBDZXJ0aWZpY2F0aW9u
+IEF1dGhvcml0eSAtIEcy
+-----END TRUSTED CERTIFICATE-----
diff --git a/tests/res/certs/024dc131.0 b/tests/res/certs/024dc131.0
new file mode 100644 (file)
index 0000000..3b52c82
--- /dev/null
@@ -0,0 +1,49 @@
+# alias=Microsec e-Szigno Root CA
+# trust=CKA_TRUST_CODE_SIGNING CKA_TRUST_EMAIL_PROTECTION CKA_TRUST_SERVER_AUTH
+# distrust=
+# openssl-trust=codeSigning emailProtection serverAuth
+-----BEGIN TRUSTED CERTIFICATE-----
+MIIHqDCCBpCgAwIBAgIRAMy4579OKRr9otxmpRwsDxEwDQYJKoZIhvcNAQEFBQAw
+cjELMAkGA1UEBhMCSFUxETAPBgNVBAcTCEJ1ZGFwZXN0MRYwFAYDVQQKEw1NaWNy
+b3NlYyBMdGQuMRQwEgYDVQQLEwtlLVN6aWdubyBDQTEiMCAGA1UEAxMZTWljcm9z
+ZWMgZS1Temlnbm8gUm9vdCBDQTAeFw0wNTA0MDYxMjI4NDRaFw0xNzA0MDYxMjI4
+NDRaMHIxCzAJBgNVBAYTAkhVMREwDwYDVQQHEwhCdWRhcGVzdDEWMBQGA1UEChMN
+TWljcm9zZWMgTHRkLjEUMBIGA1UECxMLZS1Temlnbm8gQ0ExIjAgBgNVBAMTGU1p
+Y3Jvc2VjIGUtU3ppZ25vIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw
+gg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rnfVJONJPU+NVkBHbmJbGSfI+9J8b4PeI3CVimUTYc78/
+MPMMNz7UwiiAc7EBt51alhQBS6kRnSlqLtBdgcDPsiBDxwPgN05dCtxZICUwOzAe
+BggrBgEFBQcDAwYIKwYBBQUHAwQGCCsGAQUFBwMBDBlNaWNyb3NlYyBlLVN6aWdu
+byBSb290IENB
+-----END TRUSTED CERTIFICATE-----
diff --git a/tests/res/certs/03179a64.0 b/tests/res/certs/03179a64.0
new file mode 100644 (file)
index 0000000..d1c10a5
--- /dev/null
@@ -0,0 +1,37 @@
+# alias=Staat der Nederlanden EV Root CA
+# trust=CKA_TRUST_SERVER_AUTH
+# distrust=
+# openssl-trust=serverAuth
+-----BEGIN TRUSTED CERTIFICATE-----
+MIIFcDCCA1igAwIBAgIEAJiWjTANBgkqhkiG9w0BAQsFADBYMQswCQYDVQQGEwJO
+TDEeMBwGA1UECgwVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSkwJwYDVQQDDCBTdGFh
+dCBkZXIgTmVkZXJsYW5kZW4gRVYgUm9vdCBDQTAeFw0xMDEyMDgxMTE5MjlaFw0y
+MjEyMDgxMTEwMjhaMFgxCzAJBgNVBAYTAk5MMR4wHAYDVQQKDBVTdGFhdCBkZXIg
+TmVkZXJsYW5kZW4xKTAnBgNVBAMMIFN0YWF0IGRlciBOZWRlcmxhbmRlbiBFViBS
+b290IENBMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA48d+ifkkSzrS
+M4M1LGns3Amk41GoJSt5uAg94JG6hIXGhaTK5skuU6TJJB79VWZxXSzFYGgEt9nC
+UiY4iKTWO0Cmws0/zZiTs1QUWJZV1VD+hq2kY39ch/aO5ieSZxeSAgMs3NZmdO3d
+Z//BYY1jTw+bbRcwJu+r0h8QoPnFfxZpgQNH7R5ojXKhTbImxrpsX23Wr9GxE46p
+rfNeaXUmGD5BKyF/7otdBwadQ8QpCiv8Kj6GyzyDOvnJDdrFmeK8eEEzduG/L13l
+pJhQDBX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ikL40Rc4ZW2aZCaFG+XroHPaO+Zmr615+F/+PoTRxZMzG0IQOeL
+eG9QgkRQP2YGiqtDhFZKDyAthg710tvSeopLzaXoTvFeJiUBWSOgftL2fiFX1ye8
+FVdMpEbB4IMeDExNH08GGeL5qPQ6gqGyeUN51q1veieQA6TqJIc/2b3Z6fJfUEkc
+7uzXLjAuMAoGCCsGAQUFBwMBDCBTdGFhdCBkZXIgTmVkZXJsYW5kZW4gRVYgUm9v
+dCBDQQ==
+-----END TRUSTED CERTIFICATE-----
diff --git a/tests/res/certs/034868d6.0 b/tests/res/certs/034868d6.0
new file mode 100644 (file)
index 0000000..2cd5791
--- /dev/null
@@ -0,0 +1,39 @@
+# alias=Swisscom Root EV CA 2
+# trust=CKA_TRUST_CODE_SIGNING CKA_TRUST_SERVER_AUTH
+# distrust=
+# openssl-trust=codeSigning serverAuth
+-----BEGIN TRUSTED CERTIFICATE-----
+MIIF4DCCA8igAwIBAgIRAPL6ZOJ0Y9ON/RAdBB92ylgwDQYJKoZIhvcNAQELBQAw
+ZzELMAkGA1UEBhMCY2gxETAPBgNVBAoTCFN3aXNzY29tMSUwIwYDVQQLExxEaWdp
+dGFsIENlcnRpZmljYXRlIFNlcnZpY2VzMR4wHAYDVQQDExVTd2lzc2NvbSBSb290
+IEVWIENBIDIwHhcNMTEwNjI0MDk0NTA4WhcNMzEwNjI1MDg0NTA4WjBnMQswCQYD
+VQQGEwJjaDERMA8GA1UEChMIU3dpc3Njb20xJTAjBgNVBAsTHERpZ2l0YWwgQ2Vy
+dGlmaWNhdGUgU2VydmljZXMxHjAcBgNVBAMTFVN3aXNzY29tIFJvb3QgRVYgQ0Eg
+MjCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMT3HS9X6lds93BdY7Bx
+UglgRCgzo3pOCvrY6myLURYaVa5UJsTMRQdBTxB5f3HSek4/OE6zAMaVylvNwSqD
+1ycfMQ4jFrclyxy0uYAyXhqdk/HoPGAsp15XGVhRXrwsVgu42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lEvoqq9X46Lmgxk7lq2prg2+kupYTNHAq4Sgj5nPFhJpiTt3tm
+7JFe3VE/23MPrQRYCd0EApUKPtN236YQHoA96M2kZNEzx5LH4k5E4wnJTsJdhw4S
+nr8PyQUQ3nqjsTzyP6WqJ3mtMX0f/fwZacXduT98zca0wjAefm6S139hdlqP65VN
+vBFuIXxZN5nQBrz5Bm0yFqXZaajh3DyAHmBR3NdUIR7KYndP+tiPsys6DXhyyWhB
+WkdKwqPrGtcKqzwyVcgKEZzfdNbwQBUdyLmPtTbFr/giuMod89a2GQ+fYWVq6nTI
+fI/DT11lgh/ZDYnadXL77/FHZxOzyNEZiCcmmpl5fx7kLD977vHeTYuWl8PVP3wb
+I+2ksx0WckNLIOFZfsLorSa/ovcwLTAUBggrBgEFBQcDAwYIKwYBBQUHAwEMFVN3
+aXNzY29tIFJvb3QgRVYgQ0EgMg==
+-----END TRUSTED CERTIFICATE-----
diff --git a/tests/res/certs/062cdee6.0 b/tests/res/certs/062cdee6.0
new file mode 100644 (file)
index 0000000..43be67d
--- /dev/null
@@ -0,0 +1,26 @@
+# alias=GlobalSign Root CA - R3
+# trust=CKA_TRUST_CODE_SIGNING CKA_TRUST_EMAIL_PROTECTION CKA_TRUST_SERVER_AUTH
+# distrust=
+# openssl-trust=codeSigning emailProtection serverAuth
+-----BEGIN TRUSTED CERTIFICATE-----
+MIIDXzCCAkegAwIBAgILBAAAAAABIVhTCKIwDQYJKoZIhvcNAQELBQAwTDEgMB4G
+A1UECxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjMxEzARBgNVBAoTCkdsb2JhbFNp
+Z24xEzARBgNVBAMTCkdsb2JhbFNpZ24wHhcNMDkwMzE4MTAwMDAwWhcNMjkwMzE4
+MTAwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMzETMBEG
+A1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjCCASIwDQYJKoZI
+hvcNAQEBBQADggEPADCCAQoCggEBAMwldpB5BngiFvXAg7aEyiie/QV2EcWtiHL8
+RgJDx7KKnQRfJMsuS+FggkbhUqsMgUdwbN1k0ev1LKMPgj0MK66X17YUhhB5uzsT
+gHeMCOFJ0mpiLx9e+pZo34knlTifBtc+ycsmWQ1z3rDI6SYOgxXG71uL0gRgykmm
+KPZpO/bLyCiR5Z2KYVc3rHQU3HTgOu5yLy6c+9C7v/U9AOEGM+iCK65TpjoWc4zd
+QQ4gOsC0p6Hpsk+QLjJg6VfLuQSSaGjlOCZgdbKfd/+RFO+uIEn8rUAVSNECMWEZ
+XriX7613t2Saer9fwRPvm2L7DWzgVGkWqQPabumDk3F2xmmFghcCAwEAAaNCMEAw
+DgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFI/wS3+o
+LkUkrk1Q+mOai97i3Ru8MA0GCSqGSIb3DQEBCwUAA4IBAQBLQNvAUKr+yAzv95ZU
+RUm7lgAJQayzE4aGKAczymvmdLm6AC2upArT9fHxD4q/c2dKg8dEe3jgr25sbwMp
+jjM5RcOO5LlXbKr8EpbsU8Yt5CRsuZRj+9xTaGdWPoO4zzUhw8lo/s7awlOqzJCK
+6fBdRoyV3XpYKBovHd7NADdBj+1EbddTKJd+82cEHhXXipa0095MJ6RMG3NzdvQX
+mcIfeg7jLQitChws/zyrVQ4PkX4268NXSb7hLi18YIvDQVETI53O9zJrlAGomecs
+Mx86OyXShkDOOyyGeMlhLxS67ttVb9+E7gUJTb0o2HLO02JQZR7rkpeDMdmztcpH
+WD9fMDkwHgYIKwYBBQUHAwMGCCsGAQUFBwMEBggrBgEFBQcDAQwXR2xvYmFsU2ln
+biBSb290IENBIC0gUjM=
+-----END TRUSTED CERTIFICATE-----
diff --git a/tests/res/certs/064e0aa9.0 b/tests/res/certs/064e0aa9.0
new file mode 100644 (file)
index 0000000..e247755
--- /dev/null
@@ -0,0 +1,36 @@
+# alias=QuoVadis Root CA 2 G3
+# trust=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gbjh9Uy3l
+7ZizlWNof/k19N+IxWA1ksB8aRxhlRbQ694Lrz4EEEVlWFA4r0jyWbYW8jwNkALG
+cC4BrTwV1wIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIB
+BjAdBgNVHQ4EFgQU7edvdlq/YOxJW8ald7tyFnGbxD0wDQYJKoZIhvcNAQELBQAD
+ggIBAJHfgD9DCX5xwvfrs4iP4VGyvD11+ShdyLyZm3tdquXK4Qr36LLTn91nMX66
+AarHakE7kNQIXLJgapDwyM4DYvmL7ftuKtwGTTwpD4kWilhMSA/ohGHqPHKmd+RC
+roijQ1h5fq7KpVMNqT1wvSAZYaRsOPxDMuHBR//47PERIjKWnML2W2mWeyAMQ0Ga
+W/ZZGYjeVYg3UQt4XAoeo0L9x52ID8DyeAIkVJOviYeIyUqAHerQbj5hLja7NQ4n
+lv1mNDthcnPxFlxHBlRJAHpYErAK74X9sbgzdWqTHBLmYF5vHX/JHyPLhGGfHoJE
++V+tYlUkmlKY7VHnoX6XOuYvHxHaU4AshZ6rNRDbIl9qxV6XU/IyAgkwo1jwDQHV
+csaxfGl7w/U2Rcxhbl5MlMVerugOXou/983g7aEOGzPuVBj+D77vfoRrQ+NwmNtd
+dbINWQeFFSM51vHfqSYP1kjHs6Yi9TM3WpVHn3u6GBVv/9YUZINJ0gpnIdsPNWNg
+KCLjsZWDzYWm3S8P52dSbrsvhXz1SnPnxT7AvSESBT/8twNJAlvIJebiVDj1eYeM
+HVOyToV7BjjHLPj4sHKNJeV3UvQDHEimUF+IIDBu8oJDqz2XhOdT+yHBTw8imoa4
+WSr2Rz0ZiC3oheGe7IUIarFsNMkd7EgrO3jtZsSOeWmD3n+MMC0wFAYIKwYBBQUH
+AwMGCCsGAQUFBwMBDBVRdW9WYWRpcyBSb290IENBIDIgRzM=
+-----END TRUSTED CERTIFICATE-----
diff --git a/tests/res/certs/080911ac.0 b/tests/res/certs/080911ac.0
new file mode 100644 (file)
index 0000000..d1ccc64
--- /dev/null
@@ -0,0 +1,39 @@
+# alias=QuoVadis Root CA
+# trust=CKA_TRUST_CODE_SIGNING CKA_TRUST_EMAIL_PROTECTION CKA_TRUST_SERVER_AUTH
+# distrust=
+# openssl-trust=codeSigning emailProtection serverAuth
+-----BEGIN TRUSTED CERTIFICATE-----
+MIIF0DCCBLigAwIBAgIEOrZQizANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJC
+TTEZMBcGA1UEChMQUXVvVmFkaXMgTGltaXRlZDElMCMGA1UECxMcUm9vdCBDZXJ0
+aWZpY2F0aW9uIEF1dGhvcml0eTEuMCwGA1UEAxMlUXVvVmFkaXMgUm9vdCBDZXJ0
+aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wMTAzMTkxODMzMzNaFw0yMTAzMTcxODMz
+MzNaMH8xCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMSUw
+IwYDVQQLExxSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MS4wLAYDVQQDEyVR
+dW9WYWRpcyBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG
+9w0BAQEFAAOCAQ8AMIIBCgKCAQEAv2G1lVO6V/z68mcLOhrfEYBklbTRvM16z/Yp
+li4kVEAkOPcahdxYTMukJ0KX0J+DisPkBgNbAKVRHnAEdOLB1Dqr1607BxgFjv2D
+rOpm2RgbaIr1VxqYuvXtdj182d6UajtLF8HVj71lODqV0D1VNk7feVcxKh7YWWVJ
+WCCYfqtffp/p1k3sg3Spx2zY7ilKhSoGFPlU5tPaZQeLYzcS19Dsw3sgQUSj7cug
+F+FxZc4dZjH3dgEZyH0DWLaVSR2mEiboxgx24ONmy+pdpibu5cxfvWenAScOospU
+xbF6lR1xHkopigPcakXBpBlebzbNw6Kwt/5cOOJSvPhEQ+aQuwIDAQABo4ICUjCC
+Ak4wPQYIKwYBBQUHAQEEMTAvMC0GCCsGAQUFBzABhiFodHR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IY6iHOsfHmhIHluqmGKPJDWl0Snawe2ajlCmqnf6CHKc/yiU3U7MXi5nrQNiOK
+SnQ2+TAyMB4GCCsGAQUFBwMDBggrBgEFBQcDBAYIKwYBBQUHAwEMEFF1b1ZhZGlz
+IFJvb3QgQ0E=
+-----END TRUSTED CERTIFICATE-----
diff --git a/tests/res/certs/0810ba98.0 b/tests/res/certs/0810ba98.0
new file mode 100644 (file)
index 0000000..b84050e
--- /dev/null
@@ -0,0 +1,43 @@
+# alias=Root CA Generalitat Valenciana
+# trust=CKA_TRUST_CODE_SIGNING CKA_TRUST_EMAIL_PROTECTION CKA_TRUST_SERVER_AUTH
+# distrust=
+# openssl-trust=codeSigning emailProtection serverAuth
+-----BEGIN TRUSTED CERTIFICATE-----
+MIIGizCCBXOgAwIBAgIEO0XlaDANBgkqhkiG9w0BAQUFADBoMQswCQYDVQQGEwJF
+UzEfMB0GA1UEChMWR2VuZXJhbGl0YXQgVmFsZW5jaWFuYTEPMA0GA1UECxMGUEtJ
+R1ZBMScwJQYDVQQDEx5Sb290IENBIEdlbmVyYWxpdGF0IFZhbGVuY2lhbmEwHhcN
+MDEwNzA2MTYyMjQ3WhcNMjEwNzAxMTUyMjQ3WjBoMQswCQYDVQQGEwJFUzEfMB0G
+A1UEChMWR2VuZXJhbGl0YXQgVmFsZW5jaWFuYTEPMA0GA1UECxMGUEtJR1ZBMScw
+JQYDVQQDEx5Sb290IENBIEdlbmVyYWxpdGF0IFZhbGVuY2lhbmEwggEiMA0GCSqG
+SIb3DQEBAQUAA4IBDwAwggEKAoIBAQDGKqtXETcvIorKA3Qdyu0togu8M1JAJke+
+WmmmO3I2F0zo37i7L3bhQEZ0ZQKQUgi0/6iMweDHiVYQOTPvaLRfX9ptI6GJXiKj
+SgbwJ/BXufjpTjJ3Cj9BZPPrZe52/lSqfR0grvPXdMIKX/UIKFIIzFVd0g/bmoGl
+u6GzwZTNVOAydTGRGmKy3nXiz0+J2ZGQD0EbtFpKd71ng+CT516nDOeB0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NVHSMEgY0wgYqAFHs100DSHHgZZu90ECjcPk+yeAT8oWykajBoMQsw
+CQYDVQQGEwJFUzEfMB0GA1UEChMWR2VuZXJhbGl0YXQgVmFsZW5jaWFuYTEPMA0G
+A1UECxMGUEtJR1ZBMScwJQYDVQQDEx5Sb290IENBIEdlbmVyYWxpdGF0IFZhbGVu
+Y2lhbmGCBDtF5WgwDQYJKoZIhvcNAQEFBQADggEBACRhTvW1yEICKrNcda3Fbcrn
+lD+laJWIwVTAEGmiEi8YPyVQqHxK6sYJ2fR1xkDar1CdPaUWu20xxsdzCkj+IHLt
+b8zog2EWRpABlUt9jppSCS/2bxzkoXHPjCpaF3ODR00PNvsETUlR4hTJZGH71BTg
+9J63NI8KJr2XXPR5OkowGcytT6CYirQxlyric21+eLj4iIlPsSKRZEv1UN4D2+XF
+ducTZnV+ZfsBn5OHiJ35Rld8TWCvmHMTI6QgkYH60GFmuH3Rr9ZvHmw96RH9qfmC
+IoaZM3Fa6hlXPZHNqcCjbgcTpsnt+GijnsNacgmHKNHEc8RzGF9QdRYxn7fofMMw
+QDAeBggrBgEFBQcDAwYIKwYBBQUHAwQGCCsGAQUFBwMBDB5Sb290IENBIEdlbmVy
+YWxpdGF0IFZhbGVuY2lhbmE=
+-----END TRUSTED CERTIFICATE-----
diff --git a/tests/res/certs/09789157.0 b/tests/res/certs/09789157.0
new file mode 100644 (file)
index 0000000..9afcf40
--- /dev/null
@@ -0,0 +1,29 @@
+# alias=Starfield Services Root Certificate Authority - G2
+# trust=CKA_TRUST_CODE_SIGNING CKA_TRUST_SERVER_AUTH
+# distrust=
+# openssl-trust=codeSigning serverAuth
+-----BEGIN TRUSTED CERTIFICATE-----
+MIID7zCCAtegAwIBAgIBADANBgkqhkiG9w0BAQsFADCBmDELMAkGA1UEBhMCVVMx
+EDAOBgNVBAgTB0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxJTAjBgNVBAoT
+HFN0YXJmaWVsZCBUZWNobm9sb2dpZXMsIElu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Uz8jcI73HPdwbeyBkd
+iEDPfUYd/x7H4c7/I9vG+o1VTqkC50cRRj70/b17KSa7qWFiNyi2LSr2EIZkyXCn
+0q23KXB56jzaYyWf/Wi3MOxw+3WKt21gZ7IeyLnp2KhvAotnDU0mV3HaIPzBSlCN
+sSi6MEowFAYIKwYBBQUHAwMGCCsGAQUFBwMBDDJTdGFyZmllbGQgU2VydmljZXMg
+Um9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkgLSBHMg==
+-----END TRUSTED CERTIFICATE-----
diff --git a/tests/res/certs/0b1b94ef.0 b/tests/res/certs/0b1b94ef.0
new file mode 100644 (file)
index 0000000..41c4c8a
--- /dev/null
@@ -0,0 +1,37 @@
+# alias=CFCA EV ROOT
+# trust=CKA_TRUST_SERVER_AUTH
+# distrust=
+# openssl-trust=serverAuth
+-----BEGIN TRUSTED CERTIFICATE-----
+MIIFjTCCA3WgAwIBAgIEGErM1jANBgkqhkiG9w0BAQsFADBWMQswCQYDVQQGEwJD
+TjEwMC4GA1UECgwnQ2hpbmEgRmluYW5jaWFsIENlcnRpZmljYXRpb24gQXV0aG9y
+aXR5MRUwEwYDVQQDDAxDRkNBIEVWIFJPT1QwHhcNMTIwODA4MDMwNzAxWhcNMjkx
+MjMxMDMwNzAxWjBWMQswCQYDVQQGEwJDTjEwMC4GA1UECgwnQ2hpbmEgRmluYW5j
+aWFsIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MRUwEwYDVQQDDAxDRkNBIEVWIFJP
+T1QwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDXXWvNED8fBVnVBU03
+sQ7smCuOFR36k0sXgiFxEFLXUWRwFsJVaU2OFW2fvwwbwuCjZ9YMrM8irq93VCpL
+TIpTUnrD7i7es3ElweldPe6hL6P3KjzJIx1qqx2hp/Hz7KDVRM8Vz3IvHWOX6Jn5
+/ZOkVIBMUtRSqy5J35DNuF++P96hyk0g1CXohClTt7GIH//62pCfCqktQT+x8Rgp
+7h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Xr9tgFa+iiS6M+qf4TIRnvHST4D2G0CvOJ4RUHlzEhLN
+5mydLIhyPDCBBpEi6lmt2hkuIsKNuYyH4Ga8cyNfIWRjgEj1oDwYPZTISEEdQLpe
+/v5WOaHIz16eGWRGENoXkbcFgKyLmZJ956LYBws2J+dIeWCKw9cTXPhyQN9Ky8+Z
+AAoACxGV2lZFA4gKn2fQ1XmxqI1AbQ3CekD6819kR5LLU7m7Wc5P/dAVUwHY3+vZ
+5nbv0CO7O6l5s9UCKc2Jo5YPSjXnTkLAdc0Hz+Ys63suMBowCgYIKwYBBQUHAwEM
+DENGQ0EgRVYgUk9PVA==
+-----END TRUSTED CERTIFICATE-----
diff --git a/tests/res/certs/0c4c9b6c.0 b/tests/res/certs/0c4c9b6c.0
new file mode 100644 (file)
index 0000000..f009e26
--- /dev/null
@@ -0,0 +1,47 @@
+# alias=Global Chambersign Root - 2008
+# trust=CKA_TRUST_CODE_SIGNING CKA_TRUST_EMAIL_PROTECTION CKA_TRUST_SERVER_AUTH
+# distrust=
+# openssl-trust=codeSigning emailProtection serverAuth
+-----BEGIN TRUSTED CERTIFICATE-----
+MIIHSTCCBTGgAwIBAgIJAMnN0+nVfSPOMA0GCSqGSIb3DQEBBQUAMIGsMQswCQYD
+VQQGEwJFVTFDMEEGA1UEBxM6TWFkcmlkIChzZWUgY3VycmVudCBhZGRyZXNzIGF0
+IHd3dy5jYW1lcmZpcm1hLmNvbS9hZGRyZXNzKTESMBAGA1UEBRMJQTgyNzQzMjg3
+MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMuQS4xJzAlBgNVBAMTHkdsb2JhbCBD
+aGFtYmVyc2lnbiBSb290IC0gMjAwODAeFw0wODA4MDExMjMxNDBaFw0zODA3MzEx
+MjMxNDBaMIGsMQswCQYDVQQGEwJFVTFDMEEGA1UEBxM6TWFkcmlkIChzZWUgY3Vy
+cmVudCBhZGRyZXNzIGF0IHd3dy5jYW1lcmZpcm1hLmNvbS9hZGRyZXNzKTESMBA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MEBggrBgEFBQcDAQweR2xvYmFsIENoYW1iZXJz
+aWduIFJvb3QgLSAyMDA4
+-----END TRUSTED CERTIFICATE-----
diff --git a/tests/res/certs/0d1b923b.0 b/tests/res/certs/0d1b923b.0
new file mode 100644 (file)
index 0000000..89cdef2
--- /dev/null
@@ -0,0 +1,32 @@
+# alias=S-TRUST Authentication and Encryption Root CA 2005 PN
+# trust=CKA_TRUST_EMAIL_PROTECTION
+# distrust=
+# openssl-trust=emailProtection
+-----BEGIN TRUSTED CERTIFICATE-----
+MIIEezCCA2OgAwIBAgIQNxkY5lNUfBq1uMtZWts1tzANBgkqhkiG9w0BAQUFADCB
+rjELMAkGA1UEBhMCREUxIDAeBgNVBAgTF0JhZGVuLVd1ZXJ0dGVtYmVyZyAoQlcp
+MRIwEAYDVQQHEwlTdHV0dGdhcnQxKTAnBgNVBAoTIERldXRzY2hlciBTcGFya2Fz
+c2VuIFZlcmxhZyBHbWJIMT4wPAYDVQQDEzVTLVRSVVNUIEF1dGhlbnRpY2F0aW9u
+IGFuZCBFbmNyeXB0aW9uIFJvb3QgQ0EgMjAwNTpQTjAeFw0wNTA2MjIwMDAwMDBa
+Fw0zMDA2MjEyMzU5NTlaMIGuMQswCQYDVQQGEwJERTEgMB4GA1UECBMXQmFkZW4t
+V3VlcnR0ZW1iZXJnIChCVykxEjAQBgNVBAcTCVN0dXR0Z2FydDEpMCcGA1UEChMg
+RGV1dHNjaGVyIFNwYXJrYXNzZW4gVmVybGFnIEdtYkgxPjA8BgNVBAMTNVMtVFJV
+U1QgQXV0aGVudGljYXRpb24gYW5kIEVuY3J5cHRpb24gUm9vdCBDQSAyMDA1OlBO
+MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2bVKwdMz6tNGs9HiTNL1
+toPQb9UY6ZOvJ44TzbUlNlA0EmQpoVXhOmCTnijJ4/Ob4QSwI7+Vio5bG0F/WsPo
+TUzVJBY+h0jUJ67m91MduwwA7z5hca2/OnpYH5Q9XIHV1W/fuJvS9eXLg3KSwlOy
+ggLrra1fFi2SU3bxibYs9cEv4KdKb6AwajLrmnQDaHgTncovmwsdvs91DSaXm8f1
+XgqfeN+zvOyauu9VjxuapgdjKRdZYgkqeQd3peDRF2npW932kKvimAoA0SVtnteF
+hy+S8dF2g08LOlk3KC8zpxdQ1iALCvQm+Z845y2kuJuJja2tyWp9iRe79n+Ag3rm
+7QIDAQABo4GSMIGPMBIGA1UdEwEB/wQIMAYBAf8CAQAwDgYDVR0PAQH/BAQDAgEG
+MCkGA1UdEQQiMCCkHjAcMRowGAYDVQQDExFTVFJvbmxpbmUxLTIwNDgtNTAdBgNV
+HQ4EFgQUD8oeXHngovMpttKFswtKtWXsa1IwHwYDVR0jBBgwFoAUD8oeXHngovMp
+ttKFswtKtWXsa1IwDQYJKoZIhvcNAQEFBQADggEBAK8B8O0ZPCjoTVy7pWMciDMD
+pwCHpB8gq9Yc4wYfl35UvbfRssnV2oDsF9eK9XvCAPbpEW+EoFolMeKJ+aQAPzFo
+LtU96G7m1R08P7K9n3frndOMusDXtk3sU5wPBG7qNWdX4wple5A64U8+wwCSersF
+iXOMy6ZNwPv2AtawB6MDwidAnwzkhYItr5pCHdDHjfhA7p0GVxzZotiAFP7hYy0y
+h9WUUpY6RsZxlj33mA6ykaqP2vROJAA5VeitF7nTNCtKqUDMFypVZUF0Qn71wK/I
+k63yGFs9iQzbRzkk+OBM8h+wPQrKBU6JIRrjKpms/H+h8Q8bHz2eBIPdltkdOpQw
+QzAKBggrBgEFBQcDBAw1Uy1UUlVTVCBBdXRoZW50aWNhdGlvbiBhbmQgRW5jcnlw
+dGlvbiBSb290IENBIDIwMDUgUE4=
+-----END TRUSTED CERTIFICATE-----
diff --git a/tests/script/CMakeLists.txt b/tests/script/CMakeLists.txt
new file mode 100644 (file)
index 0000000..2b763c6
--- /dev/null
@@ -0,0 +1,28 @@
+#  Copyright (c) 2017 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      Sangwan Kwon (sangwan.kwon@samsung.com)
+#
+
+CONFIGURE_FILE(pre-test.sh.in pre-test.sh @ONLY)
+INSTALL(FILES pre-test.sh
+               DESTINATION ${TANCHOR_TEST}/script
+               PERMISSIONS OWNER_READ
+                                       OWNER_WRITE
+                                       OWNER_EXECUTE
+                                       GROUP_READ
+                                       GROUP_EXECUTE
+                                       WORLD_READ
+                                       WORLD_EXECUTE)
diff --git a/tests/script/pre-test.sh.in b/tests/script/pre-test.sh.in
new file mode 100755 (executable)
index 0000000..e77e52b
--- /dev/null
@@ -0,0 +1,36 @@
+#!/bin/bash
+PATH=/bin:/usr/bin:/sbin:/usr/sbin
+
+#  Copyright (c) 2017 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        pre-test.sh.in
+# @author      Sangwan Kwon (sangwan.kwon@samsung.com)
+# @brief       Set permission script for test
+#
+
+CLAUNCHER=@BIN_INSTALL_DIR@/@TARGET_TANCHOR_TEST@-capi-launcher
+CPPLAUNCHER=@BIN_INSTALL_DIR@/@TARGET_TANCHOR_TEST@-launcher
+
+# change owner to system
+chown @USER_NAME@:@GROUP_NAME@ $CLAUNCHER
+chown @USER_NAME@:@GROUP_NAME@ $CPPLAUNCHER
+
+# run test program as owner
+chmod 4755 $CLAUNCHER
+chmod 4755 $CPPLAUNCHER
+
+# launch() needs CAP_SYS_ADMIN
+setcap cap_sys_admin+ep $CLAUNCHER
+setcap cap_sys_admin+ep $CPPLAUNCHER
diff --git a/tests/test-capi-installer.cpp b/tests/test-capi-installer.cpp
new file mode 100644 (file)
index 0000000..ac668e7
--- /dev/null
@@ -0,0 +1,105 @@
+/*
+ *  Copyright (c) 2017 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        test-capi-installer.cpp
+ * @author      Sangwan Kwon (sangwan.kwon@samsung.com)
+ * @version     0.1
+ * @brief       Unit test program of Trust Anchor CAPI for installer
+ */
+
+#include <tanchor/trust-anchor.h>
+
+#include <klay/testbench.h>
+
+#include "test-resource.hxx"
+
+TESTCASE(CAPI_TRUST_ANCHOR_INSTALL_GLOBAL_APP_POSITIVE)
+{
+       int ret = trust_anchor_global_install(DUMMY_PKG_ID, APP_CERTS_DIR, false);
+       TEST_EXPECT(true, ret == 0);
+}
+
+TESTCASE(CAPI_TRUST_ANCHOR_INSTALL_GLOBAL_APP_WITH_SYS_POSITIVE)
+{
+       int ret = trust_anchor_global_install(DUMMY_PKG_ID, APP_CERTS_DIR, true);
+       TEST_EXPECT(true, ret == 0);
+}
+
+TESTCASE(CAPI_TRUST_ANCHOR_INSTALL_USER_APP_POSITIVE)
+{
+       int ret = trust_anchor_usr_install(DUMMY_PKG_ID, APP_CERTS_DIR, DUMMY_UID, false);
+       TEST_EXPECT(true, ret == 0);
+}
+
+TESTCASE(CAPI_TRUST_ANCHOR_INSTALL_USER_APP_WITH_SYS_POSITIVE)
+{
+       int ret = trust_anchor_usr_install(DUMMY_PKG_ID, APP_CERTS_DIR, DUMMY_UID, true);
+       TEST_EXPECT(true, ret == 0);
+}
+
+TESTCASE(CAPI_TRUST_ANCHOR_INSTALL_GLOBAL_APP_NEGATIVE)
+{
+       int ret = trust_anchor_global_install(DUMMY_PKG_ID, DUMMY_CERTS_DIR, false);
+       TEST_EXPECT(false, ret == 0);
+}
+
+TESTCASE(CAPI_TRUST_ANCHOR_INSTALL_GLOBAL_APP_WITH_SYS_NEGATIVE)
+{
+       int ret = trust_anchor_global_install(DUMMY_PKG_ID, DUMMY_CERTS_DIR, true);
+       TEST_EXPECT(false, ret == 0);
+}
+
+TESTCASE(CAPI_TRUST_ANCHOR_INSTALL_USER_APP_NEGATIVE)
+{
+       int ret = trust_anchor_usr_install(DUMMY_PKG_ID, DUMMY_CERTS_DIR, DUMMY_UID, false);
+       TEST_EXPECT(false, ret == 0);
+}
+
+TESTCASE(CAPI_TRUST_ANCHOR_INSTALL_USER_APP_WITH_SYS_NEGATIVE)
+{
+       int ret = trust_anchor_usr_install(DUMMY_PKG_ID, DUMMY_CERTS_DIR, DUMMY_UID, true);
+       TEST_EXPECT(false, ret == 0);
+}
+
+TESTCASE(CAPI_TRUST_ANCHOR_UNINSTALL_GLOBAL_APP_POSITIVE)
+{
+       int ret = trust_anchor_global_install(DUMMY_PKG_ID, APP_CERTS_DIR, false);
+       TEST_EXPECT(true, ret == 0);
+
+       ret = trust_anchor_global_uninstall(DUMMY_PKG_ID, APP_CERTS_DIR);
+       TEST_EXPECT(true, ret == 0);
+}
+
+TESTCASE(CAPI_TRUST_ANCHOR_UNINSTALL_USER_APP_POSITIVE)
+{
+       int ret = trust_anchor_usr_install(DUMMY_PKG_ID, APP_CERTS_DIR, DUMMY_UID, false);
+       TEST_EXPECT(true, ret == 0);
+
+       ret = trust_anchor_usr_uninstall(DUMMY_PKG_ID, APP_CERTS_DIR, DUMMY_UID);
+       TEST_EXPECT(true, ret == 0);
+}
+
+TESTCASE(CAPI_TRUST_ANCHOR_UNINSTALL_GLOBAL_APP_NEGATIVE)
+{
+       int ret = trust_anchor_global_uninstall(DUMMY_PKG_ID, DUMMY_CERTS_DIR);
+       TEST_EXPECT(false, ret == 0);
+}
+
+TESTCASE(CAPI_TRUST_ANCHOR_UNINSTALL_USER_APP_NEGATIVE)
+{
+       int ret = trust_anchor_usr_uninstall(DUMMY_PKG_ID, DUMMY_CERTS_DIR, DUMMY_UID);
+       TEST_EXPECT(false, ret == 0);
+}
diff --git a/tests/test-capi-launcher.cpp b/tests/test-capi-launcher.cpp
new file mode 100644 (file)
index 0000000..0457db7
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ *  Copyright (c) 2017 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        test-capi-launcher.cpp
+ * @author      Sangwan Kwon (sangwan.kwon@samsung.com)
+ * @version     0.1
+ * @brief       Unit test program of Trust Anchor CAPI for launcher
+ */
+
+#include <tanchor/trust-anchor.h>
+
+#include <klay/testbench.h>
+
+#include <unistd.h>
+
+#include "test-util.hxx"
+#include "test-resource.hxx"
+
+// Launch needs CAP_SYS_ADMIN
+TESTCASE(CAPI_TRUST_ANCHOR_LAUNCH)
+{
+       auto beforeLs = test::util::ls(TZ_SYS_RO_CA_CERTS);
+       auto beforeCat = test::util::cat(TZ_SYS_RO_CA_BUNDLE);
+
+       int ret = trust_anchor_global_install(DUMMY_PKG_ID, APP_CERTS_DIR, true);
+
+       // pre-condition
+       int pid = fork();
+
+       if (pid == 0) {
+               ret = trust_anchor_global_launch(DUMMY_PKG_ID, APP_CERTS_DIR, true);
+               TEST_EXPECT(true, ret == 0);
+
+               auto afterLsChild = test::util::ls(TZ_SYS_RO_CA_CERTS);
+               TEST_EXPECT(true, beforeLs != afterLsChild);
+
+               auto afterCatChild = test::util::cat(TZ_SYS_RO_CA_BUNDLE);
+               TEST_EXPECT(true, beforeCat != afterCatChild);
+       } else {
+               auto afterLsParent = test::util::ls(TZ_SYS_RO_CA_CERTS);
+               TEST_EXPECT(true, beforeLs == afterLsParent);
+
+               auto afterCatParent = test::util::cat(TZ_SYS_RO_CA_BUNDLE);
+               TEST_EXPECT(true, beforeCat == afterCatParent);
+       }
+}
diff --git a/tests/test-certificate.cpp b/tests/test-certificate.cpp
new file mode 100644 (file)
index 0000000..77d7897
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ *  Copyright (c) 2017 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        test-certificate.cpp
+ * @author      Sangwan Kwon (sangwan.kwon@samsung.com)
+ * @version     0.1
+ * @brief       Unit test program of Certificate
+ */
+
+#include <klay/testbench.h>
+
+#include <iostream>
+#include <stdexcept>
+
+#include "certificate.hxx"
+#include "test-resource.hxx"
+
+TESTCASE(GET_SUBJECT_NAME_HASH)
+{
+       try {
+               tanchor::Certificate certificate(TEST_PEM_PATH);
+               auto hash = certificate.getSubjectNameHash();
+               TEST_EXPECT(true, hash.compare(TEST_PEM_HASH) == 0);
+       } catch (const std::exception &e) {
+               std::cout << "std::exception occured." << e.what() << std::endl;
+       } catch (...) {
+               std::cout << "Unknown exception occured." << std::endl;
+       }
+}
+
+TESTCASE(GET_CERTIFICATE_DATA)
+{
+       try {
+               tanchor::Certificate certificate(TEST_PEM_PATH);
+               auto data = certificate.getCertificateData();
+               TEST_EXPECT(true, data.compare(TEST_PEM_DATA) == 0);
+       } catch (const std::exception &e) {
+               std::cout << "std::exception occured." << e.what() << std::endl;
+       } catch (...) {
+               std::cout << "Unknown exception occured." << std::endl;
+       }
+}
diff --git a/tests/test-installer.cpp b/tests/test-installer.cpp
new file mode 100644 (file)
index 0000000..7ee71d3
--- /dev/null
@@ -0,0 +1,122 @@
+/*
+ *  Copyright (c) 2017 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        test-installer.cpp
+ * @author      Sangwan Kwon (sangwan.kwon@samsung.com)
+ * @version     0.1
+ * @brief       Unit test program of Trust Anchor for installer
+ */
+
+#include <tanchor/trust-anchor.hxx>
+
+#include <klay/testbench.h>
+
+#include <sched.h>
+#include <unistd.h>
+
+#include <iostream>
+
+#include "test-resource.hxx"
+
+TESTCASE(TRUST_ANCHOR_INSTALL_GLOBAL_APP_POSITIVE)
+{
+       tanchor::TrustAnchor ta(DUMMY_PKG_ID, APP_CERTS_DIR);
+       int ret = ta.install(false);
+       TEST_EXPECT(true, ret == 0);
+}
+
+TESTCASE(TRUST_ANCHOR_INSTALL_GLOBAL_APP_WITH_SYS_POSITIVE)
+{
+       tanchor::TrustAnchor ta(DUMMY_PKG_ID, APP_CERTS_DIR);
+       int ret = ta.install(true);
+       TEST_EXPECT(true, ret == 0);
+}
+
+TESTCASE(TRUST_ANCHOR_INSTALL_USER_APP_POSITIVE)
+{
+       tanchor::TrustAnchor ta(DUMMY_PKG_ID, APP_CERTS_DIR, DUMMY_UID);
+       int ret = ta.install(false);
+       TEST_EXPECT(true, ret == 0);
+}
+
+TESTCASE(TRUST_ANCHOR_INSTALL_USER_APP_WITH_SYS_POSITIVE)
+{
+       tanchor::TrustAnchor ta(DUMMY_PKG_ID, APP_CERTS_DIR, DUMMY_UID);
+       int ret = ta.install(true);
+       TEST_EXPECT(true, ret == 0);
+}
+
+TESTCASE(TRUST_ANCHOR_INSTALL_GLOBAL_APP_NEGATIVE)
+{
+       tanchor::TrustAnchor ta(DUMMY_PKG_ID, DUMMY_CERTS_DIR);
+       int ret = ta.install(false);
+       TEST_EXPECT(false, ret == 0);
+}
+
+TESTCASE(TRUST_ANCHOR_INSTALL_GLOBAL_APP_WITH_SYS_NEGATIVE)
+{
+       tanchor::TrustAnchor ta(DUMMY_PKG_ID, DUMMY_CERTS_DIR);
+       int ret = ta.install(true);
+       TEST_EXPECT(false, ret == 0);
+}
+
+TESTCASE(TRUST_ANCHOR_INSTALL_USER_APP_NEGATIVE)
+{
+       tanchor::TrustAnchor ta(DUMMY_PKG_ID, DUMMY_CERTS_DIR, DUMMY_UID);
+       int ret = ta.install(false);
+       TEST_EXPECT(false, ret == 0);
+}
+
+TESTCASE(TRUST_ANCHOR_INSTALL_USER_APP_WITH_SYS_NEGATIVE)
+{
+       tanchor::TrustAnchor ta(DUMMY_PKG_ID, DUMMY_CERTS_DIR, DUMMY_UID);
+       int ret = ta.install(true);
+       TEST_EXPECT(false, ret == 0);
+}
+
+TESTCASE(TRUST_ANCHOR_UNINSTALL_GLOBAL_APP_POSITIVE)
+{
+       tanchor::TrustAnchor ta(DUMMY_PKG_ID, APP_CERTS_DIR);
+       int ret = ta.install(false);
+       TEST_EXPECT(true, ret == 0);
+
+       ret = ta.uninstall();
+       TEST_EXPECT(true, ret == 0);
+}
+
+TESTCASE(TRUST_ANCHOR_UNINSTALL_USER_APP_POSITIVE)
+{
+       tanchor::TrustAnchor ta(DUMMY_PKG_ID, APP_CERTS_DIR, DUMMY_UID);
+       int ret = ta.install(false);
+       TEST_EXPECT(true, ret == 0);
+
+       ret = ta.uninstall();
+       TEST_EXPECT(true, ret == 0);
+}
+
+TESTCASE(TRUST_ANCHOR_UNINSTALL_GLOBAL_APP_NEGATIVE)
+{
+       tanchor::TrustAnchor ta(DUMMY_PKG_ID, DUMMY_CERTS_DIR);
+       int ret = ta.uninstall();
+       TEST_EXPECT(false, ret == 0);
+}
+
+TESTCASE(TRUST_ANCHOR_UNINSTALL_USER_APP_NEGATIVE)
+{
+       tanchor::TrustAnchor ta(DUMMY_PKG_ID, DUMMY_CERTS_DIR, DUMMY_UID);
+       int ret = ta.uninstall();
+       TEST_EXPECT(false, ret == 0);
+}
diff --git a/tests/test-launcher.cpp b/tests/test-launcher.cpp
new file mode 100644 (file)
index 0000000..0e2681c
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ *  Copyright (c) 2017 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        test-launcher.cpp
+ * @author      Sangwan Kwon (sangwan.kwon@samsung.com)
+ * @version     0.1
+ * @brief       Unit test program of Trust Anchor for launcher
+ */
+
+#include <tanchor/trust-anchor.hxx>
+
+#include <klay/testbench.h>
+
+#include <unistd.h>
+
+#include "test-util.hxx"
+#include "test-resource.hxx"
+
+// Launch needs CAP_SYS_ADMIN
+TESTCASE(TRUST_ANCHOR_LAUNCH)
+{
+       auto beforeLs = test::util::ls(TZ_SYS_RO_CA_CERTS);
+       auto beforeCat = test::util::cat(TZ_SYS_RO_CA_BUNDLE);
+
+       tanchor::TrustAnchor ta(DUMMY_PKG_ID, APP_CERTS_DIR);
+       int ret = ta.install(true);
+
+       // pre-condition
+       int pid = fork();
+
+       if (pid == 0) {
+               ret = ta.launch(true);
+               TEST_EXPECT(true, ret == 0);
+
+               auto afterLsChild = test::util::ls(TZ_SYS_RO_CA_CERTS);
+               TEST_EXPECT(true, beforeLs != afterLsChild);
+
+               auto afterCatChild = test::util::cat(TZ_SYS_RO_CA_BUNDLE);
+               TEST_EXPECT(true, beforeCat != afterCatChild);
+       } else {
+               auto afterLsParent = test::util::ls(TZ_SYS_RO_CA_CERTS);
+               TEST_EXPECT(true, beforeLs == afterLsParent);
+
+               auto afterCatParent = test::util::cat(TZ_SYS_RO_CA_BUNDLE);
+               TEST_EXPECT(true, beforeCat == afterCatParent);
+       }
+}
diff --git a/tests/test-resource.hxx b/tests/test-resource.hxx
new file mode 100644 (file)
index 0000000..9deac85
--- /dev/null
@@ -0,0 +1,61 @@
+/*
+ *  Copyright (c) 2017 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        test-resource.hxx
+ * @author      Sangwan Kwon (sangwan.kwon@samsung.com)
+ * @version     0.1
+ * @brief       Test resoure name and paths
+ */
+#pragma once
+
+#define DUMMY_PKG_ID "dummmy-pkg-id"
+#define DUMMY_UID 5001
+#define DUMMY_CERTS_DIR "/home/dummy"
+
+#define APP_CERTS_DIR TANCHOR_TEST_DIR "/certs"
+
+#define TEST_PEM_PATH APP_CERTS_DIR "/02265526.0"
+#define TEST_PEM_HASH "02265526"
+
+#define TEST_PEM_DATA \
+       "-----BEGIN TRUSTED CERTIFICATE-----\n" \
+       "MIIEPjCCAyagAwIBAgIESlOMKDANBgkqhkiG9w0BAQsFADCBvjELMAkGA1UEBhMC\n" \
+       "VVMxFjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xKDAmBgNVBAsTH1NlZSB3d3cuZW50\n" \
+       "cnVzdC5uZXQvbGVnYWwtdGVybXMxOTA3BgNVBAsTMChjKSAyMDA5IEVudHJ1c3Qs\n" \
+       "IEluYy4gLSBmb3IgYXV0aG9yaXplZCB1c2Ugb25seTEyMDAGA1UEAxMpRW50cnVz\n" \
+       "dCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzIwHhcNMDkwNzA3MTcy\n" \
+       "NTU0WhcNMzAxMjA3MTc1NTU0WjCBvjELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUVu\n" \
+       "dHJ1c3QsIEluYy4xKDAmBgNVBAsTH1NlZSB3d3cuZW50cnVzdC5uZXQvbGVnYWwt\n" \
+       "dGVybXMxOTA3BgNVBAsTMChjKSAyMDA5IEVudHJ1c3QsIEluYy4gLSBmb3IgYXV0\n" \
+       "aG9yaXplZCB1c2Ugb25seTEyMDAGA1UEAxMpRW50cnVzdCBSb290IENlcnRpZmlj\n" \
+       "YXRpb24gQXV0aG9yaXR5IC0gRzIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK\n" \
+       "AoIBAQC6hLZy254Ma+KZ6TABp3bqMriVQRrJ2mFOWHLP/vaCeb9zYQYKpSfYs1/T\n" \
+       "RU4cctZOMvJyig/3gxnQaoCAAEUesMfnmr8SVycco2gvCoe9amsOXmXzHHfV1IWN\n" \
+       "cCG0szLni6LVhjkCsbjSR87kyUnEO6fe+1R9V77w6G7CebI6C1XiUJgWMhNcL3hW\n" \
+       "wcKUs/Ja5CeanyTXxuzQmyWC48zCxEXFjJd6BmsqEZ+pCm5IO2/b1BEZQvePB7/1\n" \
+       "U1+cPvQXLOZprE4yTGJ36rfo5bs0vBmLrpxR57d+tVOxMyLlbc9wPBr64ptntoP0\n" \
+       "jaWvYkxN4FisZDQSA/i2jZRjJKRxAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAP\n" \
+       "BgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRqciZ60B7vfec7aVHUbI2fkBJmqzAN\n" \
+       "BgkqhkiG9w0BAQsFAAOCAQEAeZ8dlsa2eT8ijYfThwMEYGprmi5ZiXMRrEPR9RP/\n" \
+       "jTkrwPK9T3CMqS/qF8QLVJ7UG5aYMzyorWKiAHarWWluBh1+xLlEjZivEtRh2woZ\n" \
+       "Rkfz6/djwUAFQKXSt/S1mja/qYh2iARVBCuch38aNzx+LaUa2NSJXsq9rD1s2G2v\n" \
+       "1fN2D807iDginWyTmsQ9v4IbZT+mD12q/OWyFcq1rca8PdCE6OoGcrBNOTJ4vz4R\n" \
+       "nAuknZoh8/CbCzB428Hch0P+vGOaysXCHMnHjf87ElgI5rY97HosTvuDls4MPGmH\n" \
+       "VHOkc8KT/1EQrBVUAdj8BbGJoX90g5pJ19xOe4pIb4tF9jBLMB4GCCsGAQUFBwMD\n" \
+       "BggrBgEFBQcDBAYIKwYBBQUHAwEMKUVudHJ1c3QgUm9vdCBDZXJ0aWZpY2F0aW9u\n" \
+       "IEF1dGhvcml0eSAtIEcy\n" \
+       "-----END TRUSTED CERTIFICATE-----"
+
diff --git a/tests/test-util.cpp b/tests/test-util.cpp
new file mode 100644 (file)
index 0000000..07ebbe3
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+ *  Copyright (c) 2017 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        test-util.cpp
+ * @author      Sangwan Kwon (sangwan.kwon@samsung.com)
+ * @version     0.1
+ * @brief
+ */
+#include "test-util.hxx"
+
+#include <sched.h>
+
+#include <cstdio>
+#include <memory>
+#include <vector>
+
+namespace test {
+namespace util {
+
+std::string ls(const char *path)
+{
+       using FilePtr = std::unique_ptr<FILE, decltype(&::pclose)>;
+       std::string cmd("/bin/ls ");
+       cmd.append(path);
+
+       FilePtr ls(::popen(cmd.c_str(), "r"), ::pclose);
+       if (ls == nullptr)
+               return std::string();
+
+       std::vector<char> buf(1024);
+       std::string ret;
+       while (::fgets(buf.data(), buf.size(), ls.get()))
+               ret.append(buf.data());
+
+       return ret;
+}
+
+std::string cat(const char *path)
+{
+       using FilePtr = std::unique_ptr<FILE, decltype(&::pclose)>;
+       std::string cmd("/bin/cat ");
+       cmd.append(path);
+
+       FilePtr ls(::popen(cmd.c_str(), "r"), ::pclose);
+       if (ls == nullptr)
+               return std::string();
+
+       std::vector<char> buf(1024);
+       std::string ret;
+       while (::fgets(buf.data(), buf.size(), ls.get()))
+               ret.append(buf.data());
+
+       return ret;
+}
+
+} // namespace util
+} // namespace test
diff --git a/tests/test-util.hxx b/tests/test-util.hxx
new file mode 100644 (file)
index 0000000..f1099ee
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ *  Copyright (c) 2017 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        test-util.h
+ * @author      Sangwan Kwon (sangwan.kwon@samsung.com)
+ * @version     0.1
+ * @brief
+ */
+#pragma once
+
+#include <stddef.h>
+#include <string>
+
+namespace test {
+namespace util {
+
+std::string ls(const char *path);
+std::string cat(const char *path);
+
+} // namespace util
+} // namespace test