aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Zaman <jason@perfinion.com>2014-11-26 12:00:45 +0400
committerJason Zaman <jason@perfinion.com>2014-11-26 20:29:04 +0400
commit6fa8e312341c91ad17a237666d45f188bd867da3 (patch)
treee217457c62db15b771233ce29d3258d5905cc081 /.travis.yml
parentAllow admin users to manage user tmp chr_files (diff)
downloadhardened-refpolicy-6fa8e312341c91ad17a237666d45f188bd867da3.tar.gz
hardened-refpolicy-6fa8e312341c91ad17a237666d45f188bd867da3.tar.bz2
hardened-refpolicy-6fa8e312341c91ad17a237666d45f188bd867da3.zip
add in travis config for testing
Diffstat (limited to '.travis.yml')
-rw-r--r--.travis.yml113
1 files changed, 113 insertions, 0 deletions
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 000000000..ce213a3d5
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,113 @@
+# Originally by Nicolas Iooss from: https://github.com/fishilico/selinux-refpolicy-patched/blob/travis-upstream/.travis.yml
+
+language: python
+python:
+ - "2.7"
+
+# for T in standard mls mcs ; do for D in arch debian gentoo ; do for I in n y ; do for M in y n ; do
+# echo " - TYPE=$T DISTRO=$D DIRECT_INITRC=$I MONOLITHIC=$M" ; done ; done ; done ; done
+env:
+ - TYPE=standard DISTRO=gentoo DIRECT_INITRC=n MONOLITHIC=n
+ - TYPE=mls DISTRO=gentoo DIRECT_INITRC=n MONOLITHIC=n
+ - TYPE=mcs DISTRO=gentoo DIRECT_INITRC=n MONOLITHIC=n
+
+# Install SELinux userspace utilities dependencies
+before_install:
+# Show OS version information
+ - lsb_release -a
+ - sudo apt-get update -qq
+ - sudo apt-get install -qq libaudit-dev libcap-ng-dev libustr-dev swig
+
+# Compile and install a newer version of SELinux userspace utilities
+install:
+ # Setup the directory where SELinux utilities will be installed
+ - export DESTDIR="$HOME/selinux-project"
+ - mkdir "$DESTDIR"
+ - export PATH="$DESTDIR/usr/bin:$DESTDIR/usr/sbin:$DESTDIR/bin:$DESTDIR/sbin:$PATH"
+ - export LD_LIBRARY_PATH="$DESTDIR/usr/lib:$DESTDIR/lib:$LD_LIBRARY_PATH"
+
+ # On Ubuntu 12.04, default CFLAGS make the build fail in libsepol/cil with:
+ # error: declaration of 'index' shadows a global declarationo
+ # So define our own CFLAGS
+ - export CFLAGS="-O2 -pipe -fPIC -Wall"
+
+ # Download SELinux userspace tools and libraries
+ - wget https://github.com/SELinuxProject/selinux/archive/20140826-rc6.tar.gz
+ - tar -xzf 20140826-rc6.tar.gz
+ - mv selinux-20140826-rc6 selinux-src
+
+ # Download setools
+ - wget https://github.com/TresysTechnology/setools3/archive/setools-3.3.8.tar.gz
+ - tar -xzf setools-3.3.8.tar.gz
+ - mv setools3-setools-3.3.8 setools-src
+
+ # Ubuntu 12.04 coreutils is too old to provide "ln --relative" :(
+ - sed 's/ln -sf --relative /ln -sf /' -i selinux-src/libsepol/src/Makefile
+ - sed 's/ln -sf --relative /ln -sf /' -i selinux-src/libselinux/src/Makefile
+
+ # Compile and install SELinux libraries first
+ - make -C selinux-src/libsepol install
+ - make -C selinux-src/libselinux install
+ - make -C selinux-src/libsemanage install
+
+ # Now that the libraries are installed, use them to compile the tools
+ - export CFLAGS="$CFLAGS -I$DESTDIR/usr/include"
+ - export LDFLAGS="$LDFLAGS -L$DESTDIR/usr/lib"
+
+ # Compile and install setools
+ - cd setools-src
+ - aclocal && autoreconf -if && automake
+ - ./configure
+ --prefix="$DESTDIR/usr"
+ --disable-gui --disable-swig-tcl
+ --disable-bwidget-check --disable-selinux-check
+ --with-sepol-devel="$DESTDIR/usr"
+ --with-selinux-devel="$DESTDIR/usr"
+ - make -C libqpol DESTDIR= install
+ - make -C libapol DESTDIR= install
+ - cd ..
+
+ # Compile and install SELinux tools
+ - export LIBDIR="$DESTDIR/usr/lib"
+ - export LIBEXECDIR="$DESTDIR/usr/lib"
+ - export SHLIBDIR="$DESTDIR/usr/lib"
+ - export SEMODULE_PATH="$DESTDIR/usr/bin"
+ - make -C selinux-src/sepolgen install
+ - make -C selinux-src/checkpolicy install
+ - make -C selinux-src/policycoreutils install
+
+ # Use the newly-built toolchain
+ - export TEST_TOOLCHAIN="$DESTDIR"
+
+# XXX: not sure whether the definition in make command line are useful or whether the env definitions are enough
+# Use a heartbeat loop to produce output while compiling the policy, which takes quite a long time.
+script:
+ - make bare
+ - make TYPE="$TYPE" MONOLITHIC="$MONOLITHIC" conf
+
+# - if [ "$MONOLITHIC" = y ]; then
+# ( for A in $(seq 8) ; do sleep 300 ; echo "Heartbeat $((A*5)) minutes" ; done ) &
+# make TYPE="$TYPE" DISTRO="$DISTRO" DIRECT_INITRC="$DIRECT_INITRC" MONOLITHIC=y ;
+# fi
+# - if [ "$MONOLITHIC" = y ]; then make TYPE="$TYPE" DISTRO="$DISTRO" DIRECT_INITRC="$DIRECT_INITRC" MONOLITHIC=y file_contexts ; fi
+# - if [ "$MONOLITHIC" = y ]; then setfiles -c policy.$(checkpolicy -V | cut -d' ' -f1) file_contexts ; fi
+# - if [ "$MONOLITHIC" = n ]; then make TYPE="$TYPE" DISTRO="$DISTRO" DIRECT_INITRC="$DIRECT_INITRC" MONOLITHIC=n base ; fi
+# - if [ "$MONOLITHIC" = n ]; then make TYPE="$TYPE" DISTRO="$DISTRO" DIRECT_INITRC="$DIRECT_INITRC" MONOLITHIC=n modules ; fi
+# - if [ "$MONOLITHIC" = n ]; then
+# ( for A in $(seq 8) ; do sleep 300 ; echo "Heartbeat $((A*5)) minutes" ; done ) &
+# make TYPE="$TYPE" DISTRO="$DISTRO" DIRECT_INITRC="$DIRECT_INITRC" MONOLITHIC=n validate ;
+# fi
+
+ - make TYPE="$TYPE" DISTRO="$DISTRO" DIRECT_INITRC="$DIRECT_INITRC" MONOLITHIC=n base
+ - make TYPE="$TYPE" DISTRO="$DISTRO" DIRECT_INITRC="$DIRECT_INITRC" MONOLITHIC=n modules
+ - ( for A in $(seq 8) ; do sleep 300 ; echo "Heartbeat $((A*5)) minutes" ; done ) &
+ make TYPE="$TYPE" DISTRO="$DISTRO" DIRECT_INITRC="$DIRECT_INITRC" MONOLITHIC=n validate
+
+# Only build travis branches
+branches:
+ only:
+ - /^travis-.*/
+
+notifications:
+ email: false
+