From aab652a920d35d64cada061e1670093e413c5f33 Mon Sep 17 00:00:00 2001 From: Anthony Geay Date: Mon, 16 Aug 2021 16:17:56 +0200 Subject: [PATCH] test.hdfs in SSL mode --- test.hdfs/CMakeLists.txt | 6 +-- test.hdfs/CTestTestfileInstall.cmake | 6 +-- test.hdfs/testme.py | 69 ---------------------------- 3 files changed, 4 insertions(+), 77 deletions(-) delete mode 100644 test.hdfs/testme.py diff --git a/test.hdfs/CMakeLists.txt b/test.hdfs/CMakeLists.txt index 3811f86ab..040774500 100644 --- a/test.hdfs/CMakeLists.txt +++ b/test.hdfs/CMakeLists.txt @@ -61,7 +61,7 @@ FOREACH(tfile ${TEST_NAMES}) ENDIF() ADD_TEST(NAME ${TEST_NAME} - COMMAND ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/testme.py" "${HDF_TEST_FILE}" "${CMAKE_CURRENT_SOURCE_DIR}/${tfile}.py") + COMMAND ${PYTHON_EXECUTABLE} "$ENV{KERNEL_ROOT_DIR}/bin/salome/appliskel/python_test_driver.py" "${HDF_TEST_FILE}" "${CMAKE_CURRENT_SOURCE_DIR}/${tfile}.py") SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES ENVIRONMENT "${tests_env};SHAPER_UNIT_TEST_IN_PROGRESS=1") SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME};models_hdf") SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES TIMEOUT ${TIMEOUT}) @@ -83,10 +83,6 @@ INSTALL(FILES CTestTestfileInstall.cmake DESTINATION ${TEST_INSTALL_DIRECTORY} RENAME CTestTestfile.cmake) -INSTALL(FILES testme.py DESTINATION ${TEST_INSTALL_DIRECTORY} - PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE - GROUP_READ GROUP_EXECUTE - WORLD_READ WORLD_EXECUTE) FILE(COPY test_hdf.py DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) INSTALL(FILES test_hdf.py DESTINATION ${TEST_INSTALL_DIRECTORY} PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE diff --git a/test.hdfs/CTestTestfileInstall.cmake b/test.hdfs/CTestTestfileInstall.cmake index cf6d58a7e..c421140eb 100644 --- a/test.hdfs/CTestTestfileInstall.cmake +++ b/test.hdfs/CTestTestfileInstall.cmake @@ -20,17 +20,17 @@ INCLUDE(tests.set) SET(COMPONENT_NAME SHAPER) -SET(SALOME_TEST_DRIVER "testme.py") +SET(PYTHON_TEST_DRIVER "$ENV{KERNEL_ROOT_DIR}/bin/salome/appliskel/python_test_driver.py") SET(TIMEOUT 600) FOREACH(tfile ${PUBLIC_TESTS}) SET(TEST_NAME ${COMPONENT_NAME}_HDF_${tfile}) - ADD_TEST(${TEST_NAME} ${SALOME_TEST_DRIVER} "${TIMEOUT}" "${tfile}.hdf" "${tfile}.py") + ADD_TEST(${TEST_NAME} ${PYTHON_TEST_DRIVER} "${TIMEOUT}" "${tfile}.hdf" "${tfile}.py") SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}") ENDFOREACH() FOREACH(tfile ${RESTRICTED_TESTS}) SET(TEST_NAME ${COMPONENT_NAME}_HDF_${tfile}) - ADD_TEST(${TEST_NAME} ${SALOME_TEST_DRIVER} "${TIMEOUT}" "$ENV{RESTRICTED_ROOT_DIR}/SHAPER/test.hdfs/${tfile}.hdf" "${tfile}.py") + ADD_TEST(${TEST_NAME} ${PYTHON_TEST_DRIVER} "${TIMEOUT}" "$ENV{RESTRICTED_ROOT_DIR}/SHAPER/test.hdfs/${tfile}.hdf" "${tfile}.py") SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}") ENDFOREACH() diff --git a/test.hdfs/testme.py b/test.hdfs/testme.py deleted file mode 100644 index cd56bcd3a..000000000 --- a/test.hdfs/testme.py +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/env python3 - -# Copyright (C) 2020-2021 CEA/DEN, EDF R&D -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License, or (at your option) any later version. -# -# This library 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 -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -if __name__ == '__main__': - - import subprocess - from time import sleep - import sys, os - import tempfile - - testTimeout = 600 - if len(sys.argv) > 3: - testTimeout = int(sys.argv[1]) - hdffile = sys.argv[2] - testdatafile = sys.argv[3] - else: - hdffile = sys.argv[1] - testdatafile = sys.argv[2] - - tempdir = tempfile.gettempdir() - portlogfile = tempdir + "/.salome_port" - testlogfile = tempdir + "/test.log" - # remove port file if any - try: - os.remove(portlogfile) - except: - pass - - isOk = True - error = "" - - proc = subprocess.Popen(["runSalome.py", "--modules", "SHAPER,GEOM,SHAPERSTUDY", "--gui", "--splash", "0", "--ns-port-log=" + portlogfile, "test_hdf.py", "args:" + hdffile + "," + testdatafile + "," + portlogfile + "," + testlogfile], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) - try: - proc.communicate(timeout = testTimeout) - except TimeoutExpired: - isOk = False - proc.kill() - out, err = proc.communicate() - error = "Killed by CPU limit." - print(err) - - with open(testlogfile, 'r') as inputFile: - s = inputFile.read() - print(s) - isOk = isOk and s.find("FAIL") < 0 - try: - os.remove(testlogfile) - except: - pass - - assert isOk, "Test failed. {}".format(error) -- 2.30.2