Skip to content

Commit 64b8fe8

Browse files
committed
CI: 2 Analyzer 1 Agent
1 parent af2fd2d commit 64b8fe8

File tree

1 file changed

+31
-12
lines changed

1 file changed

+31
-12
lines changed

scripts/ci/run-vagrant-tests.sh

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ fi
3434

3535
cd contrib/vagrant
3636

37-
export ANALYZER_COUNT=1
37+
export ANALYZER_COUNT=2
3838
export AGENT_COUNT=1
3939
export SKYDIVE_RELEASE=master
4040

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

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

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

6667
if [ "$mode" = "package" ]; then
67-
for a in analyzer1 agent1; do
68+
for a in analyzer1 analyzer2 agent1; do
6869
echo "===== ausearch AVC on $a ======"
6970
vagrant ssh $a -c 'sudo ausearch -m avc -r' || true
7071
done
@@ -97,27 +98,45 @@ do
9798
DEPLOYMENT_MODE=$mode vagrant up --provision-with common
9899
DEPLOYMENT_MODE=$mode vagrant provision
99100

100-
vagrant ssh analyzer1 -- sudo ntpdate fr.pool.ntp.org
101-
vagrant ssh agent1 -- sudo ntpdate fr.pool.ntp.org
101+
for a in analyzer1 analyzer2 agent1; do
102+
echo "$a"
103+
vagrant ssh $a -- sudo ntpdate fr.pool.ntp.org
104+
done
102105

103-
vagrant ssh analyzer1 -- sudo cat /etc/skydive/skydive.yml
106+
for a in analyzer1 analyzer2 agent1; do
107+
echo "$a"
108+
vagrant ssh $a -- sudo cat /etc/skydive/skydive.yml
109+
done
104110

105111
vagrant ssh analyzer1 -- sudo journalctl -n 100 -u skydive-analyzer
112+
vagrant ssh analyzer2 -- sudo journalctl -n 100 -u skydive-analyzer
106113
vagrant ssh agent1 -- sudo journalctl -n 100 -u skydive-agent
107114

108-
vagrant ssh analyzer1 -- curl http://localhost:8082
115+
for a in analyzer1 analyzer2; do
116+
echo "$a"
117+
vagrant ssh $a -- curl http://localhost:8082/api/status
118+
vagrant ssh $a -- curl http://localhost:8082
119+
done
120+
vagrant ssh agent1 -- curl http://localhost:8081/api/status
109121

110122
if [ "$mode" = "container" ]; then
111-
install_skydive_from_docker_image analyzer1
112-
install_skydive_from_docker_image agent1
123+
for a in analyzer1 analyzer2 agent1; do
124+
echo "$a"
125+
install_skydive_from_docker_image $a
126+
done
113127
fi
114128

115129
if [ "$mode" = "package" ]; then
116-
install_skydive_selinux_enforcing analyzer1
117-
install_skydive_selinux_enforcing agent1
130+
for a in analyzer1 analyzer2 agent1; do
131+
echo "$a"
132+
install_skydive_selinux_enforcing $a
133+
done
118134
fi
119135

120-
vagrant ssh analyzer1 -c 'set -e; skydive client query "g.V()"'
136+
for a in analyzer1 analyzer2; do
137+
echo "$a"
138+
vagrant ssh $a -c 'set -e; skydive client query "g.V()"'
139+
done
121140

122141
if [ "$mode" != "container" ]; then
123142
sleep 10

0 commit comments

Comments
 (0)