Commit 25e17f63 authored by Swann Perarnau's avatar Swann Perarnau
Browse files

Add support for running tests inside Vagrant box

This commit adds:
- a Vagrantfile to build an ubuntu-based virtual machine including
everything required to test yggdrasil+taktuk
- the basic ssh configuration needed for those tests to succeed. The
password-less ssh key is garbage and should not be used for anything
else.

All the tests work at this point.
parent f2034496
# -*- mode: ruby -*-
# vi: set ft=ruby :
$bootstrap = <<SCRIPT
# install core dependencies
apt-get update
apt-get install -y taktuk python3 python3-zmq python3-pexpect python3-setuptools python3-pip
# install main repo
cd /yggdrasil/yggdrasil.*
pip3 install -e .
# user libraries
cd /yggdrasil/yggdrasil-c.*/c_wrapper
cp ./install/include/* /usr/include/
cp ./install/lib/* /usr/lib/
# etc/hosts
echo "127.0.0.1 A" >> /etc/hosts
echo "127.0.0.1 B" >> /etc/hosts
echo "127.0.0.1 C" >> /etc/hosts
echo "127.0.0.1 D" >> /etc/hosts
echo "127.0.0.1 E" >> /etc/hosts
echo "127.0.0.1 F" >> /etc/hosts
echo "127.0.0.1 G" >> /etc/hosts
echo "127.0.0.1 H" >> /etc/hosts
echo "127.0.0.1 I" >> /etc/hosts
echo "127.0.0.1 J" >> /etc/hosts
SCRIPT
$userconfig = <<SCRIPT
# ssh config
cd /yggdrasil/yggdrasil-integration.*
cat ssh/id_rsa.pub >> ~/.ssh/authorized_keys
cp ssh/id_rsa* ~/.ssh/
cp ssh/config ~/.ssh/
chmod 600 ~/.ssh/id_rsa
SCRIPT
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Every Vagrant development environment requires a box. You can search for
# boxes at https://atlas.hashicorp.com/search.
config.vm.box = "ubuntu/xenial64"
config.vm.synced_folder "../", "/yggdrasil"
config.vm.hostname = "A"
config.vm.define "A" do |node|
node.vm.network "private_network", ip: "192.168.0.10"
node.vm.provision :shell, inline: $bootstrap
node.vm.provision :shell, privileged: false, inline: $userconfig
end
end
Host *
UserKnownHostsFile /dev/null
StrictHostKeyChecking no
L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Kx3FICPG9glNToc0FZWZbKHXhg3eeWp4V//cl0CgYEAmhaA3C+nD6zfr6IlEvpM
E6mHOFxPlq/4ii/OGx6FpXbWI2xVWPvMrSnMwF2b5uKQZmtjFDTdx0OCbNQfCYJ5
BobDbRzfdGAEsUcR17domhl5iVsu7Ed9UCFS0eGI+WF6AzHAU4jG6SYuz/GdVDi4
dryCKs9lJjErNv4h5M4SZ6sCgYBuLkTRTOb5fGOUHQhcUW74b3TtzHwd6qzNc+HW
O0HMDHjLeX4Lna7hDj0Xs/Yjqet+ma6L+UIrI8D97GCHVqho+7d3JviGQ9eNOA/s
x4k1buQ7OSNpnuR0MM7TWRuQlxU7IJVZ+mktPBnagwC7drUEpaQ9+GkqYN4H1cJj
JeqpVQKBgHPts49kYKi/ZqnYsDejWA5uUgYRF34Lf+quuacjD/1vgNk7wV6UlGAf
grCDMpr2XpAbRzaPVGRa1YGvyXgMERY84Dop+LNdPC3nm+QC73K8D8wbZQIvrdBP
ev3KLgyuYOI+flLkMccuQsBe9rJAs/F81PVJPReLRnI0hiMpU3mM
-----END RSA PRIVATE KEY-----
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCVoMW0qWhNFUJSGOymTazIOsYleXVdbAAwTr0F7ge4W1T2ozAh2a79Y7/MZD3eBSTBGbLf4Bqddyj8eTDfldb1mabmTq0aQPB0YwSijjBrC2HJwcs1rf+i7GytYCduQetjGooRLUEdGh396nHQUSINk8CFMkjURLIgnDSeeKJyLxK14fSbGlb9Rzwgc5RhWBVlWYlhtiU809oB+yCBZ9w07OesFeYK5yyxEd6BIoyJRWCCWl2m4tOkze0d0nu0bIJd5BP6XUwVSYjDI7uWeN7lfB2hXQB5Lw4kXEesJBsJeWRxuL1YA1NOGXJMNWbv5R+P/+YzbiHDVqehwru6dC0L perarnau@sakura
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment