diff --git a/broken-symlinks/main.fmf b/broken-symlinks/main.fmf new file mode 100644 index 0000000..078f33b --- /dev/null +++ b/broken-symlinks/main.fmf @@ -0,0 +1,16 @@ +summary: Test that compiler-rt does not contain broken symlinks +test: ./test.sh +framework: shell +tier: 1 +component: + - llvm-toolset + - compiler-rt +require: + - compiler-rt + +link: + verifies: https://issues.redhat.com/browse/RHEL-7375 + +adjust: + - enabled: false + when: rhel < rhel-8 diff --git a/broken-symlinks/test.sh b/broken-symlinks/test.sh new file mode 100755 index 0000000..d1ff74c --- /dev/null +++ b/broken-symlinks/test.sh @@ -0,0 +1,16 @@ +#!/bin/sh -u + +tmp=$(mktemp -d) +# Install compiler-rt in a new root to ensure possible broken links are +# not resolved with packages installed by other tests +dnf install --quiet --installroot=${tmp} -y compiler-rt +result=0 +for file in $(rpm -ql compiler-rt); do + [[ -L ${tmp}/$file ]] || continue + if [[ ! -e ${tmp}/$file ]]; then + echo "FAIL: $file is a dangling symlink" + result=1 + fi +done +rm -rf $tmp +exit $result