freezer/tests/scenario
Zahari Zahariev 8e3a5cf8ca Functional tests and Vagrant environment
Proposed environment utilizes Vagrant that works with KVM or
Virtualbox based VM that runs Swift storage node. There are
two major run scripts. Rhe first one run-remote.sh will expect
successfully setup of the Swift VM. Then rsync freezer directory
to the VM and finally execute remotely via SSH run-local.py script
that will create LVM volume and mount it so the functional tests
could be facilitated.

Regular file system (non LVM) and LVM snapshot non incremental
backup tests are included in this commit as the most common usecase.

BLUEPRINT: functional-testing
Change-Id: Ia9c1e2e770ca413fe4a896dd0a55c4babf3df686
2015-03-30 14:35:35 +01:00
..
vagrant-scripts Functional tests and Vagrant environment 2015-03-30 14:35:35 +01:00
README.txt Functional tests and Vagrant environment 2015-03-30 14:35:35 +01:00
Vagrantfile Functional tests and Vagrant environment 2015-03-30 14:35:35 +01:00
__init__.py Functional tests and Vagrant environment 2015-03-30 14:35:35 +01:00
backup_scenario.py Functional tests and Vagrant environment 2015-03-30 14:35:35 +01:00
prepare-vagrant.sh Functional tests and Vagrant environment 2015-03-30 14:35:35 +01:00
run-local.py Functional tests and Vagrant environment 2015-03-30 14:35:35 +01:00
run-remote.sh Functional tests and Vagrant environment 2015-03-30 14:35:35 +01:00
swiftrc.sample Functional tests and Vagrant environment 2015-03-30 14:35:35 +01:00

README.txt

Freezer Scenario Functional Testing
====================================

The most straight forward way to set up the Freezer functional testing
environment is by utilizing VAGRANT. There is initial Vagrant file that
by default is setup to work with Virtualbox and Ubuntu 14.04 as virtual
machine OS.

In order to prepare your Vagrant + VirtualBox/KVM environment there is:

  $ ./prepare-vagrant.sh

The script is tested to work on Ubuntu and will automatically download
and deploy Vagrant, VirtualBox, KVM and libvrt as well as mutate Vagrant
plugins. It will also download a base Ubuntu 14.04 64bit Vagrant box and
use mutate plugin to deoplu a libvrt version for KVM use.

Before running 'vagrant up' for the first time make sure you have replaced
the 'P-R-O-X-Y' string (Vagrant file) with the correct HTTP proxy URL and
port if behind one e.g. P-R-O-X-Y => http://proxy.test.company.com:3344

To start the process of MV deployment run:

  $ vagrant destroy -f #This will delete any previosly deployed instances
  $ vagrant up #This kick starts the Devstack Swift VM that tests use

When process is done normalyy it take 10 - 20 min depends on your network.
You should have a fully configured Swift object storage VM that is
accessible on a host only IP e.g 10.199.199.199

Copy file swiftrc.sample to swiftrc and edited properly should you need to.

Next you need to decide weather you want to perform the integration tests
locally on your station or into the Vagrant VM. There are two scripts to
do just that:

   $ ./run-local.py
   $ ./run-remote.sh

The first of them will setup loopback LVM disk that your Freezer scenario
tests will need and mount it in /mnt.
The second will create the LVM disk in the Vagrant virtual machine and will
synchronize all Freezer files to the VM as well where it is going to trigger
the integration test.

Successful test run should look something similar to this:

............
test_lvm_level0 (backup_scenario.BackupScenarioFS) ... ok
test_no_lvm_level0 (backup_scenario.BackupScenarioFS) ... ok
test_utils_methods (backup_scenario.BackupScenarioFS) ... ok

----------------------------------------------------------------------
Ran 3 tests in 2.696s

OK