3 ##############################################################################
4 # Copyright (c) 2015 Ericsson AB and others.
6 # All rights reserved. This program and the accompanying materials
7 # are made available under the terms of the Apache License, Version 2.0
8 # which accompanies this distribution, and is available at
9 # http://www.apache.org/licenses/LICENSE-2.0
10 ##############################################################################
12 # Unittest for yardstick.benchmark.scenarios.networking.sfc
17 from yardstick.benchmark.scenarios.networking import sfc
20 class SfcTestCase(unittest.TestCase):
27 context_cfg['target'] = dict()
28 context_cfg['target']['user'] = 'root'
29 context_cfg['target']['password'] = 'octopus'
30 context_cfg['target']['ip'] = None
33 context_cfg['host'] = dict()
34 context_cfg['host']['user'] = 'cirros'
35 context_cfg['host']['password'] = 'cubslose:)'
36 context_cfg['host']['ip'] = None
37 context_cfg['target'] = dict()
38 context_cfg['target']['ip'] = None
40 self.sfc = sfc.Sfc(scenario_cfg=scenario_cfg, context_cfg=context_cfg)
42 @mock.patch('yardstick.benchmark.scenarios.networking.sfc.ssh')
43 def test_run_for_success(self, mock_ssh):
44 # Mock a successfull SSH in Sfc.setup() and Sfc.run()
45 mock_ssh.SSH().execute.return_value = (0, '100', '')
54 if __name__ == '__main__':