-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
86 lines (75 loc) · 3.19 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
---
dist: bionic
language: python
python:
- "3.8"
# Cache the big Vagrant boxes
cache:
directories:
- /home/travis/.vagrant.d/boxes
install:
# Install libvrt & KVM (see https://github.com/alvistack/ansible-role-virtualbox/blob/master/.travis.yml)
- sudo apt-get update && sudo apt-get install -y bridge-utils dnsmasq-base ebtables libvirt-bin libvirt-dev qemu-kvm qemu-utils ruby-dev
# Unfortunately, newgrp doens't work, as travis-ci will hang
#- sudo adduser travis libvirt
#- newgrp libvrt
- sudo chmod o+rwx /var/run/libvirt/libvirt-sock
# Download Vagrant & Install Vagrant package
- sudo wget -nv https://releases.hashicorp.com/vagrant/2.2.14/vagrant_2.2.14_x86_64.deb
- sudo dpkg -i vagrant_2.2.14_x86_64.deb
# Vagrant correctly installed?
- vagrant --version
# Install vagrant-libvirt Vagrant plugin
- vagrant plugin install vagrant-libvirt
- find ~/.vagrant.d/gems/
# Install required (and locked) dependecies with pipenv
- pip install pipenv
- pipenv install --dev
before_script:
- cd tests
- vagrant box update
- make -j -e PROVIDER=libvirt setup
script:
- make -k tests
after_failure:
# Some useful information in case the tests fail
- pip list
- vagrant ssh -c "ip addr show" ns
- vagrant ssh -c "ip addr show" sut
- vagrant ssh -c "ip addr show" client
- vagrant ssh -c "ip addr show" mail-sink
- vagrant ssh -c "dig mydomain.test MX" client
- vagrant ssh -c "ping -c 3 192.168.56.10" client
- vagrant ssh -c "sudo journalctl --no-pager -n 50 -u named" ns
- vagrant ssh -c "systemctl --no-page list-units --type=service" sut
- vagrant ssh -c "sudo journalctl --no-pager -n 50 -u clamd" sut
- vagrant ssh -c "sudo journalctl --no-pager -n 50 -u postfix" sut
- vagrant ssh -c "sudo journalctl --no-pager -n 50 -u rspamd" sut
- vagrant ssh -c "sudo journalctl --no-pager -n 50 -u dovecot" sut
# Mmh.... don't know yet how to deal with copyright notice when using
# open sourced code snippets and where to put the license header.
#
# Source:
# https://github.com/jonashackt/vagrant-travisci-libvrt/blob/2b02f3f3f47b6f0671dbbc54fa940aa9595d410a/.travis.yml
#
# MIT License
#
# Copyright (c) 2020 Jonas Hecht
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.