aboutsummaryrefslogtreecommitdiffstats
path: root/os_net_config/tests/test_cli.py
AgeCommit message (Collapse)AuthorFilesLines
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.