Skip to content

Commit

Permalink
Worked on tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
joachimmetz committed Jan 22, 2019
1 parent c1e1146 commit 94cea2a
Show file tree
Hide file tree
Showing 4 changed files with 244 additions and 0 deletions.
108 changes: 108 additions & 0 deletions .travis.yml
@@ -0,0 +1,108 @@
matrix:
include:
- name: "Ubuntu Xenial (16.04) with Python 2.7"
os: linux
dist: xenial
sudo: required
group: edge
language: python
python: 2.7
virtualenv:
system_site_packages: true
- name: "Ubuntu Xenial (16.04) with Python 3.5"
os: linux
dist: xenial
sudo: required
group: edge
language: python
python: 3.5
virtualenv:
system_site_packages: true
- name: "Fedora Core 27 (Docker) with Python 2.7"
env: FEDORA_VERSION="27"
os: linux
dist: xenial
sudo: required
group: edge
language: python
python: 2.7
services:
- docker
- name: "Fedora Core 27 (Docker) with Python 3.6"
env: FEDORA_VERSION="27"
os: linux
dist: xenial
sudo: required
group: edge
language: python
python: 3.6
services:
- docker
- name: "Fedora Core 28 (Docker) with Python 2.7"
env: FEDORA_VERSION="28"
os: linux
dist: xenial
sudo: required
group: edge
language: python
python: 2.7
services:
- docker
- name: "Fedora Core 28 (Docker) with Python 3.6"
env: FEDORA_VERSION="28"
os: linux
dist: xenial
sudo: required
group: edge
language: python
python: 3.6
services:
- docker
- name: "Fedora Core 29 (Docker) with Python 2.7"
env: FEDORA_VERSION="29"
os: linux
dist: xenial
sudo: required
group: edge
language: python
python: 2.7
services:
- docker
- name: "Fedora Core 29 (Docker) with Python 3.7"
env: FEDORA_VERSION="29"
os: linux
dist: xenial
sudo: required
group: edge
language: python
python: 3.7
services:
- docker
- name: "MacOS with Python 2.7.10"
os: osx
language: generic
env: PYTHONPATH=/Library/Python/2.7/site-packages/
- name: "Pylint for Python 2.7 on Ubuntu Trusty (14.04)"
env: TARGET="pylint2"
os: linux
dist: trusty
sudo: required
group: edge
language: python
python: 2.7
virtualenv:
system_site_packages: true
- name: "Pylint for Python 3.5 on Ubuntu Xenial (16.04)"
env: TARGET="pylint3"
os: linux
dist: xenial
sudo: required
group: edge
language: python
python: 3.5
virtualenv:
system_site_packages: true
install:
- ./utils/travis_install.sh;
script:
- ./utils/travis_script.sh;
37 changes: 37 additions & 0 deletions appveyor.yml
@@ -0,0 +1,37 @@
environment:
matrix:
- TARGET: windows_python27_32bit
MACHINE_TYPE: "x86"
PYTHON: "C:\\Python27"
- TARGET: windows_python27_64bit
MACHINE_TYPE: "amd64"
PYTHON: "C:\\Python27-x64"
- TARGET: windows_python36_32bit
MACHINE_TYPE: "x86"
PYTHON: "C:\\Python36"
- TARGET: windows_python36_64bit
MACHINE_TYPE: "amd64"
PYTHON: "C:\\Python36-x64"
- TARGET: ubuntu_xenial_python27
APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu
APPVEYOR_YML_DISABLE_PS_LINUX: true
- TARGET: ubuntu_bionic_python27
APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu1804
APPVEYOR_YML_DISABLE_PS_LINUX: true

install:
- cmd: '"C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x86 /release'
- cmd: "%PYTHON%\\python.exe -m pip install --upgrade pip"
- cmd: "%PYTHON%\\python.exe -m pip install pypiwin32 WMI"
- cmd: "%PYTHON%\\python.exe %PYTHON%\\Scripts\\pywin32_postinstall.py -install"
- cmd: git clone https://github.com/log2timeline/l2tdevtools.git ..\l2tdevtools
- cmd: if [%APPVEYOR_REPO_BRANCH%]==[master] ( set TRACK=stable ) else ( set TRACK=%APPVEYOR_REPO_BRANCH% )
- cmd: mkdir dependencies && set PYTHONPATH=..\l2tdevtools && "%PYTHON%\\python.exe" ..\l2tdevtools\tools\update.py --download-directory dependencies --machine-type %MACHINE_TYPE% --msi-targetdir "%PYTHON%" --track %TRACK%
- sh: TRACK=${APPVEYOR_REPO_BRANCH/master/stable} && sudo add-apt-repository ppa:gift/${TRACK} -y && sudo apt-get update -q && sudo apt-get install -y python-plaso

