Description:
As I said earlier, I started working in software development. After the Vagrant catalog has been created, it is time to write the auto-tests. For this purpose, I have chosen Robot Framework. Because it is: cross-platform, good documentation/examples, internal language, extended libraries, reports, integration with other products.
1. "Hello, World" tests
*** Settings ***
Library OperatingSystem
*** Variables ***
${NULL} "/dev/null"
*** Test Cases ***
echo to /dev/null
Log "Add string to log"
${CODE} = Run and Return RC echo "Hello, world" > ${NULL}
Should Be Equal As Integers ${CODE} 0
run /bin/false
[Documentation] "man man :)"
${CODE} = Run and Return RC /bin/false
Should Be Equal As Integers ${CODE} 0
2. Vagrant integration
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.hostmanager.enabled = true
config.hostmanager.manage_host = true
config.hostmanager.ignore_private_ip = false
config.hostmanager.include_offline = false
config.vm.synced_folder "/home/user/vagrant/share", "/vagrant"
config.vm.define "centos7" do |centos7|
centos7.vm.box_check_update = true
centos7.vm.box = "unix/centos7-amd64"
centos7.vm.box_url = "http://vagrant/catalog/unix/centos7-amd64"
centos7.vm.hostname = "centos7.testlab.test"
centos7.hostmanager.aliases = %w(centos7)
centos7.vm.network "private_network", ip: "192.168.50.42"
centos7.vm.provision "bootstrap", type: "shell", run: "always" do |s|
s.inline = "pybot -d /vagrant/autotest/result/10.1 /vagrant/autotest/test/10.1"
end
end
config.vm.provider "virtualbox" do |vb|
vb.gui = true
vb.memory = "1024"
vb.cpus = "2"
end
end