示例#1
0
    def test_create_keystone_endpoint_region(self):
        self._patch_client()

        self.client.services.findall.return_value = []
        self.client.endpoints.findall.return_value = []

        keystone._create_keystone_endpoint(self.client, '192.0.0.3',
                                           'regionTwo', None, None)
        self.assert_endpoint('192.0.0.3', region='regionTwo')
示例#2
0
    def test_create_keystone_endpoint_region(self):
        self._patch_client()

        self.client.services.findall.return_value = []
        self.client.endpoints.findall.return_value = []

        keystone._create_keystone_endpoint(
            self.client, '192.0.0.3', 'regionTwo', None, None, None, None)
        self.assert_endpoint('192.0.0.3', region='regionTwo')
    def test_create_keystone_endpoint_public(self):
        self._patch_client()

        self.client.services.findall.return_value = []
        self.client.endpoints.findall.return_value = []

        keystone._create_keystone_endpoint(
            self.client, '192.0.0.3', 'regionOne', None, 'keystone.internal')
        public_endpoint = 'http://keystone.internal:5000/v2.0'
        self.assert_endpoint('192.0.0.3', public_endpoint=public_endpoint)
示例#4
0
    def test_create_keystone_endpoint_ssl_and_public(self):
        self._patch_client()

        self.client.services.findall.return_value = []
        self.client.endpoints.findall.return_value = []

        keystone._create_keystone_endpoint(self.client, '192.0.0.3',
                                           'regionOne', 'keystone.example.com',
                                           'keystone.internal')
        public_endpoint = 'https://keystone.example.com:13000/v2.0'
        self.assert_endpoint('192.0.0.3', public_endpoint=public_endpoint)
示例#5
0
    def test_create_keystone_endpoint_ssl_and_public(self):
        self._patch_client()

        self.client.services.findall.return_value = []
        self.client.endpoints.findall.return_value = []

        keystone._create_keystone_endpoint(
            self.client, '192.0.0.3', 'regionOne', 'keystone.example.com',
            'keystone.public', None, None)
        public_endpoint = 'https://keystone.example.com:13000/v2.0'
        self.assert_endpoint('192.0.0.3', public_endpoint=public_endpoint)
示例#6
0
    def test_create_keystone_endpoint_public(self):
        self._patch_client()

        self.client.services.findall.return_value = []
        self.client.endpoints.findall.return_value = []

        keystone._create_keystone_endpoint(self.client, '192.0.0.3',
                                           'regionOne', None,
                                           'keystone.public', None, None)
        public_endpoint = 'http://keystone.public:5000/v2.0'
        self.assert_endpoint('192.0.0.3', public_endpoint=public_endpoint)
示例#7
0
    def test_create_keystone_endpoint_public_and_admin(self):
        self._patch_client()

        self.client.services.findall.return_value = []
        self.client.endpoints.findall.return_value = []

        keystone._create_keystone_endpoint(
            self.client, '192.0.0.3', 'regionOne', None, 'keystone.public',
            'keystone.admin', None)
        public_endpoint = 'http://keystone.public:5000/v2.0'
        admin_endpoint = 'http://keystone.admin:35357/v2.0'
        self.assert_endpoint('192.0.0.3', public_endpoint=public_endpoint,
                             admin_endpoint=admin_endpoint)
示例#8
0
    def test_create_keystone_endpoint_ssl_public_admin_and_internal(self):
        self._patch_client()

        self.client.services.findall.return_value = []
        self.client.endpoints.findall.return_value = []

        keystone._create_keystone_endpoint(
            self.client, '192.0.0.3', 'regionOne', 'keystone.example.com',
            'keystone.public', 'keystone.admin', 'keystone.internal')
        public_endpoint = 'https://keystone.example.com:13000/v2.0'
        admin_endpoint = 'http://keystone.admin:35357/v2.0'
        internal_endpoint = 'http://keystone.internal:5000/v2.0'
        self.assert_endpoint('192.0.0.3', public_endpoint=public_endpoint,
                             admin_endpoint=admin_endpoint,
                             internal_endpoint=internal_endpoint)
