示例#1
0
 def main(cls):
     LOG.warn(_LW('keystone-manage ssl_setup is not recommended for '
                  'production use.'))
     keystone_user_id, keystone_group_id = cls.get_user_group()
     conf_ssl = openssl.ConfigureSSL(keystone_user_id, keystone_group_id,
                                     rebuild=CONF.command.rebuild)
     conf_ssl.run()
示例#2
0
 def main(cls):
     msg = _('keystone-manage ssl_setup is not recommended for production '
             'use.')
     LOG.warn(msg)
     keystone_user_id, keystone_group_id = cls.get_user_group()
     conf_ssl = openssl.ConfigureSSL(keystone_user_id, keystone_group_id)
     conf_ssl.run()
示例#3
0
    def test_running_an_invalid_command(self, mock_poll, mock_communicate):
        output = 'this is the output string'

        mock_communicate.return_value = (output, '')
        mock_poll.return_value = 1

        cmd = ['ls']
        ssl = openssl.ConfigureSSL('keystone_user', 'keystone_group')
        e = self.assertRaises(environment.subprocess.CalledProcessError,
                              ssl.exec_command, cmd)
        self.assertThat(e.output, matchers.Equals(output))
示例#4
0
    def test_running_an_invalid_command(self, mock_check_output):
        cmd = ['ls']

        output = 'this is the output string'

        error = environment.subprocess.CalledProcessError(returncode=1,
                                                          cmd=cmd,
                                                          output=output)
        mock_check_output.side_effect = error

        ssl = openssl.ConfigureSSL('keystone_user', 'keystone_group')
        e = self.assertRaises(environment.subprocess.CalledProcessError,
                              ssl.exec_command, cmd)
        self.assertThat(e.output, matchers.Equals(output))
示例#5
0
 def test_create_ssl_certs(self, rebuild=False):
     ssl = openssl.ConfigureSSL(None, None, rebuild=rebuild)
     ssl.run()
     self.assertTrue(os.path.exists(CONF.eventlet_server_ssl.ca_certs))
     self.assertTrue(os.path.exists(CONF.eventlet_server_ssl.certfile))
     self.assertTrue(os.path.exists(CONF.eventlet_server_ssl.keyfile))
示例#6
0
    def test_running_a_successful_command(self, mock_poll):
        mock_poll.return_value = 0

        ssl = openssl.ConfigureSSL('keystone_user', 'keystone_group')
        ssl.exec_command(['ls'])
示例#7
0
 def test_create_ssl_certs(self):
     ssl = openssl.ConfigureSSL(None, None)
     ssl.run()
     self.assertTrue(os.path.exists(CONF.ssl.ca_certs))
     self.assertTrue(os.path.exists(CONF.ssl.certfile))
     self.assertTrue(os.path.exists(CONF.ssl.keyfile))
示例#8
0
 def main(cls):
     keystone_user_id, keystone_group_id = cls.get_user_group()
     conf_ssl = openssl.ConfigureSSL(keystone_user_id, keystone_group_id)
     conf_ssl.run()