Framework for building and testing network topologies, with support for pytest.
Copyright (C) 2015-2020 Hewlett Packard Enterprise Development LP Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Set a meaningful identifier for NML bilinks.
Currently the bilinks ID is the Python instance ID, this commit set it to a combination of the port IDs using the same syntax as pyszn:
node0:port0 -- node1:port1
- Platform arguments can now be passed from the CLI and/or the Pytest plugin.
--option key=valuein the CLI and
--topology-platform-option key=valuein Pytest. Options given using this method will be passed as keyword arguments to the platform. Values will be "autoparsed" to a Python type using the following order: floats, integers, booleans (yes, no, true, false, case insensitive) and finally any other is considered a strings. [Carlos Jenkins & David Diaz]
Removed long ago deprecated module topology.platforms.base [Carlos Jenkins]
- topology.platforms.base.BasePlatform => topology.platforms.platform.BasePlatform
- topology.platforms.base.BaseNode => topology.platforms.node.BaseNode
- topology.platforms.base.CommonNode => topology.platforms.node.CommonNode
Update BaseShell __call__ and execute to pass args and kwargs to the wrapped call to send_command() (#76) [Sergio Morales]
Changes to support newer versions of pytest. (#79) [Diego Dompe]
Drop support for Python 3.4. Minimal version is now 3.5. [Carlos Jenkins]
- Topology shells will now use pexpect poll() to support more than 1024 file descriptors. This change requires pexpect >= 4.6. [Carlos Jenkins]
- Make new testlog func private. [Matthew Hall]
- Environment attributes are now passed to the NMLManager. [Javier Peralta]
- Add functions for new test specific log. [Matthew Hall]
Remove unit test of functionalty no longer on topology. [Javier Peralta]
Moving injection to pyszn. [Diego Hurtado]
Customize term codes regex. [David Diaz]
Add the ability to customize the terminal regex code for special shells
- Pyszn uses correct depedency declaration. [Javier Peralta]
- Minor fixes. [David Diaz]
Add a dynamic timeout option. [Matthew Hall]
When this option is used expect will be repeated as long as output is still being returned.
Add FORCED_PROMPT to the initial prompt. [Joseph Loaiza]
The original initial prompt does not match the FORCED_PROMPT, this makes the shell to throw a timeout exception when trying to reconnect to a previously used shell.
- Adding missing release information. [Diego Hurtado]
- Updating to new PEP8 requirements. [Diego Hurtado]
Modify pexpect logger to match actual data stream. [Javier Peralta]
This change adds a new filehandler that doesn't introduce line changes arbitrarily. Also Add some line changes on known places to keep output log file readable. With this changes the log file should match pexpect's command output stream closer.
- Extending connection and disconnection arguments. [Diego Hurtado]
Refactoring _get_connection. [Diego Hurtado]
Removing support for Python 2.7. [Diego Hurtado]
Several fixes in the usage of the connection argument. [Diego Hurtado]
This intentionally breaks compatibility with Python 2.7 since it uses syntax introduced in PEP 3102.
Increase echo sleep 1 second. [Javier Peralta]
- Adding support for sending control characters. [Diego Hurtado]
- Increased delay_after_echo_off a bit. [Javier Peralta]
- Log python error when plugin load fails. [Javier Peralta]
Adding a delay after setting echo off. [Javier Peralta]
Command to set prompt was sometimes too fast and were sent before bash turned off echo (stty -echo) resulting in unwanted information being displayed. This commit makes sure bash always have time to turn echo off.
- Adding reason to
- Adding timestamps to logs.
- Adding workaround for bug in mock.
python3as base Python.
- Calling missing
- Fixing typo in README.
- Fixing broken
- Fixing the
test_idmarker to make it work with Pytest > 3.0.0.
- Removing fixed dependencies.
- Adding logging functionality.
- Fixing the shells connect process.
- Handling calls to
- Removed internal imports of deprecated modules.
- A new ServicesAPI for the nodes is now available. This new API allows to register and later on fetch information about the services a node provides.
- Greatly improved documentation for the Shell Low Level API introduced in 1.4.0. Check "The low-level shell API" in User Guide.
- The Low Level Shell API will now be able to log user commands. This new feature is backward compatible.
topology.platforms.baseis now deprecated. Please change your imports to:
topology.platforms.base.BasePlatform => topology.platforms.platform.BasePlatform topology.platforms.base.BaseNode => topology.platforms.node.BaseNode topology.platforms.base.CommonNode => topology.platforms.node.CommonNode
useras an option for
PExpectShellto support shells that use this kind of authentication.
- Raising the proper exception when a shell connection fails for the user to handle it properly.
- Removing the version requirement of Pexpect since this may cause version collisions with other Python packages commonly used with the framework.
- The reference documentation for the vtysh, ping and ip communication libraries has been added to the documentation.
- PExpect shells now support multiple connections. This means that the same
shell object can now use several
- The documentation for communication libraries has been improved a lot with specific examples for common use cases added.
spawnarguments are now reachable from the initialization of a shell object.
- The attribute injection feature is now capable of following symbolic links while walking through directory paths.
- The version of all dependencies has been fixed. This is to avoid unexpected code breaks when a bug is introduced in one of them.
- The base node class
BaseNodenow includes a
portsattribute. This has been used by all platform engine nodes so far, but was missing in their base class.
- A missing history file does not raise an error whene executing
topology, but is just logged as an error.
- A few CSS and other theme issues have been fixed.
- When expanding the search path for attribute injection all hidden folders (starting with '.') will now be ignored.
- When processing files that matched the search path for attribute injection all files that have ill formed / unparseable SZN strings will be logged as error and skipped instead of raising an exception.
- When processing files that matched the search path for attribute injection
.py's that doesn't possess a
TOPOLOGYvariable will now be warned and skipped instead of raising an exception.
- Fixed attribute injection crashing when a SZN file is in the node expansion search path.
- Fixed rollback routine not being triggered when an non
Exceptionsubclass is raised.
topology.platforms.shell.PExpectBashShellclass that allows to easily setup shells that uses bash.
- Fixed small identation bug that caused the function
get_shell()in the node API to return always
New low level shell API that allows to define a common behavior for all low level shell manipulation. This API is implemented by the
Two new high level API methods for accesing the low level shell API:
myshell = mynode.get_shell('python') response = myshell.execute('1 + 1')
Or using a context manager:
with mynode.use_shell('python') as python: # This context manager sets the default shell to 'python' mynode('from os import getcwd') cwd = mynode('print(getcwd())') # Access to the low-level shell API python.send_command('foo = (', matches=['... '])
- The shell used to execute a command will now be logged.
- Attribute injection will now try to match files on any subfolder of the search paths and not only on the search paths themselves.
- Fixed critical bug in injection attribute not considering matches in some cases.
- Added new API for the topology nodes that allow to set the default shell.
For example, you may now use
mynode.default_shell = 'bash'.
- Documentation for the Attribute Injection feature was added.
- Improvements for file matching in attribute injection files. Now, if using pytest, all test folders passed as arguments will be used as search paths for relative files specified in the attribute injection file. With this, it is no longer required to use an absolute path, and this practice becomes deprecated.
- Fixed a bug in attribute injection when using
attribute=valueas node identifier that caused all nodes with the attribute to use that value.
- Added a common
topology.libraries.utilsthat allows to easily inject state to an enode in a Communication library.
- Added a common
topology.platforms.utilsthat allows a Platform Engine to find a load nodes for it's platform.
- Fixed fatal bug when running a single node topology without ports.
- Fixed new PEP8 checks on the codebase.
- Initial public release.