aboutsummaryrefslogtreecommitdiffstats
path: root/os_net_config/tests/test_cli.py
AgeCommit message (Collapse)AuthorFilesLines
2017-07-12Add schema-based config data validationFrank A. Zdarsky1-12/+31
This patch adds a jsonschema for os-net-config's configuration data and a library function to validate configuration data based on this schema. Adding schema-based validation allows catching a larger class of errors (typos, missing required parameters, etc.) for all devices configurable through os-net-config. The validation is run in the os-net-config CLI after loading the config file. If the config file fails to validate, the current default is to just log a warning and try to continue. By providing the new CLI option '--exit-on-validation-errors', this can be changed to log an error and exist instead. This validation is meant to be reusable, for example for pre-deployment validation of network environments (see change Ic16ee0bc353c46f8fe512454176a07ee95347346). Packaging with os-net-config makes it easier to keep object model and schema in sync. Change-Id: Ie4a905863b2d46c88d9cd6c3afc50e7d0a877090 Signed-off-by: Frank A. Zdarsky <fzdarsky@redhat.com>
2016-08-29Cleanups and new unit test for IVSSarath Kumar1-0/+18
- refactor test_object unit-test for IVS to follow other object class tests - add new CLI unit test for IVS - cleanup comments from https://review.openstack.org/#/c/345599 Change-Id: I0c337b019ae90ee7b2f207ff9b5060ed67bf182f
2016-08-26Add support for OVS DPDK BondSaravanan KR1-0/+17
Add functionality to os-net-config to allow DPDK bonding of interfaces, and implement support for parameters to be passed by TripleO Heat Templates. Implements: blueprint tripleo-ovs-dpdk Depends-On: Id4a23ced28b92a642c180a35c55080e5f4e2e05d Change-Id: If1c91402d2d393140dc1b4a678e68a1bcdbe81e4
2016-08-25Add support for OVS DPDK Bridge and PortSaravanan KR1-0/+17
Add support in os-net-config for DPDK ports and OVS user bridges, and implement parameters which will be set by the TripleO Heat Templates when using TripleO. Implements: blueprint tripleo-ovs-dpdk Change-Id: Id4a23ced28b92a642c180a35c55080e5f4e2e05d
2016-08-02Enable os-net-config to support and configure NFVSwitchSarath Kumar1-0/+18
These changes are to generate /etc/sysconf/network-scripts/ifcfg-* and /etc/sysconfig/nfvswitch configuration files for nfvswitch and its interfaces. NFVSwitch is a virtual switch implementation based on DPDK for datacenter workloads with very high throughput needs. Change-Id: If02edb9c4c54c014f67290fe0c34e2fc73cb95bd
2015-08-14Add --detailed-exit-codesDan Prince1-0/+25
This patch adds a new --detailed-exit-codes option which can be used to optionally enable the os-net-config CLI to return exit code 2 if there have been modifications. Detailed exit codes are useful if you need to trigger subsequent external actions based whether os-net-config made changes or not. Change-Id: I8f22fa15335d1276f4e444a6454a24ff486e1495
2015-08-02Allow to specify the root directory of the filesystemFrederic Lepied1-0/+9
Change-Id: Ice1b8d17804cf7a0aafd308945a5e960fe927bbc
2015-01-15test_cli add stderr/stdout sanity assertionsSteven Hardy1-8/+41
Currently no check for error output on stderr is made, and no sanity checked performed on the stdout string - both yaml and json versions could be empty and the test would still pass. So add sanity assertions for each case so the test is a bit more robust. Change-Id: Iced683ff3365e0766d345a2ce840b69b501fbb54
2015-01-14Derive sample location from test file, not pwdSteven Hardy1-1/+3
Currently test_cli fails if you don't run it from the repository top directory, so instead derive a relative path from the test, which e.g allows you to do nosetests -svx test_cli.py which can be more convenient when debugging. Change-Id: I120065ca17104be7c2f4bf00d3e4e281a3179703
2015-01-14Fix test_cli exit code assertionSteven Hardy1-14/+12
Currently we ignore the actual return code from the main() function, due to the try/catch, which isn't appropriate where we're directly calling the function. Instead assert the return value directly, which will catch failures where main returns a non-zero status. Change-Id: Ic92ca243230f732201f30cc63be5101f70c206bb
2015-01-14Add sample and cli test for simple interface configSteven Hardy1-0/+9
Adds a simple example showing how an individual interface can be configured, e.g outside of a bond etc. Change-Id: I05dcb4fabe718686e306bdc719b32f0fb40c1b5e
2014-09-18Update child_members to use a SetDan Prince1-2/+4
Updates the impl_ifcfg.child_members method so that it uses a set instead of an array (this avoids dups). Also fixes an issue with this method which would cause tests to fail intermittently due to ordering differences. Adding each member object regardless solves this (not sure why I had commented out the children.append before) Also fixes an issue in test_cli which causes tests to fail on Debian which doesn't yet support the add_bond method on its ENI provider. This fix was to explicitly set --provider=ifcfg on the failing tests. We should be able to remove these once ENI supports bonding properly. Closes-bug: #1370615 Change-Id: Id9cfa2b2eaab27c93113956f5956facfa2a2aeee
2014-08-20Add support for parsing YAMLDan Prince1-0/+70
Adds new YAML examples. Also adds some new CLI test cases which compare --noop stdout (from the CLI) for the json and yaml examples to verify they generate the same things.