|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +# Important: This script is run under QEMU |
| 4 | + |
| 5 | +set -e |
| 6 | + |
| 7 | +LTP_URL="https://github.com/linux-test-project/ltp.git" |
| 8 | +LTP_SHA=20250530 |
| 9 | + |
| 10 | +# Version of Kirk to install |
| 11 | +KIRK_VERSION=cdc81ed |
| 12 | + |
| 13 | +# Build-depends needed to build the test suites, they'll be removed later |
| 14 | +BUILD_DEPS="\ |
| 15 | + gcc \ |
| 16 | + git \ |
| 17 | + make \ |
| 18 | + pkgconf \ |
| 19 | + autoconf \ |
| 20 | + automake \ |
| 21 | + bison \ |
| 22 | + flex \ |
| 23 | + m4 \ |
| 24 | + libc6-dev \ |
| 25 | + libnuma-dev \ |
| 26 | +" |
| 27 | + |
| 28 | +apt-get install --no-install-recommends -y ${BUILD_DEPS} |
| 29 | + |
| 30 | +BUILD_DIR="/ltp" |
| 31 | +BUILDFILE=/test_suites.json |
| 32 | +echo '{ "tests_suites": [' >> $BUILDFILE |
| 33 | + |
| 34 | +######################################################################## |
| 35 | +# Build and install tests # |
| 36 | +######################################################################## |
| 37 | +mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR} |
| 38 | + |
| 39 | +git config --global http.sslverify false |
| 40 | + |
| 41 | +echo ' {"name": "ltp-tests", "git_url": "'$LTP_URL'", "git_commit": "'$LTP_SHA'" }' >> $BUILDFILE |
| 42 | +echo ' ]}' >> $BUILDFILE |
| 43 | + |
| 44 | +git clone -b ${LTP_SHA} ${LTP_URL} |
| 45 | +cd ltp |
| 46 | + |
| 47 | +# See https://github.com/kernelci/kernelci-core/issues/948 |
| 48 | +echo -e "\ |
| 49 | +diff --git a/testcases/open_posix_testsuite/bin/run-posix-option-group-test.sh b/testcases/open_posix_testsuite/bin/run-posix-option-group-test.sh |
| 50 | +index 1bbdddfd5..de84b9e6f 100755 |
| 51 | +--- a/testcases/open_posix_testsuite/bin/run-posix-option-group-test.sh |
| 52 | ++++ b/testcases/open_posix_testsuite/bin/run-posix-option-group-test.sh |
| 53 | +@@ -25,7 +25,7 @@ run_option_group_tests() |
| 54 | + { |
| 55 | +\tlocal list_of_tests |
| 56 | +
|
| 57 | +-\tlist_of_tests=\`find \$1 -name '*.run-test' | sort\` |
| 58 | ++\tlist_of_tests=\`find \$1 -name run.sh | sort\` |
| 59 | +
|
| 60 | +\tif [ -z \"\$list_of_tests\" ]; then |
| 61 | +\t\techo \".run-test files not found under \$1, have been the tests compiled?\" |
| 62 | +" | patch -p1 |
| 63 | + |
| 64 | +NBCPU=$(grep ^processor /proc/cpuinfo | wc -l) |
| 65 | + |
| 66 | +make autotools |
| 67 | +./configure |
| 68 | +make all -j$NBCPU |
| 69 | +find . -executable -type f -exec strip {} \; |
| 70 | +make install |
| 71 | + |
| 72 | +cd testcases/open_posix_testsuite/ && ./configure |
| 73 | +make all -j$NBCPU |
| 74 | +make install prefix=/opt/ltp |
| 75 | + |
| 76 | +######################################################################## |
| 77 | +# Install kirk # |
| 78 | +######################################################################## |
| 79 | + |
| 80 | +git clone https://github.com/linux-test-project/kirk /opt/kirk |
| 81 | +cd /opt/kirk |
| 82 | +git reset --hard $KIRK_VERSION |
| 83 | +rm -rf ./.git |
| 84 | + |
| 85 | +######################################################################## |
| 86 | +# Cleanup: remove files and packages we don't want in the images # |
| 87 | +######################################################################## |
| 88 | + |
| 89 | +rm -rf ${BUILD_DIR} |
| 90 | +apt-get autoremove --purge -y ${BUILD_DEPS} |
| 91 | +apt-get clean |
0 commit comments