diff options
author | Sarath Kumar <sarath.kutty@bigswitch.com> | 2016-07-22 11:03:34 -0700 |
---|---|---|
committer | Sarath Kumar <sarath.kutty@bigswitch.com> | 2016-08-29 11:22:51 -0700 |
commit | 9334e948162b8e71a44022441d92503d4a3e3512 (patch) | |
tree | 18ff711f4ca6ee5a310aba80a6a031b8cd100dce /os_net_config/tests/test_cli.py | |
parent | f79d534c3e130bb539cf7ccb1d3f9586e922b9a7 (diff) |
Cleanups and new unit test for IVS
- 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
Diffstat (limited to 'os_net_config/tests/test_cli.py')
-rw-r--r-- | os_net_config/tests/test_cli.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/os_net_config/tests/test_cli.py b/os_net_config/tests/test_cli.py index c5c825f..0626205 100644 --- a/os_net_config/tests/test_cli.py +++ b/os_net_config/tests/test_cli.py @@ -66,6 +66,24 @@ class TestCli(base.TestCase): self.assertIn(dev, stdout_yaml) self.assertEqual(stdout_yaml, stdout_json) + def test_ivs_noop_output(self): + ivs_yaml = os.path.join(SAMPLE_BASE, 'ivs.yaml') + ivs_json = os.path.join(SAMPLE_BASE, 'ivs.json') + stdout_yaml, stderr = self.run_cli('ARG0 --provider=ifcfg --noop ' + '-c %s' % ivs_yaml) + self.assertEqual('', stderr) + stdout_json, stderr = self.run_cli('ARG0 --provider=ifcfg --noop ' + '-c %s' % ivs_json) + self.assertEqual('', stderr) + sanity_devices = ['DEVICE=nic2', + 'DEVICE=nic3', + 'DEVICE=api201', + 'DEVICE=storage202', + 'DEVICETYPE=ivs'] + for dev in sanity_devices: + self.assertIn(dev, stdout_yaml) + self.assertEqual(stdout_yaml, stdout_json) + def test_bridge_noop_output(self): bridge_yaml = os.path.join(SAMPLE_BASE, 'bridge_dhcp.yaml') bridge_json = os.path.join(SAMPLE_BASE, 'bridge_dhcp.json') |