Backup-Restore support library + tests 65/55165/15
authorDiego Granados <diego.jesus.granados.lopez@ericsson.com>
Tue, 18 Apr 2017 15:04:18 +0000 (17:04 +0200)
committerJamo Luhrsen <jluhrsen@redhat.com>
Fri, 12 May 2017 23:19:07 +0000 (23:19 +0000)
commita812b3914258db8969e0b3a195893b48421fdcfb
tree94736c0f565f69f75028fb1f20ff007c30de77d4
parent1664e7597bb2ce5ca11ff64f6e643cb62f507a2c
Backup-Restore support library + tests

The purpose of this library is to support the generic verification
of feature correctness in backup + restore scenarios.

A library is correct from a backup+restore standpoint when,
at any provisioning point, a controller backup, followed by
a restore, can be performed, and the execution of that
procedure will not have any impact on traffic tests or
datastore state check in respect to the expected behaviour
when no backup + restore procedures are performed.

For doing so, the library provides:

- A new keyword (BackupRestoreCheck), which:
  1) Performs a complete datastore export (using Daexim export rpc)
  2) Performs a backup, then a restore (not actual script here,
     since backup&restore mechanisms are deployment - dependant; a
     placeholder is provided for this step)
  3) Performs a new datastore export
  4) Compares both config & operational datastores for differences
     (that is, pre-backup and post-restore exports for both datastores),
     optionally prefiltering those exports using pre-filter files
  5) Fails when pre-backup and post-restore exports are different
     even after removing the specified filtered parts

- A new keyword (ConditionalBackupRestoreCheck), which performs
  the same steps than BackupRestoreCheck only when a command-line flag
  ("-v BR_TESTING_ENABLED:true") is present. This allows to easily
  add backup-restore verification on existing tests, allowing to
  toggle the execution of that verification

- Some unit tests for the library

jsonpatch library (https://pypi.python.org/pypi/jsonpatch) is expected to
be installed in order for this library to work

Note: for additional details regarding this lib, please check the
README.txt file included in the commit

Change-Id: Iad758ddc362cec319c7e843c1a6e4fcf728dad10
Signed-off-by: Diego Granados <diego.jesus.granados.lopez@ericsson.com>
28 files changed:
csit/libraries/BackupRestoreKeywords.robot [new file with mode: 0644]
csit/libraries/DaeximKeywords.robot
csit/libraries/backuprestore/JsonDiffTool.py [new file with mode: 0644]
csit/libraries/backuprestore/README.txt [new file with mode: 0644]
csit/libraries/backuprestore/backuprestoretest.py [new file with mode: 0644]
csit/libraries/backuprestore/jsonpathl.py [new file with mode: 0644]
csit/libraries/backuprestore/testinput/arrayThreeNamesSorted.json [new file with mode: 0644]
csit/libraries/backuprestore/testinput/arrayTwoNames.json [new file with mode: 0644]
csit/libraries/backuprestore/testinput/arrayTwoNamesCopy.json [new file with mode: 0644]
csit/libraries/backuprestore/testinput/arrayTwoNamesReversed.json [new file with mode: 0644]
csit/libraries/backuprestore/testinput/filterThreeArray.conf [new file with mode: 0644]
csit/libraries/backuprestore/testinput/mainTestCase/json_postfilter.conf [new file with mode: 0644]
csit/libraries/backuprestore/testinput/mainTestCase/json_prefilter.conf [new file with mode: 0644]
csit/libraries/backuprestore/testinput/mainTestCase/json_prefilter_two_matches.conf [new file with mode: 0644]
csit/libraries/backuprestore/testinput/mainTestCase/json_prefilter_zero_matches.conf [new file with mode: 0644]
csit/libraries/backuprestore/testinput/mainTestCase/odl_backup_operational_after.json [new file with mode: 0644]
csit/libraries/backuprestore/testinput/mainTestCase/odl_backup_operational_before.json [new file with mode: 0644]
csit/libraries/backuprestore/testinput/patchAfter.json [new file with mode: 0644]
csit/libraries/backuprestore/testinput/patchBefore.json [new file with mode: 0644]
csit/libraries/backuprestore/testinput/patchReference.json [new file with mode: 0644]
csit/libraries/backuprestore/testinput/setTwoNames.json [new file with mode: 0644]
csit/libraries/backuprestore/testinput/setTwoNamesExtraAttrib.json [new file with mode: 0644]
csit/libraries/backuprestore/testinput/setTwoNamesReversed.json [new file with mode: 0644]
csit/suites/backuprestore/br-basic/010__br_library_keywords.robot [new file with mode: 0644]
csit/suites/backuprestore/br-basic/020__br_sfc_tests.robot [new file with mode: 0644]
csit/variables/backuprestore/BackupRestoreVariables.robot [new file with mode: 0644]
csit/variables/backuprestore/json_prefilter.conf [new file with mode: 0644]
csit/variables/backuprestore/json_prefilter_matching_basic.json [new file with mode: 0644]