build: off

test_script:
- git clone https://github.com/log2timeline/plaso.git
- cmd: cd plaso && "%PYTHON%\\python.exe" utils\check_dependencies.py
- sh: cd plaso && ./utils/check_dependencies.py
64 changes: 64 additions & 0 deletions utils/travis_install.sh
@@ -0,0 +1,64 @@
#!/bin/bash
#
# Script to set up tests on Travis CI.

PYTHON2_DEPENDENCIES="python-plaso";

PYTHON3_DEPENDENCIES="python3-plaso";

# Exit on error.
set -e;

if test "${TARGET}" = "pylint2" || test "${TARGET}" = "pylint3";
then
sudo add-apt-repository ppa:gift/${TARGET} -y;
sudo apt-get update -q;
sudo apt-get install -y pylint;

elif test ${TRAVIS_OS_NAME} = "osx";
then
for PACKAGE in macos/*.dmg;
do
PACKAGE=`echo ${PACKAGE} | sed 's?macos/\(.*\)-[0-9].*.dmg?\1?'`;

echo "Installing: ${PACKAGE}";
sudo /usr/bin/hdiutil attach macos/${PACKAGE}-*.dmg;
sudo /usr/sbin/installer -target / -pkg /Volumes/${PACKAGE}-*.pkg/${PACKAGE}-*.pkg;
sudo /usr/bin/hdiutil detach /Volumes/${PACKAGE}-*.pkg
done

elif test -n "${FEDORA_VERSION}";
then
CONTAINER_NAME="fedora${FEDORA_VERSION}";

docker pull registry.fedoraproject.org/fedora:${FEDORA_VERSION};

docker run --name=${CONTAINER_NAME} --detach -i registry.fedoraproject.org/fedora:${FEDORA_VERSION};

docker exec ${CONTAINER_NAME} dnf install -y dnf-plugins-core;

TRACK=${TRAVIS_BRANCH/master/stable};

docker exec ${CONTAINER_NAME} dnf copr -y enable @gift/${TRACK};

if test ${TRAVIS_PYTHON_VERSION} = "2.7";
then
docker exec ${CONTAINER_NAME} dnf install -y git python2 python2-plaso;
else
docker exec ${CONTAINER_NAME} dnf install -y git python3 python3-plaso;
fi

elif test ${TRAVIS_OS_NAME} = "linux";
then
TRACK=${TRAVIS_BRANCH/master/stable};

sudo add-apt-repository ppa:gift/${TRACK} -y;
sudo apt-get update -q;

if test ${TRAVIS_PYTHON_VERSION} = "2.7";
then
sudo apt-get install -y ${PYTHON2_DEPENDENCIES};
else
sudo apt-get install -y ${PYTHON3_DEPENDENCIES};
fi
fi
35 changes: 35 additions & 0 deletions utils/travis_script.sh
@@ -0,0 +1,35 @@
#!/bin/bash
#
# Script to run tests on Travis CI.

# Exit on error.
set -e;

if test "${TARGET}" = "pylint2" || test "${TARGET}" = "pylint3";
then
pylint --version;
git clone https://github.com/log2timeline/plaso.git;
cd plaso && find plaso/lib -name \*.py -exec pylint --rcfile=${PWD}/.pylintrc {} \;

elif test ${TRAVIS_OS_NAME} = "osx";
then
git clone https://github.com/log2timeline/plaso.git;
cd plaso && /System/Library/Frameworks/Python.framework/Versions/2.7/bin/python ./utils/check_dependencies.py;

elif test -n "${FEDORA_VERSION}";
then
CONTAINER_NAME="fedora${FEDORA_VERSION}";

docker exec "${CONTAINER_NAME}" sh -c "git clone https://github.com/log2timeline/plaso.git";

if test ${TRAVIS_PYTHON_VERSION} = "2.7";
then
docker exec "${CONTAINER_NAME}" sh -c "cd plaso && python2 utils/check_dependencies.py";
else
docker exec "${CONTAINER_NAME}" sh -c "cd plaso && python3 utils/check_dependencies.py";
fi

else
git clone https://github.com/log2timeline/plaso.git;
cd plaso && ./utils/check_dependencies.py;
fi

0 comments on commit 94cea2a

Please sign in to comment.