Environments

Testing on Linux is carried out with the aim of verifying that the application runs correctly and downloads the necessary packages in each supported distribution and version.
It is said as ‘environments’ because if it is a cross-platform application, it will require testing on Windows as well (and macOS).

So, with Vagrant by HashiCorp we can configure any Linux distribution and many of the versions of each one. If validations are required in Desktop versions, it will be better to use VirtualBox for that.

Below is the configuration of a virtual machine in Vagrant for execution from the Windows command line.

# -*- mode: ruby -*-
# vi: set ft=ruby :

# -> RedHat
Vagrant.configure("2") do |config|
  config.vm.define "redhat9" do |redhat9|
  redhat9.vm.provider "virtualbox" do |vb|
    vb.name = "box-redhat9"
    vb.memory = "2048"
    vb.cpus = 2	
  redhat9.vm.box = "generic/rhel9"
  redhat9.vm.hostname = "test-redhat9"
  redhat9.vm.provision "shell", 
    inline: <<-SCRIPT
      sudo yum -y update
      sudo yum -y upgrade
    SCRIPT
# redhat9.vm.network "private_network", type: "dhcp"
  redhat9.vm.synced_folder "C:/Users/antonio/Downloads", "/home/vagrant/shared"
  end
end

# --> SUSE
  config.vm.define "suse-sles12sp1" do |sles12sp1|
  sles12sp1.vm.provider "virtualbox" do |vb|
    vb.name = "Suse-SLES-12SP1"
    vb.memory = "2048"
    vb.cpus = 2	
  sles12sp1.vm.box = "wvera/sles12sp1"
  sles12sp1.vm.hostname = "test-SUSE-sles12sp1"
  sles12sp1.vm.provision "shell", 
    inline: <<-SCRIPT
      sudo zypper update --no-confirm
      sudo zypper upgrade --no-confirm
    SCRIPT
# sles12sp1.vm.network "private_network", type: "dhcp"
  sles12sp1.vm.synced_folder "C:/Users/abgro/Downloads", "/home/vagrant/shared"
  end
end

# --> Debian
  config.vm.define "debian9" do |debian9|
  debian9.vm.provider "virtualbox" do |vb|
    vb.name = "box-debian9"
    vb.memory = "2048"
    vb.cpus = 2
  debian9.vm.box = "generic/debian9"
  debian9.vm.hostname = "test-debian-9"
  debian9.vm.provision "shell", 
    inline: <<-SCRIPT
      sudo apt -y update
      sudo apt -y upgrade
    SCRIPT
# debian9.vm.network "private_network", type: "dhcp"
  debian9.vm.synced_folder "C:/Users/abgro/Downloads", "/home/vagrant/shared"
  end
end