diff --git a/.gitignore b/.gitignore index 2cf6830..a12b453 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -SOURCES/memkind-1.10.1.tar.gz -/memkind-1.10.1.tar.gz +*.tar.gz +/configure.ac.patch diff --git a/configure.ac.patch b/configure.ac.patch deleted file mode 100644 index a6eb8e4..0000000 --- a/configure.ac.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff --git a/configure.ac b/configure.ac -index 7c332d7..fa5a487 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -159,16 +159,6 @@ fi - ], - [enable_secure="1"] - ) --if test "x$enable_secure" = "x1" ; then -- CFLAGS="$CFLAGS -fstack-protector" -- LDFLAGS="$LDFLAGS -Wl,-z,relro,-z,now" -- -- if test "$CFLAGS" != "${CFLAGS%-O0*}" ; then # if CFLAGS contains -O0 -- echo "WARNING: Could not apply FORTIFY_SOURCE=2 due to lack of optimization (-O0)" -- else -- CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2" #FORTITFY_SOURCE does not work with -O0 (ex. if enable_debug=1 or enable_gcov=1) -- fi --fi - - AC_SUBST([enable_secure]) - diff --git a/sources b/sources index b339943..236e994 100644 --- a/sources +++ b/sources @@ -1 +1,2 @@ +SHA512 (configure.ac.patch) = 83fb5b18bee2e3179786e3440bb8648110547a8b2ebcdf7f38b5264eb9f26e2421e3095f3b7070f8b64af160264a333f9ac848d0c4ecdc38670916019d4e18b9 SHA512 (memkind-1.10.1.tar.gz) = 9fa2eed4e07d0316ee97fcdb594df4fe2e5cf44a509f658a78986aad9b4f56a9c8fbe281073b93ba3c2870734167ad29b8643d69757733fdce25e45e6f0015a0 diff --git a/tests/.fmf/version b/tests/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/tests/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/tests/memkind-prepsource.sh b/tests/memkind-prepsource.sh new file mode 100755 index 0000000..12053c0 --- /dev/null +++ b/tests/memkind-prepsource.sh @@ -0,0 +1,9 @@ +#!/bin/bash -x + +WORKDIR="${1}" + +rpmbuild -bp $WORKDIR/*.spec --nodeps --define "_sourcedir $WORKDIR" --define "_builddir $WORKDIR/source" +mkdir $WORKDIR/temp +mv $WORKDIR/source/*/* $WORKDIR/temp/ +rm -rf $WORKDIR/source/* +mv $WORKDIR/temp/* $WORKDIR/source/ diff --git a/tests/memkind-test.sh b/tests/memkind-test.sh new file mode 100755 index 0000000..40c2c1d --- /dev/null +++ b/tests/memkind-test.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +RETCODE=0 +TMPTESTSFILE=/tmp/memkind-tests.log +TMPBUILDFILE=/tmp/memkind-build.log + +# re-play the build +pushd source +./build.sh &> $TMPBUILDFILE +RETCODE=$? +if [ $RETCODE != 0 ]; then + cat $TMPBUILDFILE + exit $RETCODE +fi + +pushd test + +# run all tests filtering out those that are not meant +# to pass on a small VM +./all_tests --gtest_filter=-BATest.test_TC_MEMKIND_hbwmalloc_Pref_CheckAvailable:DlopenTest.*:HbwVerifyFunctionTest.*:NegativeTestHuge.test_TC_MEMKIND_hbwmalloc_memalign_psize_Interleave_Policy_PAGE_SIZE_2MB:HBW*.*:BATest.test_TC_MEMKIND_free_ext_MEMKIND_GBTLB_4096_bytes &> $TMPTESTSFILE +RETCODE=$? +if [ $RETCODE != 0 ]; then + cat $TMPTESTSFILE +fi +exit $RETCODE + diff --git a/tests/provision.fmf b/tests/provision.fmf new file mode 100644 index 0000000..dd69f34 --- /dev/null +++ b/tests/provision.fmf @@ -0,0 +1,5 @@ +--- + +standard-inventory-qcow2: + qemu: + m: 4G diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100644 index 0000000..276d18b --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,38 @@ +--- +- hosts: localhost + tags: + - classic + vars: + # standard-test-basic directory for tests are relative to {{ tenv_workdir }} + tenv_workdir: /var/str + pre_tasks: + - import_role: + name: standard-test-source + vars: + fetch_only: True + - name: Copy files including source to test environment + synchronize: + src: "{{ playbook_dir }}/.." + dest: "{{ tenv_workdir }}" + mode: push + ssh_args: "-o UserKnownHostsFile=/dev/null" + roles: + - role: standard-test-basic + required_packages: + - automake + - libtool + - numactl-devel + - systemd + - gcc + - gcc-c++ + - make + - gawk + - python3 + - rpm-build + tests: + - prepare-source: + dir: ./ + run: ./memkind-prepsource.sh "{{tenv_workdir}}" + - memkind_test: + dir: ./ + run: ./memkind-test.sh