Skip to content

Commit

Permalink
Merge branch 'develop' into canonical_interface
Browse files Browse the repository at this point in the history
  • Loading branch information
itdependsnetworks authored Nov 16, 2017
2 parents 4bb8673 + a04c348 commit b2d2bfa
Show file tree
Hide file tree
Showing 214 changed files with 1,194 additions and 3,946 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ coverage.xml

# Sphinx documentation
docs/_build/
docs/_static/

.idea
.DS_Store
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[![PyPI](https://img.shields.io/pypi/v/napalm.svg)](https://pypi.python.org/pypi/napalm)
[![Build Status](https://travis-ci.org/napalm-automation/napalm.svg?branch=master)](https://travis-ci.org/napalm-automation/napalm)
[![Coverage Status](https://coveralls.io/repos/github/napalm-automation/napalm/badge.svg)](https://coveralls.io/github/napalm-automation/napalm)


NAPALM
Expand Down
43 changes: 16 additions & 27 deletions docs/cli.rst
Original file line number Diff line number Diff line change
Expand Up @@ -137,27 +137,16 @@ The debugging mode is also quite useful and it's recommended you use it to repor
2017-08-15 15:14:23,527 - napalm - DEBUG - Starting napalm's debugging tool
2017-08-15 15:14:23,527 - napalm - DEBUG - Gathering napalm packages
2017-08-15 15:14:23,541 - napalm - DEBUG - napalm-ansible==0.7.0
2017-08-15 15:14:23,541 - napalm - DEBUG - napalm-base==0.24.3
2017-08-15 15:14:23,541 - napalm - DEBUG - napalm-eos==0.6.0
2017-08-15 15:14:23,541 - napalm - DEBUG - napalm-fortios==0.4.0
2017-08-15 15:14:23,541 - napalm - DEBUG - napalm-ios==0.7.0
2017-08-15 15:14:23,541 - napalm - DEBUG - napalm-iosxr==0.5.4
2017-08-15 15:14:23,541 - napalm - DEBUG - napalm-junos==0.12.0
2017-08-15 15:14:23,541 - napalm - DEBUG - napalm-nxos==0.6.0
2017-08-15 15:14:23,541 - napalm - DEBUG - napalm-panos==0.4.0
2017-08-15 15:14:23,541 - napalm - DEBUG - napalm-pluribus==0.5.1
2017-08-15 15:14:23,542 - napalm - DEBUG - napalm-ros==0.2.2
2017-08-15 15:14:23,542 - napalm - DEBUG - napalm-vyos==0.1.3
2017-08-15 15:14:23,542 - napalm - DEBUG - napalm==1.2.0
2017-08-15 15:14:23,542 - napalm - DEBUG - napalm==2.0.0
2017-08-15 15:14:23,542 - napalm - DEBUG - get_network_driver - Calling with args: ('eos',), {}
2017-08-15 15:14:23,551 - napalm - DEBUG - get_network_driver - Successful
2017-08-15 15:14:23,551 - napalm - DEBUG - __init__ - Calling with args: (<class 'napalm_eos.eos.EOSDriver'>, 'localhost', 'vagrant'), {'password': u'*******', 'optional_args': {u'port': 12443}, 'timeout': 60}
2017-08-15 15:14:23,551 - napalm - DEBUG - __init__ - Calling with args: (<class 'napalm.eos.eos.EOSDriver'>, 'localhost', 'vagrant'), {'password': u'*******', 'optional_args': {u'port': 12443}, 'timeout': 60}
2017-08-15 15:14:23,551 - napalm - DEBUG - __init__ - Successful
2017-08-15 15:14:23,551 - napalm - DEBUG - pre_connection_tests - Calling with args: (<napalm_eos.eos.EOSDriver object at 0x105d58bd0>,), {}
2017-08-15 15:14:23,551 - napalm - DEBUG - open - Calling with args: (<napalm_eos.eos.EOSDriver object at 0x105d58bd0>,), {}
2017-08-15 15:14:23,551 - napalm - DEBUG - pre_connection_tests - Calling with args: (<napalm.eos.eos.EOSDriver object at 0x105d58bd0>,), {}
2017-08-15 15:14:23,551 - napalm - DEBUG - open - Calling with args: (<napalm.eos.eos.EOSDriver object at 0x105d58bd0>,), {}
2017-08-15 15:14:23,586 - napalm - DEBUG - open - Successful
2017-08-15 15:14:23,586 - napalm - DEBUG - connection_tests - Calling with args: (<napalm_eos.eos.EOSDriver object at 0x105d58bd0>,), {}
2017-08-15 15:14:23,587 - napalm - DEBUG - get_facts - Calling with args: (<napalm_eos.eos.EOSDriver object at 0x105d58bd0>,), {}
2017-08-15 15:14:23,586 - napalm - DEBUG - connection_tests - Calling with args: (<napalm.eos.eos.EOSDriver object at 0x105d58bd0>,), {}
2017-08-15 15:14:23,587 - napalm - DEBUG - get_facts - Calling with args: (<napalm.eos.eos.EOSDriver object at 0x105d58bd0>,), {}
2017-08-15 15:14:23,622 - napalm - DEBUG - Gathered facts:
{
"os_version": "4.15.2.1F-2759627.41521F",
Expand Down Expand Up @@ -188,28 +177,28 @@ The debugging mode is also quite useful and it's recommended you use it to repor
"fqdn": "myhost"
}
2017-08-15 15:14:23,622 - napalm - DEBUG - get_facts - Successful
2017-08-15 15:14:23,622 - napalm - DEBUG - load_merge_candidate - Calling with args: (<napalm_eos.eos.EOSDriver object at 0x105d58bd0>,), {'filename': 'new_config.txt'}
2017-08-15 15:14:23,622 - napalm - DEBUG - load_merge_candidate - Calling with args: (<napalm.eos.eos.EOSDriver object at 0x105d58bd0>,), {'filename': 'new_config.txt'}
2017-08-15 15:14:23,894 - napalm - ERROR - load_merge_candidate - Failed: Error [1000]: CLI command 3 of 5 'hostname a_new-hostname' failed: could not run command [ Host name is invalid. Host name must contain only alphanumeric characters, '.' and '-'.
It must begin and end with an alphanumeric character.]

================= Traceback =================

Traceback (most recent call last):
File "/Users/dbarroso/.virtualenvs/napalm/bin/napalm", line 11, in <module>
load_entry_point('napalm-base', 'console_scripts', 'napalm')()
File "/Users/dbarroso/workspace/napalm/napalm-base/napalm_base/clitools/cl_napalm.py", line 285, in main
load_entry_point('napalm', 'console_scripts', 'napalm')()
File "/Users/dbarroso/workspace/napalm/napalm/napalm.base/clitools/cl_napalm.py", line 285, in main
run_tests(args)
File "/Users/dbarroso/workspace/napalm/napalm-base/napalm_base/clitools/cl_napalm.py", line 270, in run_tests
File "/Users/dbarroso/workspace/napalm/napalm/napalm.base/clitools/cl_napalm.py", line 270, in run_tests
configuration_change(device, args.config_file, args.strategy, args.dry_run)
File "/Users/dbarroso/workspace/napalm/napalm-base/napalm_base/clitools/cl_napalm.py", line 224, in configuration_change
File "/Users/dbarroso/workspace/napalm/napalm/napalm.base/clitools/cl_napalm.py", line 224, in configuration_change
strategy_method(device, filename=config_file)
File "/Users/dbarroso/workspace/napalm/napalm-base/napalm_base/clitools/cl_napalm.py", line 27, in wrapper
File "/Users/dbarroso/workspace/napalm/napalm/napalm.base/clitools/cl_napalm.py", line 27, in wrapper
r = func(*args, **kwargs)
File "/Users/dbarroso/workspace/napalm/napalm-base/napalm_base/clitools/cl_napalm.py", line 202, in call_load_merge_candidate
File "/Users/dbarroso/workspace/napalm/napalm/napalm.base/clitools/cl_napalm.py", line 202, in call_load_merge_candidate
return device.load_merge_candidate(*args, **kwargs)
File "/Users/dbarroso/workspace/napalm/napalm-eos/napalm_eos/eos.py", line 176, in load_merge_candidate
File "/Users/dbarroso/workspace/napalm/napalm-eos/napalm.eos/eos.py", line 176, in load_merge_candidate
self._load_config(filename, config, False)
File "/Users/dbarroso/workspace/napalm/napalm-eos/napalm_eos/eos.py", line 168, in _load_config
File "/Users/dbarroso/workspace/napalm/napalm-eos/napalm.eos/eos.py", line 168, in _load_config
raise MergeConfigException(e.message)
napalm_base.exceptions.MergeConfigException: Error [1000]: CLI command 3 of 5 'hostname a_new-hostname' failed: could not run command [ Host name is invalid. Host name must contain only alphanumeric characters, '.' and '-'.
napalm.base.exceptions.MergeConfigException: Error [1000]: CLI command 3 of 5 'hostname a_new-hostname' failed: could not run command [ Host name is invalid. Host name must contain only alphanumeric characters, '.' and '-'.
It must begin and end with an alphanumeric character.]
2 changes: 1 addition & 1 deletion docs/contributing/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The best way to propose a new method is as follows to send a PR with the propose
In addition, before merging we will want an implementation for any driver of your choice.

For example:
- `get_config proposal <https://github.com/napalm-automation/napalm-base/pull/69/files>`_ - That particular example had an issue that some had raised as a reference but that's not mandatory. You can create an issue first but that's optional.
- `get_config proposal <https://github.com/napalm-automation/napalm/pull/69/files>`_ - That particular example had an issue that some had raised as a reference but that's not mandatory. You can create an issue first but that's optional.
- `get_config implementation for EOS <https://github.com/napalm-automation/napalm-eos/pull/38/files>`_ - Before the PR was merged an implementation was provided as a proof of concept. This is mandatory. This PRs doesn't have to arrive at the same time as the previous one but it will be required. Note that the rules for "`Implementing an already defined method`_" apply to this PR.

Implementing an already defined method
Expand Down
1 change: 1 addition & 0 deletions docs/development/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ Some useful information for development purposes.
:maxdepth: 1

testing_framework
triage
14 changes: 7 additions & 7 deletions docs/development/testing_framework.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ________

The testing framework has the following features:

1. Same tests across all vendors. Tests defined in ``napalm_base/test/getters.py`` are shared across all drivers.
1. Same tests across all vendors. Tests defined in ``napalm.base/test/getters.py`` are shared across all drivers.
2. Multiple test cases per test.
3. Target of the test can be configured with environmental variables.
4. Expected output is compared against the actual output of the test result.
Expand Down Expand Up @@ -57,17 +57,17 @@ Multiple test cases::
lots_of_peers no_peers normal
(napalm) ➜ napalm-eos git:(test_framework) ✗ py.test test/unit/test_getters.py::TestGetter::test_get_bgp_neighbors
...
test/unit/test_getters.py::TestGetter::test_get_bgp_neighbors[lots_of_peers] <- ../napalm-base/napalm_base/test/getters.py PASSED
test/unit/test_getters.py::TestGetter::test_get_bgp_neighbors[no_peers] <- ../napalm-base/napalm_base/test/getters.py PASSED
test/unit/test_getters.py::TestGetter::test_get_bgp_neighbors[normal] <- ../napalm-base/napalm_base/test/getters.py PASSED
test/unit/test_getters.py::TestGetter::test_get_bgp_neighbors[lots_of_peers] <- ../napalm/napalm.base/test/getters.py PASSED
test/unit/test_getters.py::TestGetter::test_get_bgp_neighbors[no_peers] <- ../napalm/napalm.base/test/getters.py PASSED
test/unit/test_getters.py::TestGetter::test_get_bgp_neighbors[normal] <- ../napalm/napalm.base/test/getters.py PASSED
Missing test cases::

(napalm) ➜ napalm-eos git:(test_framework) ✗ ls test/unit/mocked_data/test_get_bgp_neighbors
ls: test/unit/mocked_data/test_get_bgp_neighbors: No such file or directory
(napalm) ➜ napalm-eos git:(test_framework) ✗ py.test test/unit/test_getters.py::TestGetter::test_get_bgp_neighbors
...
test/unit/test_getters.py::TestGetter::test_get_bgp_neighbors[no_test_case_found] <- ../napalm-base/napalm_base/test/getters.py FAILED
test/unit/test_getters.py::TestGetter::test_get_bgp_neighbors[no_test_case_found] <- ../napalm/napalm.base/test/getters.py FAILED
========================================================= FAILURES ==========================================================
___________________________________ TestGetter.test_get_bgp_neighbors[no_test_case_found] ___________________________________
Expand All @@ -88,14 +88,14 @@ Missing test cases::
> pytest.fail("No test case for '{}' found".format(func.__name__))
E Failed: No test case for 'test_get_bgp_neighbors' found
../napalm-base/napalm_base/test/getters.py:64: Failed
../napalm/napalm.base/test/getters.py:64: Failed
================================================= 1 failed in 0.12 seconds ==================================================

Method not implemented::

(napalm) ➜ napalm-eos git:(test_framework) ✗ py.test test/unit/test_getters.py::TestGetter::test_get_probes_config
...
test/unit/test_getters.py::TestGetter::test_get_probes_config[no_test_case_found] <- ../napalm-base/napalm_base/test/getters.py SKIPPED
test/unit/test_getters.py::TestGetter::test_get_probes_config[no_test_case_found] <- ../napalm/napalm.base/test/getters.py SKIPPED
================================================= 1 skipped in 0.09 seconds =================================================

Expand Down
231 changes: 231 additions & 0 deletions docs/development/triage.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,231 @@
.. _triaging:

Triaging Issues and Pull Requests
=================================

.. note::

This document serves mainly as a reference for the NAPALM maintainers,
but the users are equally welcome to read this document and understand our
process, and eventually suggest improvements.

We triage Issues and Pull Requests (PR) using GitHub features only:

- :ref:`triage-labels`
- :ref:`triage-milestone`
- :ref:`triage-projects`

.. _triage-labels:

Labels
++++++

.. _triage-driver-labels:

Driver labels
-------------

Each platform supported by NAPALM has associated a label, e.g., ``junos``, ``eos``,
``ios``, ``iosxr``, ``vyos``, etc. It is mandatory that the maintainer to apply
one or more of these labels.

.. _triage-api-change-label:

``api change``
--------------

If the Issue would imply a change in the API, or the PR introduces changes in
the API. By API change we refer to changes in the getters output structure,
methods signature, or any core changes that must be uniformly introduced across
all the drivers.

.. _triage-awesome-label:

``awesome``
-----------

When someone adds or proposes something really awesome.

.. _triage-base-label:

``base``
--------

When base components are affected, e.g., `get_network_driver`, the validate
functionality, or the testing framework.

.. _triage-blocked-label:

``blocked``
-----------

Added in case we block the PR temporarly, or an Issue is currently blocked by
other internal or external factors (PRs pending to be merged, other bugs to be
solved a priori, etc.)

.. _triage-bug-label:

``bug``
-------

Whenever the behaviour reported in the Issue is different than it should, or the
PR kills a bug.

.. _triage-cannot-reproduce:

``cannot reproduce``
--------------------

This refers to Issues only, and it is added when the maintainer(s) cannot
reproduce the behaviour reported.

.. _triage-core-label:

``core``
--------

When any core components (drivers) are affected.

.. _triage-deprecation-label:

``deprecation``
---------------

Added only to PRs, when a API deprecation is introduced.

.. _triage-documentation-label:

``documentation``
-----------------

Can be added to both Issues and PRs, anything related to the documentation.

.. _triage-duplicate-label:

``duplicate``
-------------

Applicable to Issues only, to be added before closing a duplicate.

.. _triage-feature-label:

``feature``
-----------

When a new feature is introduced, or the user requests a new feature.

.. _triage-good-first-issue:

``good first issue``
--------------------

While we want to encourage the community to contribute more and more frequent,
many engineers are still afraid of complex tasks. This label marks simple fixes
that new contributors can address. It is recommended that this label to be
accompanied by an explanation and a pointer for the new contributors.

.. _triage-help-wanted:

``help wanted``
---------------

This marks an Issue were we ask the community for help, or we need more details
on a particular topic (e.g., outputs from different platforms, explanation, etc.)
from any volunteer from the community.

Once we have all the details required, the maintainer has to remove this label
even though it does not start working on it immediately.

.. _triage-high-severity-label:

``high severity``
-----------------

Whenever a :ref:`triage-bug-label` affects severely one or more features, making
it basically unusable.

.. _triage-info-needed-label:

``info needed``
---------------

We add this label when we need more details and further explanation from the user
that reports an Issue. Once we received everything needed, we can remove that
label.

.. _triage-investigation-label:

``investigation``
-----------------

We need to investigate the problem further.

.. _triage-new-driver:

``new driver``
--------------

When we discuss the possibility to add a new core driver.

.. _triage-new-method:

``new method``
--------------

When we discuss the possibility or implement a new method to one or more drivers.
The method does not necessarily need to be a completely new one to NAPALM.

.. _triage-vendor-bug-label:

``vendor bug``
--------------

When the bug is casued by a vendor stupidity.

.. _triage-milestone:

Milestone
+++++++++

The milestones are used to group the Issues and the Pull Requests from a
different angle:

.. _triage-version-milestone:

Version
-------

The Issue will be solved, or the PR will be included in this release.

.. _triage-approved-milestone:

``APPROVED``
------------

It means that we accept the Issue or the PR, but we don't have a schedule yet
for when the Issue will be solved, or the PR will be included in a release.

.. _triage-blocked-milestone:

``BLOCKED``
-----------

This groups the Issues or the PRs we could not accept for the reasons marked
using the labels.

.. _triage-discussion-milestone:

``DISCUSSION``
--------------

The Issue or the PR needs further discussion.


.. _triage-projects:

Projects
++++++++

Any major change that may consist on several Pull Requests should be groupped
into a GitHub Project.

Loading

0 comments on commit b2d2bfa

Please sign in to comment.