示例#9
0
    def test_create_keystone_endpoint_ssl_public_and_admin(self):
        self._patch_client()

        self.client.services.findall.return_value = []
        self.client.endpoints.findall.return_value = []

        keystone._create_keystone_endpoint(self.client, '192.0.0.3',
                                           'regionOne', 'keystone.example.com',
                                           'keystone.public', 'keystone.admin',
                                           None)
        public_endpoint = 'https://keystone.example.com:13000/v2.0'
        admin_endpoint = 'http://keystone.admin:35357/v2.0'
        self.assert_endpoint('192.0.0.3',
                             public_endpoint=public_endpoint,
                             admin_endpoint=admin_endpoint)
示例#10
0
    def test_create_keystone_endpoint_public_admin_and_internal(self):
        self._patch_client()

        self.client.services.findall.return_value = []
        self.client.endpoints.findall.return_value = []

        keystone._create_keystone_endpoint(self.client, '192.0.0.3',
                                           'regionOne', None,
                                           'keystone.public', 'keystone.admin',
                                           'keystone.internal')
        public_endpoint = 'http://keystone.public:5000/v2.0'
        admin_endpoint = 'http://keystone.admin:35357/v2.0'
        internal_endpoint = 'http://keystone.internal:5000/v2.0'
        self.assert_endpoint('192.0.0.3',
                             public_endpoint=public_endpoint,
                             admin_endpoint=admin_endpoint,
                             internal_endpoint=internal_endpoint)
示例#11
0
    def test_create_keystone_endpoint_ipv6(self):
        self._patch_client()

        self.client.services.findall.return_value = []
        self.client.endpoints.findall.return_value = []

        keystone._create_keystone_endpoint(
            self.client, '2001:db8:fd00:1000:f816:3eff:fec2:8e7c', 'regionOne',
            None, '2001:db8:fd00:1000:f816:3eff:fec2:8e7d',
            '2001:db8:fd00:1000:f816:3eff:fec2:8e7e',
            '2001:db8:fd00:1000:f816:3eff:fec2:8e7f')
        pe = 'http://[2001:db8:fd00:1000:f816:3eff:fec2:8e7d]:5000/v2.0'
        ae = 'http://[2001:db8:fd00:1000:f816:3eff:fec2:8e7e]:35357/v2.0'
        ie = 'http://[2001:db8:fd00:1000:f816:3eff:fec2:8e7f]:5000/v2.0'
        self.assert_endpoint('[2001:db8:fd00:1000:f816:3eff:fec2:8e7c]',
                             region='regionOne',
                             public_endpoint=pe,
                             admin_endpoint=ae,
                             internal_endpoint=ie)
示例#12
0
    def test_create_keystone_endpoint_ipv6(self):
        self._patch_client()

        self.client.services.findall.return_value = []
        self.client.endpoints.findall.return_value = []

        keystone._create_keystone_endpoint(
            self.client, '2001:db8:fd00:1000:f816:3eff:fec2:8e7c',
            'regionOne',
            None,
            '2001:db8:fd00:1000:f816:3eff:fec2:8e7d',
            '2001:db8:fd00:1000:f816:3eff:fec2:8e7e',
            '2001:db8:fd00:1000:f816:3eff:fec2:8e7f')
        pe = 'http://[2001:db8:fd00:1000:f816:3eff:fec2:8e7d]:5000/v2.0'
        ae = 'http://[2001:db8:fd00:1000:f816:3eff:fec2:8e7e]:35357/v2.0'
        ie = 'http://[2001:db8:fd00:1000:f816:3eff:fec2:8e7f]:5000/v2.0'
        self.assert_endpoint(
            '[2001:db8:fd00:1000:f816:3eff:fec2:8e7c]',
            region='regionOne', public_endpoint=pe, admin_endpoint=ae,
            internal_endpoint=ie)