def test_keystone_init(self, mock_gkc, mock_init, mock_gp):
     mock_ksc = mock.Mock()
     mock_gkc.return_value = mock_ksc
     mock_ksc.services.find.return_value = True
     stack = mock.MagicMock()
     stack.to_dict.return_value = fakes.FAKE_STACK
     ip = '192.0.2.1'
     overcloud_deploy.DeployOvercloud(None, None)._keystone_init(
         ip, ip, None, stack)
     self.assertFalse(mock_init.called)
 def test_keystone_init(self, mock_gkc, mock_init, mock_gp):
     mock_ksc = mock.Mock()
     mock_gkc.return_value = mock_ksc
     mock_ksc.users.find.return_value = True
     sips = mock.Mock()
     sips.get.return_value = None
     ip = '192.0.2.1'
     overcloud_deploy.DeployOvercloud(None, None)._keystone_init(
         ip, ip, None, sips)
     self.assertFalse(mock_init.called)
 def test_keystone_init_occ(self, mock_gkc, mock_init, mock_se, mock_gp):
     mock_ksc = mock.Mock()
     mock_gkc.return_value = mock_ksc
     mock_ksc.services.find.side_effect = kscexc.NotFound()
     stack = mock.Mock()
     stack.to_dict.return_value = fakes.FAKE_STACK
     ip = '192.0.2.1'
     args = mock.Mock()
     overcloud_deploy.DeployOvercloud(None, None)._keystone_init(
         ip, ip, args, stack)
     self.assertTrue(mock_init.called)
 def test_keystone_init_occ(self, mock_gkc, mock_init, mock_se, mock_gp):
     mock_ksc = mock.Mock()
     mock_gkc.return_value = mock_ksc
     mock_ksc.users.find.side_effect = kscexc.NotFound()
     sips = mock.Mock()
     sips.get.return_value = None
     ip = '192.0.2.1'
     args = mock.Mock()
     overcloud_deploy.DeployOvercloud(None, None)._keystone_init(
         ip, ip, args, sips)
     self.assertTrue(mock_init.called)
    def setUp(self):
        super(TestDeployOvercloud, self).setUp()

        # Get the command object to test
        app_args = mock.Mock()
        app_args.verbose_level = 1
        self.cmd = overcloud_deploy.DeployOvercloud(self.app, app_args)

        # mock validations for all deploy tests
        # for validator tests, see test_overcloud_deploy_validators.py
        validator_mock = mock.Mock(return_value=(0, 0))
        self.cmd._predeploy_verify_capabilities = validator_mock

        self._get_passwords = generate_overcloud_passwords_mock

        self.parameter_defaults_env_file = (
            tempfile.NamedTemporaryFile(mode='w', delete=False).name)
    def setUp(self):
        super(TestCollectFlavors, self).setUp()
        self.cmd = overcloud_deploy.DeployOvercloud(self.app, None)
        self.arglist = [
            '--block-storage-flavor', 'block',
            '--block-storage-scale', '3',
            '--ceph-storage-flavor', 'ceph',
            '--ceph-storage-scale', '0',
            '--compute-flavor', 'compute',
            '--compute-scale', '3',
            '--control-flavor', 'control',
            '--control-scale', '1',
            '--swift-storage-flavor', 'swift',
            '--swift-storage-scale', '2',
            '--templates'
        ]
        self.verifylist = [
            ('templates', '/usr/share/openstack-tripleo-heat-templates/'),
        ]

        self.mock_flavors = mock.Mock()
        self.app.client_manager.compute.attach_mock(self.mock_flavors,
                                                    'flavors')
    def setUp(self):
        super(TestDeployValidators, self).setUp()

        # Get the command object to test
        self.cmd = overcloud_deploy.DeployOvercloud(self.app, None)