Skip to content

Commit

Permalink
CI: 2 Analyzer 1 Agent
Browse files Browse the repository at this point in the history
  • Loading branch information
nplanel committed Jul 27, 2018
1 parent 3824ae2 commit 3d4da0e
Showing 1 changed file with 29 additions and 12 deletions.
41 changes: 29 additions & 12 deletions scripts/ci/run-vagrant-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ fi

cd contrib/vagrant

export ANALYZER_COUNT=1
export ANALYZER_COUNT=2
export AGENT_COUNT=1
export SKYDIVE_RELEASE=master

Expand All @@ -54,17 +54,18 @@ function run_functional_tests {
rsync -av -e 'ssh -F vagrant-ssh-config' $root/tests/pcaptraces agent1:
AGENT1_IP=$(vagrant ssh-config agent1 | grep HostName | awk '{print $2}')
ANALYZER1_IP=$(vagrant ssh-config analyzer1 | grep HostName | awk '{print $2}')
ANALYZER2_IP=$(vagrant ssh-config analyzer2 | grep HostName | awk '{print $2}')

vagrant ssh agent1 -c 'for i in $(find /proc/sys/net/bridge/ -type f) ; do echo 0 | sudo tee $i ; done'
vagrant ssh agent1 -c 'sudo iptables -F ; sudo iptables -P FORWARD ACCEPT'

if [ "$mode" = "container" ]; then
OPT="-nooftests"
fi
vagrant ssh agent1 -c "AGENT1_IP=$AGENT1_IP SKYDIVE_ANALYZERS=\"$ANALYZER1_IP:8082\" sudo -E ./functionals -agenttestsonly -test.v $OPT"
vagrant ssh agent1 -c "AGENT1_IP=$AGENT1_IP SKYDIVE_ANALYZERS=\"$ANALYZER1_IP:8082 $ANALYZER2_IP:8082\" sudo -E ./functionals -agenttestsonly -test.v $OPT"

if [ "$mode" = "package" ]; then
for a in analyzer1 agent1; do
for a in analyzer1 analyzer2 agent1; do
echo "===== ausearch AVC on $a ======"
vagrant ssh $a -c 'sudo ausearch -m avc -r' || true
done
Expand Down Expand Up @@ -97,27 +98,43 @@ do
DEPLOYMENT_MODE=$mode vagrant up --provision-with common
DEPLOYMENT_MODE=$mode vagrant provision

vagrant ssh analyzer1 -- sudo ntpdate fr.pool.ntp.org
vagrant ssh agent1 -- sudo ntpdate fr.pool.ntp.org
for a in analyzer1 analyzer2 agent1; do
echo "$a"
vagrant ssh $a -- sudo ntpdate fr.pool.ntp.org
done

vagrant ssh analyzer1 -- sudo cat /etc/skydive/skydive.yml
for a in analyzer1 analyzer2 agent1; do
echo "$a"
vagrant ssh $a -- sudo cat /etc/skydive/skydive.yml
done

vagrant ssh analyzer1 -- sudo journalctl -n 100 -u skydive-analyzer
vagrant ssh analyzer2 -- sudo journalctl -n 100 -u skydive-analyzer
vagrant ssh agent1 -- sudo journalctl -n 100 -u skydive-agent

vagrant ssh analyzer1 -- curl http://localhost:8082
for a in analyzer1 analyzer2; do
echo "$a"
vagrant ssh $a -- curl http://localhost:8082
done

if [ "$mode" = "container" ]; then
install_skydive_from_docker_image analyzer1
install_skydive_from_docker_image agent1
for a in analyzer1 analyzer2 agent1; do
echo "$a"
install_skydive_from_docker_image $a
done
fi

if [ "$mode" = "package" ]; then
install_skydive_selinux_enforcing analyzer1
install_skydive_selinux_enforcing agent1
for a in analyzer1 analyzer2 agent1; do
echo "$a"
install_skydive_selinux_enforcing $a
done
fi

vagrant ssh analyzer1 -c 'set -e; skydive client query "g.V()"'
for a in analyzer1 analyzer2; do
echo "$a"
vagrant ssh $a -c 'set -e; skydive client query "g.V()"'
done

if [ "$mode" != "container" ]; then
sleep 10
Expand Down

0 comments on commit 3d4da0e

Please sign in to comment.