Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for stored snapshot -- Fix #132 #172

Merged
merged 6 commits into from
Sep 26, 2016

Conversation

eeishaan
Copy link
Contributor

@eeishaan eeishaan commented Sep 21, 2016

Fix #132
Added support for stored snapshot.

Usage:

  1. First one needs to create a snapshot
    jsnapy --snap STORED -f config.yml
  2. To run snapcheck on this stored snapshot from command line, use --local parameter
    jsnapy --snapcheck STORED -f config.yml --local
  3. One can also specify the stored snapshots' name in the configuration file as follows:
hosts:
  - device: 10.216.193.114
    username : abc
    passwd: xyz
tests:
  - delta.yml
local:
  - STORED
  - STORED_42
  - STORED_314
sqlite:
  - store_in_sqlite: no
    check_from_sqlite: no
    database_name: jbb.db
    compare: 0,1

Things to Note:

  1. The devices and the various commands passed in the configuration file passed should match with the ones passed to the tool while capturing the snapshot. One can modify the various test operators.
  2. If a user wants to run local snapcheck on his own xml file, he need to modify the name of that xml to the format given below, place it in the snapshots directory and modify the configuration file accordingly.
    hostname_snapname_command.xml
    or
    hostname_snapname_rpc.xml

For module version:

  1. One needs to pass additional parameter local=True while calling snapcheck() to use local snapcheck. The snapname passed is considered as the local snapshot to run snapcheck on, just like the command line. This parameter is not required if the configuration file contains the list of snapshot names as above.
  2. The configuration file support for local as expected is also baked in.
  3. Return Types:
  4. If one specifies the local keyword in the configuration file, then the snapcheck() function returns a list of dictionary, where the dictionary is keyed with the various snapnames passed and the value is an Operator object which contains the test details.
  5. In every other case, a list of Operator object which contains the test details is returned

@vnitinv vnitinv merged commit 6a9e6cb into Juniper:master Sep 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants