Skip to content

Commit

Permalink
vagrant for testing, idea from @jpvlsmv
Browse files Browse the repository at this point in the history
  • Loading branch information
awick committed Dec 10, 2014
1 parent 044cefd commit 775262c
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 0 deletions.
32 changes: 32 additions & 0 deletions tests/Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|

config.vm.provider "virtualbox" do |vb|
vb.customize ["modifyvm", :id, "--memory", "1500"]
end

config.vm.define "ubuntu-12.04" do |ubuntu120464|
ubuntu120464.vm.box = "ubuntu/precise64"
end

config.vm.define "ubuntu-14.04" do |ubuntu140464|
ubuntu140464.vm.box = "ubuntu/trusty64"
end

config.vm.define "centos-5" do |centos645|
centos645.vm.box = "chef/centos-5.11"
end

config.vm.define "centos-6" do |centos646|
centos646.vm.box = "chef/centos-6.6"
end

config.vm.define "centos-7" do |centos647|
centos647.vm.box = "chef/centos-7.0"
end


config.vm.provision "shell", path:"node.test.sh"
end
52 changes: 52 additions & 0 deletions tests/node.test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/bin/sh

export PATH=/usr/local/bin:$PATH

# Update and install any packages required for easybutton to run
if [ -f "/etc/redhat-release" ]; then
yum -y update
if grep -q "release 5." /etc/redhat-release; then
# Centos 5 - Need EPEL for git and python26
if [ ! -f /etc/yum.repos.d/epel.repo ]; then
rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
fi
yum -y install python26
mkdir -p /usr/local/bin
ln -s /usr/bin/python26 /usr/local/bin/python
fi
yum -y install git java-1.7.0-openjdk curl psmisc perl-Test-Differences perl-TAP-Harness perl-Test-Simple
fi

if [ -f "/etc/debian_version" ]; then
apt-get -y upgrade
apt-get -y install git openjdk-7-jre-headless curl libtest-differences-perl libhttp-message-perl
fi


# Cleanup anything left around if just running script agian
curl -s -XPOST http://127.0.0.1:9200/_shutdown
/bin/rm -rf /data/moloch
killall -q node moloch-capture

if [ -d moloch.github ]; then
(cd moloch.github ; git pull)
else
git clone https://github.com/aol/moloch moloch.github
fi

# Build using easy button
cd moloch.github
echo -e 'no\n128M\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n' | ./easybutton-singlehost.sh
sleep 1

# Easy button starts stuff, kill it :)
killall -q node moloch-capture
sleep 1


# Run the tests out of the moloch.github dir
cd tests
(cd ../capture/plugins/wiseService; npm install)
(cd ../viewer; npm install)
./tests.pl
./tests.pl --viewer

0 comments on commit 775262c

Please sign in to comment.