diff --git a/.gitignore b/.gitignore index dbd8604..351a788 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,6 @@ group_vars/netstat group_vars/moc hosts + +.vagrant/* +ubuntu-xenial-16.04-cloudimg-console.log diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..609e774 --- /dev/null +++ b/Makefile @@ -0,0 +1,10 @@ +clean: + @vagrant destroy --force + +test: + for i in "validator" "explorer" "moc" "bootnode" "netstat"; do \ + echo "Verifying $$i..\n"; \ + vagrant up $$i; \ + vagrant destroy --force $$i; \ + echo "Done $$i verification\n"; \ + done diff --git a/Vagrantfile b/Vagrantfile new file mode 100644 index 0000000..c6425d1 --- /dev/null +++ b/Vagrantfile @@ -0,0 +1,44 @@ + +ENV["LC_ALL"] = "en_US.UTF-8" + +Vagrant.configure("2") do |config| + + servers = [ "validator", "explorer", "moc", "bootnode", "netstat" ] + + if ENV["poa_platform"] == "ubuntu" + platform = "ubuntu/xenial64" + elsif ENV["poa_platform"] == "centos" + platform = "centos/7" + else + platform = "ubuntu/xenial64" + end + + servers.each do |machine| + config.vm.define machine do |node| + node.vm.box = platform + node.vm.hostname = machine + + node.vm.provision :ansible do |ansible| + ansible.playbook = "site.yml" + ansible.groups = { + "validator" => ["validator"], + "explorer" => ["explorer"], + "netstat" => ["netstat"], + "moc" => ["moc"], + "bootnode" => ["bootnode"] + } + end + + node.vm.provision :shell do |shell| + shell.path = "./tests/#{machine}.sh" + end + end + end + + config.vm.provider "virtualbox" do |vb| + vb.memory = 1024 + vb.cpus = 1 + vb.linked_clone = true + end + +end diff --git a/tests/bootnode.sh b/tests/bootnode.sh new file mode 100644 index 0000000..820345e --- /dev/null +++ b/tests/bootnode.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +echo "This is a stub for bootnode integration tests" diff --git a/tests/explorer.sh b/tests/explorer.sh new file mode 100644 index 0000000..0d7a4c6 --- /dev/null +++ b/tests/explorer.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +echo "This is a stub for explorer integration tests" diff --git a/tests/moc.sh b/tests/moc.sh new file mode 100644 index 0000000..e323f60 --- /dev/null +++ b/tests/moc.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +echo "This is a stub for moc integration tests" diff --git a/tests/netstat.sh b/tests/netstat.sh new file mode 100644 index 0000000..eea0166 --- /dev/null +++ b/tests/netstat.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +echo "This is a stub for netstat integration tests" diff --git a/tests/validator.sh b/tests/validator.sh new file mode 100644 index 0000000..578b5cf --- /dev/null +++ b/tests/validator.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +echo "This is a stub for validator integration tests"