Skip to content

Commit 5d54f70

Browse files
committed
Add CRIU container-based functional test
- Add CRIU container-based functional test - More CRIU cmdlinetests will be added to the target later Signed-off-by: LongyuZhang <[email protected]>
1 parent ca00e31 commit 5d54f70

File tree

8 files changed

+109
-25
lines changed

8 files changed

+109
-25
lines changed

external/common_functions.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ supported_packages="jdk jre"
3030
supported_builds="full"
3131

3232
# Supported tests
33-
supported_tests="external_custom camel criu-portable-checkpoint criu-portable-restore criu-ubi-portable-checkpoint criu-ubi-portable-restore derby elasticsearch jacoco jenkins functional-test kafka lucene-solr openliberty-mp-tck payara-mp-tck quarkus quarkus_quickstarts scala system-test tomcat tomee wildfly wycheproof netty spring zookeeper"
33+
supported_tests="external_custom camel criu-functional criu-portable-checkpoint criu-portable-restore criu-ubi-portable-checkpoint criu-ubi-portable-restore derby elasticsearch jacoco jenkins functional-test kafka lucene-solr openliberty-mp-tck payara-mp-tck quarkus quarkus_quickstarts scala system-test tomcat tomee wildfly wycheproof netty spring zookeeper"
3434

3535
function check_version() {
3636
version=$1

external/criu-functional/build.xml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0"?>
2+
<project name="criu-functional" default="build" basedir=".">
3+
<taskdef resource="net/sf/antcontrib/antlib.xml" />
4+
<description>
5+
Build criu-functional Docker image
6+
</description>
7+
<import file="${TEST_ROOT}/external/build.xml"/>
8+
9+
<!-- set properties for this build -->
10+
<property name="TEST" value="criu-functional" />
11+
<property name="DEST" value="${BUILD_ROOT}/external/${TEST}" />
12+
<property name="src" location="." />
13+
14+
<target name="init">
15+
<mkdir dir="${DEST}"/>
16+
</target>
17+
18+
<target name="dist" depends="move_scripts,clean_image,build_image" description="generate the distribution">
19+
<copy todir="${DEST}">
20+
<fileset dir="${src}" includes="*.xml, *.mk"/>
21+
</copy>
22+
</target>
23+
24+
<target name="build">
25+
<antcall target="dist" inheritall="true" />
26+
</target>
27+
</project>

external/criu-functional/playlist.xml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?xml version='1.0' encoding='UTF-8'?>
2+
<!--
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# https://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
-->
15+
<playlist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../TKG/playlist.xsd">
16+
<test>
17+
<testCaseName>criu-functional</testCaseName>
18+
<command> $(TEST_ROOT)$(D)external$(D)external.sh --run --tag "${DOCKERIMAGE_TAG}" --dir criu-functional --testtarget "_testList TESTLIST=cmdLineTester_criu_security,cmdLineTester_criu_random" --reportdst $(REPORTDIR) --docker_args "$(EXTRA_DOCKER_ARGS) --tmpfs /run"; \
19+
$(TEST_STATUS); \
20+
$(TEST_ROOT)$(D)external$(D)external.sh --clean --tag "${DOCKERIMAGE_TAG}" --dir criu-functional
21+
</command>
22+
<features>
23+
<feature>CRIU:required</feature>
24+
</features>
25+
<impls>
26+
<impl>openj9</impl>
27+
</impls>
28+
<levels>
29+
<level>dev</level>
30+
</levels>
31+
<groups>
32+
<group>external</group>
33+
</groups>
34+
</test>
35+
</playlist>
+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
github_url="https://github.com/adoptium/aqa-tests.git"
2+
test_results="testResults"
3+
gradle_version="5.1"
4+
environment_variable="MODE=java CC=gcc-7 CXX=g++-7"
5+
ubuntu_packages="ant-contrib build-essential git asciidoc"
6+
criu_version="latest"

external/criu-functional/test.sh

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#/bin/bash
2+
# Licensed under the Apache License, Version 2.0 (the "License");
3+
# you may not use this file except in compliance with the License.
4+
# You may obtain a copy of the License at
5+
#
6+
# http://www.apache.org/licenses/LICENSE-2.0
7+
#
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License.
13+
#
14+
15+
source $(dirname "$0")/test_base_functions.sh
16+
# Set up Java to be used by the functional test
17+
echo_setup
18+
19+
echo "export GLIBC_TUNABLES=glibc.pthread.rseq=0:glibc.cpu.hwcaps=-XSAVEC,-XSAVE,-AVX2,-ERMS,-AVX,-AVX_Fast_Unaligned_Load";
20+
export GLIBC_TUNABLES=glibc.pthread.rseq=0:glibc.cpu.hwcaps=-XSAVEC,-XSAVE,-AVX2,-ERMS,-AVX,-AVX_Fast_Unaligned_Load
21+
echo "export LD_BIND_NOT=on";
22+
export LD_BIND_NOT=on
23+
24+
export TEST_JDK_HOME=$JAVA_HOME
25+
echo "TEST_JDK_HOME is : $TEST_JDK_HOME"
26+
export JDK_VERSION=
27+
echo "TEST_JDK_HOME has been unset, use auto-detect instead."
28+
export DYNAMIC_COMPILE=true
29+
export BUILD_LIST=functional
30+
31+
cd /aqa-tests
32+
./get.sh
33+
cd /aqa-tests/TKG
34+
35+
set -e
36+
echo "Generating make files and running the target tests"
37+
make $1
38+
set +e

external/dockerfile_functions.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ print_clone_project() {
500500
# Cause Test name to be capitalized
501501
test_tag="$(sanitize_test_names ${test} | tr a-z A-Z)_TAG"
502502
git_branch_tag="master"
503-
if [[ "$test_tag" != *"PORTABLE"* ]]; then
503+
if [[ "$test_tag" != *"CRIU"* ]]; then
504504
git_branch_tag=$test_tag
505505
fi
506506

external/external.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ usage () {
6161
echo 'Usage : external.sh --dir TESTDIR --tag DOCKERIMAGE_TAG --version JDK_VERSION --impl JDK_IMPL [--docker_os docker_os][--platform PLATFORM] [--portable portable] [--node_name node_name] [--node_labels node_labels] [--docker_registry_required docker_registry_required] [--docker_registry_url DOCKER_REGISTRY_URL] [--docker_registry_dir DOCKER_REGISTRY_DIR] [--base_docker_registry_url baseDockerRegistryUrl] [--base_docker_registry_dir baseDockerRegistryDir] [--mount_jdk mount_jdk] [--test_root TEST_ROOT] [--reportsrc appReportDir] [--reportdst REPORTDIR] [--testtarget target] [--docker_args EXTRA_DOCKER_ARGS] [--build|--run|--load|--clean]'
6262
}
6363

64-
supported_tests="external_custom aot camel criu-portable-checkpoint criu-portable-restore criu-ubi-portable-checkpoint criu-ubi-portable-restore derby elasticsearch jacoco jenkins functional-test kafka lucene-solr openliberty-mp-tck payara-mp-tck quarkus quarkus_quickstarts scala system-test tomcat tomee wildfly wycheproof netty spring"
64+
supported_tests="external_custom aot camel criu-functional criu-portable-checkpoint criu-portable-restore criu-ubi-portable-checkpoint criu-ubi-portable-restore derby elasticsearch jacoco jenkins functional-test kafka lucene-solr openliberty-mp-tck payara-mp-tck quarkus quarkus_quickstarts scala system-test tomcat tomee wildfly wycheproof netty spring"
6565

6666
function check_test() {
6767
test=$1

external/functional-test/playlist.xml

-22
Original file line numberDiff line numberDiff line change
@@ -26,28 +26,6 @@
2626
<group>external</group>
2727
</groups>
2828
</test>
29-
<test>
30-
<testCaseName>criu_test</testCaseName>
31-
<disables>
32-
<disable>
33-
<comment>https://github.com/adoptium/aqa-tests/issues/4410</comment>
34-
<impl>openj9</impl>
35-
</disable>
36-
</disables>
37-
<command> $(TEST_ROOT)$(D)external$(D)external.sh --run --tag "${DOCKERIMAGE_TAG}" --dir functional-test --testtarget "_testList TESTLIST=cmdLineTester_criu,cmdLineTester_criu_nonPortableRestore,cmdLineTester_criu_security,cmdLineTester_criu_random" --reportdst $(REPORTDIR) --docker_args "-v /var/run/docker.sock:/var/run/docker.sock $(EXTRA_DOCKER_ARGS) --tmpfs /run"; \
38-
$(TEST_STATUS); \
39-
$(TEST_ROOT)$(D)external$(D)external.sh --clean --tag "${DOCKERIMAGE_TAG}" --dir functional-test
40-
</command>
41-
<features>
42-
<feature>CRIU:required</feature>
43-
</features>
44-
<levels>
45-
<level>dev</level>
46-
</levels>
47-
<groups>
48-
<group>external</group>
49-
</groups>
50-
</test>
5129
<test>
5230
<testCaseName>extended_functional</testCaseName>
5331
<command> $(TEST_ROOT)$(D)external$(D)external.sh --run --tag "${DOCKERIMAGE_TAG}" --dir functional-test --testtarget _extended.functional.regular --reportdst $(REPORTDIR) --docker_args "$(EXTRA_DOCKER_ARGS)"; \

0 commit comments

Comments
 (0)