Script to automatically test python package installation on clean Docker
authorPeter Amstutz <peter.amstutz@curoverse.com>
Fri, 28 Aug 2015 21:18:20 +0000 (17:18 -0400)
committerPeter Amstutz <peter.amstutz@curoverse.com>
Fri, 28 Aug 2015 21:18:20 +0000 (17:18 -0400)
images.

jenkins/run-test-packages.sh [new file with mode: 0755]
jenkins/test-packages-centos6.sh [new file with mode: 0755]
jenkins/test-packages-deb-common.sh [new file with mode: 0755]
jenkins/test-packages-debian7.sh [new file with mode: 0755]
jenkins/test-packages-debian8.sh [new file with mode: 0755]
jenkins/test-packages-ubuntu1204.sh [new file with mode: 0755]
jenkins/test-packages-ubuntu1404.sh [new file with mode: 0755]

diff --git a/jenkins/run-test-packages.sh b/jenkins/run-test-packages.sh
new file mode 100755 (executable)
index 0000000..c4f5bec
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+if test -z "$WORKSPACE" ; then
+    echo "Must set WORKSPACE"
+    exit 1
+fi
+
+for pkg in test-packages-*.sh ; do
+    $pkg --run-test
+done
diff --git a/jenkins/test-packages-centos6.sh b/jenkins/test-packages-centos6.sh
new file mode 100755 (executable)
index 0000000..6dd87e9
--- /dev/null
@@ -0,0 +1,50 @@
+#!/bin/sh
+
+if test "$1" = --run-test ; then
+
+    if test -z "$WORKSPACE" ; then
+        echo "Must set WORKSPACE"
+        exit 1
+    fi
+
+    exec docker run \
+         --rm \
+         --volume=$WORKSPACE/packages/centos6:/mnt \
+         --volume=$(readlink -f $0):/root/run-test.sh \
+         --workdir=/mnt \
+         centos:6 \
+         /root/run-test.sh --install-scl
+fi
+
+if test "$1" = --install-scl ; then
+    yum install --assumeyes scl-utils
+    curl -L -O https://www.softwarecollections.org/en/scls/rhscl/python27/epel-6-x86_64/download/rhscl-python27-epel-6-x86_64.noarch.rpm
+    yum install --assumeyes rhscl-python27-epel-6-x86_64.noarch.rpm
+    yum install --assumeyes python27
+    exec scl enable python27 $0
+fi
+
+yum install --assumeyes python27-python*.rpm
+
+mkdir -p /tmp/opts
+cd /tmp/opts
+
+for r in /mnt/python27-python-*x86_64.rpm ; do
+    rpm2cpio $r | cpio -idm
+done
+
+FAIL=0
+
+for so in $(find . -name "*.so") ; do
+    if ldd $so | grep "not found" ; then
+        echo "^^^ Missing while scanning $so ^^^"
+        FAIL=1
+    fi
+done
+
+python <<EOF
+import arvados
+import arvados_fuse
+EOF
+
+exit $FAIL
diff --git a/jenkins/test-packages-deb-common.sh b/jenkins/test-packages-deb-common.sh
new file mode 100755 (executable)
index 0000000..d2c586c
--- /dev/null
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+if test "$1" = --run-test ; then
+
+    if test -z "$WORKSPACE" ; then
+        echo "Must set WORKSPACE"
+        exit 1
+    fi
+
+    self=$(readlink -f $0)
+    cd $WORKSPACE/packages/debian7
+    dpkg-scanpackages . /dev/null | gzip -c9 > Packages.gz
+
+    exec docker run \
+         --rm \
+         --volume=$WORKSPACE/packages/$2:/mnt \
+         --volume=$self:/root/run-test.sh \
+         --workdir=/mnt \
+         $3 \
+         /root/run-test.sh
+fi
+
+echo "deb file:///mnt /" >>/etc/apt/sources.list
+apt-get update
+apt-get --assume-yes --force-yes install python-arvados-python-client python-arvados-fuse
+
+python <<EOF
+import arvados
+import arvados_fuse
+EOF
diff --git a/jenkins/test-packages-debian7.sh b/jenkins/test-packages-debian7.sh
new file mode 100755 (executable)
index 0000000..c48761c
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec ./test-packages-deb-common.sh --run-test debian7 debian:wheezy
diff --git a/jenkins/test-packages-debian8.sh b/jenkins/test-packages-debian8.sh
new file mode 100755 (executable)
index 0000000..6e42806
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec ./test-packages-deb-common.sh --run-test debian8 debian:jessie
diff --git a/jenkins/test-packages-ubuntu1204.sh b/jenkins/test-packages-ubuntu1204.sh
new file mode 100755 (executable)
index 0000000..a8af4d8
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec ./test-packages-deb-common.sh --run-test ubuntu1204 ubuntu:precise
diff --git a/jenkins/test-packages-ubuntu1404.sh b/jenkins/test-packages-ubuntu1404.sh
new file mode 100755 (executable)
index 0000000..a70a1f6
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec ./test-packages-deb-common.sh --run-test ubuntu1404 ubuntu:trusty