Merge pull request #1966 from akiernan/us-musl-tests

Fix tests with musl
This commit is contained in:
OpenShift Merge Robot authored and GitHub committed 2019-11-02 17:03:37 +01:00
commit 44988e6a77
5 files changed
+18 -8

No files matched your search

+9 -3
View File
@@ -37,9 +37,15 @@ assert_not_reached () {
# Some tests look for specific English strings. Use a UTF-8 version # Some tests look for specific English strings. Use a UTF-8 version
# of the C (POSIX) locale if we have one, or fall back to en_US.UTF-8 # of the C (POSIX) locale if we have one, or fall back to en_US.UTF-8
# (https://sourceware.org/glibc/wiki/Proposals/C.UTF-8) # (https://sourceware.org/glibc/wiki/Proposals/C.UTF-8)
export LC_ALL=$(locale -a | grep -Ee '\.(UTF-8|utf8)' | grep -iEe '^(C|en_US)' | head -1 || true) #
if [ -z "${LC_ALL}" ]; then fatal "Can't find suitable UTF-8 locale"; fi # If we can't find the locale command assume we have support for C.UTF-8
# (e.g. musl based systems)
if type -p locale >/dev/null; then
export LC_ALL=$(locale -a | grep -Ee '\.(UTF-8|utf8)' | grep -iEe '^(C|en_US)' | head -1 || true)
if [ -z "${LC_ALL}" ]; then fatal "Can't find suitable UTF-8 locale"; fi
else
export LC_ALL=C.UTF-8
fi
# A GNU extension, used whenever LC_ALL is not C # A GNU extension, used whenever LC_ALL is not C
unset LANGUAGE unset LANGUAGE
+3 -1
View File
@@ -440,7 +440,9 @@ EOF
${CMD_PREFIX} ostree --repo=${test_tmpdir}/testos-repo commit --add-metadata-string version=1.0.10 -b testos/buildmaster/x86_64-runtime -s "Build" ${CMD_PREFIX} ostree --repo=${test_tmpdir}/testos-repo commit --add-metadata-string version=1.0.10 -b testos/buildmaster/x86_64-runtime -s "Build"
cd ${test_tmpdir} cd ${test_tmpdir}
cp -a osdata osdata-devel rm -rf osdata-devel
mkdir osdata-devel
tar -C osdata -cf - . | tar -C osdata-devel -xf -
cd osdata-devel cd osdata-devel
mkdir -p usr/include mkdir -p usr/include
echo "a development header" > usr/include/foo.h echo "a development header" > usr/include/foo.h
+1 -1
View File
@@ -177,7 +177,7 @@ if ! skip_one_without_user_xattrs; then
${CMD_PREFIX} ostree --repo=cacherepo pull-local ostree-srv/gnomerepo main ${CMD_PREFIX} ostree --repo=cacherepo pull-local ostree-srv/gnomerepo main
rev=$(ostree --repo=cacherepo rev-parse main) rev=$(ostree --repo=cacherepo rev-parse main)
${CMD_PREFIX} ostree --repo=cacherepo ls -R -C main > ls.txt ${CMD_PREFIX} ostree --repo=cacherepo ls -R -C main > ls.txt
regfile_hash=$(grep -E -e '^-0' ls.txt | head -1 | awk '{ print $5 }') regfile_hash=$((grep -E -e '^-0' ls.txt || true) | head -1 | awk '{ print $5 }')
${CMD_PREFIX} ostree --repo=repo remote add --set=gpg-verify=false corruptrepo $(cat httpd-address)/ostree/corruptrepo ${CMD_PREFIX} ostree --repo=repo remote add --set=gpg-verify=false corruptrepo $(cat httpd-address)/ostree/corruptrepo
# Make this a loop so in the future we can add more object types like commit etc. # Make this a loop so in the future we can add more object types like commit etc.
for object in ${regfile_hash}.file; do for object in ${regfile_hash}.file; do
+3 -1
View File
@@ -90,7 +90,9 @@ EOF
${CMD_PREFIX} ostree --repo=${test_tmpdir}/testos-repo commit --add-metadata-string version=1.0.10 -b testos/buildmaster/x86_64-runtime -s "Build" --gpg-sign=$keyid --gpg-homedir=${test_tmpdir}/gpghome ${CMD_PREFIX} ostree --repo=${test_tmpdir}/testos-repo commit --add-metadata-string version=1.0.10 -b testos/buildmaster/x86_64-runtime -s "Build" --gpg-sign=$keyid --gpg-homedir=${test_tmpdir}/gpghome
cd ${test_tmpdir} cd ${test_tmpdir}
cp -a osdata osdata-devel rm -rf osdata-devel
mkdir osdata-devel
tar -C osdata -cf - . | tar -C osdata-devel -xf -
cd osdata-devel cd osdata-devel
mkdir -p usr/include mkdir -p usr/include
echo "a development header" > usr/include/foo.h echo "a development header" > usr/include/foo.h
+2 -2
View File
@@ -47,12 +47,12 @@ setup_mirror content_mirror3
# Let's delete a file from 1 so that it falls back on 2 # Let's delete a file from 1 so that it falls back on 2
cd ${test_tmpdir}/content_mirror1/ostree/gnomerepo cd ${test_tmpdir}/content_mirror1/ostree/gnomerepo
filez=$(find objects/ -name '*.filez' | head -n 1) filez=$((find objects/ -name '*.filez' || true) | head -n 1)
rm ${filez} rm ${filez}
# Let's delete a file from 1 and 2 so that it falls back on 3 # Let's delete a file from 1 and 2 so that it falls back on 3
cd ${test_tmpdir}/content_mirror1/ostree/gnomerepo cd ${test_tmpdir}/content_mirror1/ostree/gnomerepo
filez=$(find objects/ -name '*.filez' | head -n 1) filez=$((find objects/ -name '*.filez' || true) | head -n 1)
rm ${filez} rm ${filez}
cd ${test_tmpdir}/content_mirror2/ostree/gnomerepo cd ${test_tmpdir}/content_mirror2/ostree/gnomerepo
rm ${filez} rm ${filez}