Merge branch '8561-node-pairing' of git.curoverse.com:arvados into 8561-node-pairing
[arvados.git] / build / package-testing / test-packages-centos6.sh
1 #!/bin/bash
2
3 set -eu
4
5 yum -q clean all
6 touch /var/lib/rpm/*
7
8 export ARV_PACKAGES_DIR=/arvados/packages/centos6
9
10 rpm -qa | sort > "$ARV_PACKAGES_DIR/$1.before"
11
12 yum install --assumeyes $1
13
14 rpm -qa | sort > "$ARV_PACKAGES_DIR/$1.after"
15
16 set +e
17 diff "$ARV_PACKAGES_DIR/$1.before" "$ARV_PACKAGES_DIR/$1.after" >"$ARV_PACKAGES_DIR/$1.diff"
18 set -e
19
20 SCL=""
21 if scl enable python27 true 2>/dev/null ; then
22     SCL="scl enable python27"
23 fi
24
25 mkdir -p /tmp/opts
26 cd /tmp/opts
27
28 rpm2cpio $(ls -t "$ARV_PACKAGES_DIR/$1"-*.rpm | head -n1) | cpio -idm 2>/dev/null
29
30 shared=$(find -name '*.so')
31 if test -n "$shared" ; then
32     for so in $shared ; do
33         echo
34         echo "== Packages dependencies for $so =="
35         $SCL ldd "$so" \
36             | awk '($3 ~ /^\//){print $3}' | sort -u | xargs rpm -qf | sort -u
37     done
38 fi
39
40 if test -n "$SCL" ; then
41     exec $SCL "/jenkins/package-testing/common-test-packages.sh '$1'"
42 else
43     exec /jenkins/package-testing/common-test-packages.sh "$1"
44 fi