Skip to content

Commit

Permalink
Switch Travis to container-based infrastructure
Browse files Browse the repository at this point in the history
  • Loading branch information
sean797 committed Oct 6, 2017
1 parent 9320771 commit 188240f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 16 deletions.
27 changes: 14 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,33 @@
language: python
dist: trusty
sudo: required
sudo: false

python:
- "2.7"
- "3.3"
- "3.4"
- "3.5"
- "3.6"
- "nightly"

before_install:
- sudo apt-get update
- >
sudo apt-get -yq install
libdbus-1-dev
libdbus-glib-1-dev
dbus
addons:
apt:
packages:
- dbus-x11
- libdbus-glib-1-dev

install:
# These first 2 lines are a nasty Travis hack, see https://github.com/travis-ci/travis-ci/issues/653
- which python3.3-config && sed -i "s|not getvar('Py_ENABLE_SHARED')|True|" $(which python3.3-config) || true
- sed -i "s|not getvar('Py_ENABLE_SHARED')|True|" /opt/python/3.3.6/bin/python3.3-config || true
- sed -i "s|not getvar('Py_ENABLE_SHARED')|True|" $(which python)-config || true

- pip install -r requirements.txt
- pip install . # See setup.py
- pip install coveralls
- PATH=/opt/python/3.3.6/bin/:$PATH pip install -r requirements.txt
- PATH=/opt/python/3.3.6/bin/:$PATH pip install . # See setup.py
- PATH=/opt/python/3.3.6/bin/:$PATH pip install coveralls

script: nosetests -v -d --with-coverage --cover-package=tracer --cover-inclusive
script:
- export PYTHONPATH=/opt/python/3.3.6/lib/python3.3/site-packages/
- dbus-launch --exit-with-session nosetests -v -d --with-coverage --cover-package=tracer --cover-inclusive

notifications:
email: false
Expand Down
8 changes: 5 additions & 3 deletions tracer/resources/tracer.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,11 @@ def trace_affected(self, user=None):
return ApplicationsCollection(affected.values())

def _has_updated_kernel(self):
for k_version in next(os.walk('/lib/modules/'))[1]:
if parse_version(os.uname()[2]) < parse_version(k_version):
return True
if os.path.isdir('/lib/modules/'):
for k_version in next(os.walk('/lib/modules/'))[1]:
if parse_version(os.uname()[2]) < parse_version(k_version):
return True
return False
return False

def _apply_rules(self, process):
Expand Down

0 comments on commit 188240f

Please sign in to comment.