Use-case: Testing different rsync version

Hello,
I’m new to the “system testing” topic but was pointed to “Vagrant” as a possible solution.

And now I have use-case maybe solvable via Vagrant. My question isn’t about how to solve but only if Vagrant is right for that use-case or maybe it is to much or to less or to exotic?

Currently I do the “tests” manually.
I have 4 virtual machines (VirtualBox). Two running Debian 11 and two Debian 12. The important difference here is that one use rsync version 3.2.3 and the other 3.2.5.
My test is: Running a script using rsync and transfer files/folders from one machine over SSH to another and check if the transfer is complete and without errors.

One Debian 10 runs an ssh server and the other runs the script using rsync. The same for the Debian 11 machine pair.

Can I solve that with Vagrant to automate that and get a complete report somewhere after the test is finished?

Hey there,

I would say you can definitely use Vagrant to automate testing this. However, Vagrant isn’t designed to run tests, so there isn’t builtin functions for doing things like reporting. Vagrant does give you a cli and easy to use interface for manipulating Virtual Machines. So, if you want to automate this kind of test that might look like:

  1. write some Vagrantfiles that define your machines. Maybe this looks something like:
Vagrant.configure("2") do |config|
  config.vm.define "debian11_one" do |d|
    d.vm.box = "mydebian11box"
   d.vm.provision "shell", inline: "install my deps"
  end

  config.vm.define "debian12_one" do |d|
    d.vm.box = "mydebian12box"
    d.vm.provision "shell", inline: "install my deps"
  end
...
end
  1. write the tests + reporting (bash script, python script, etc)
  2. maybe add a provisioner to the Vagrantfile that runs the test. Something like:
Vagrant.configure("2") do |config|
   ...
  config.vm.provision "shell", name: "mytest", path: "path/to/test/script", run: "never"

Then you might run these tests in a few steps:

$ vagrant up    # brings up the Vagrant machines and provisions them with the defined provisioners (not the one called "mytest")
$ vagrant provision debian11_one --provision-with mytest    # runs the test on debian11
$ vagrant provision debian12_one --provision-with mytest    # runs the test on debian12

This is a pretty vague example of how Vagrant can be used to run tests. And there are many other ways to solve this depending on your requirements. See the Vagrant documentation for more information on Vagrant’s capabilities. Happy to answer more specific questions!