mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-22 08:45:39 +02:00
reflect renaming also in e2e tests
This commit is contained in:
+13
-13
@@ -70,32 +70,32 @@ class EndToEndTestCase(unittest.TestCase):
|
|||||||
raise
|
raise
|
||||||
|
|
||||||
@timeout_decorator.timeout(TEST_TIMEOUT_SEC)
|
@timeout_decorator.timeout(TEST_TIMEOUT_SEC)
|
||||||
def test_enable_disable_connection_pool(self):
|
def test_enable_disable_connection_pooler(self):
|
||||||
'''
|
'''
|
||||||
For a database without connection pool, then turns it on, scale up,
|
For a database without connection pooler, then turns it on, scale up,
|
||||||
turn off and on again. Test with different ways of doing this (via
|
turn off and on again. Test with different ways of doing this (via
|
||||||
enableConnectionPool or connectionPool configuration section). At the
|
enableConnectionPooler or connectionPooler configuration section). At
|
||||||
end turn the connection pool off to not interfere with other tests.
|
the end turn connection pooler off to not interfere with other tests.
|
||||||
'''
|
'''
|
||||||
k8s = self.k8s
|
k8s = self.k8s
|
||||||
service_labels = {
|
service_labels = {
|
||||||
'cluster-name': 'acid-minimal-cluster',
|
'cluster-name': 'acid-minimal-cluster',
|
||||||
}
|
}
|
||||||
pod_labels = dict({
|
pod_labels = dict({
|
||||||
'connection-pool': 'acid-minimal-cluster-pooler',
|
'connection-pooler': 'acid-minimal-cluster-pooler',
|
||||||
})
|
})
|
||||||
|
|
||||||
pod_selector = to_selector(pod_labels)
|
pod_selector = to_selector(pod_labels)
|
||||||
service_selector = to_selector(service_labels)
|
service_selector = to_selector(service_labels)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# enable connection pool
|
# enable connection pooler
|
||||||
k8s.api.custom_objects_api.patch_namespaced_custom_object(
|
k8s.api.custom_objects_api.patch_namespaced_custom_object(
|
||||||
'acid.zalan.do', 'v1', 'default',
|
'acid.zalan.do', 'v1', 'default',
|
||||||
'postgresqls', 'acid-minimal-cluster',
|
'postgresqls', 'acid-minimal-cluster',
|
||||||
{
|
{
|
||||||
'spec': {
|
'spec': {
|
||||||
'enableConnectionPool': True,
|
'enableConnectionPooler': True,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
k8s.wait_for_pod_start(pod_selector)
|
k8s.wait_for_pod_start(pod_selector)
|
||||||
@@ -104,7 +104,7 @@ class EndToEndTestCase(unittest.TestCase):
|
|||||||
'default', label_selector=pod_selector
|
'default', label_selector=pod_selector
|
||||||
).items
|
).items
|
||||||
|
|
||||||
self.assertTrue(pods, 'No connection pool pods')
|
self.assertTrue(pods, 'No connection pooler pods')
|
||||||
|
|
||||||
k8s.wait_for_service(service_selector)
|
k8s.wait_for_service(service_selector)
|
||||||
services = k8s.api.core_v1.list_namespaced_service(
|
services = k8s.api.core_v1.list_namespaced_service(
|
||||||
@@ -115,15 +115,15 @@ class EndToEndTestCase(unittest.TestCase):
|
|||||||
if s.metadata.name.endswith('pooler')
|
if s.metadata.name.endswith('pooler')
|
||||||
]
|
]
|
||||||
|
|
||||||
self.assertTrue(services, 'No connection pool service')
|
self.assertTrue(services, 'No connection pooler service')
|
||||||
|
|
||||||
# scale up connection pool deployment
|
# scale up connection pooler deployment
|
||||||
k8s.api.custom_objects_api.patch_namespaced_custom_object(
|
k8s.api.custom_objects_api.patch_namespaced_custom_object(
|
||||||
'acid.zalan.do', 'v1', 'default',
|
'acid.zalan.do', 'v1', 'default',
|
||||||
'postgresqls', 'acid-minimal-cluster',
|
'postgresqls', 'acid-minimal-cluster',
|
||||||
{
|
{
|
||||||
'spec': {
|
'spec': {
|
||||||
'connectionPool': {
|
'connectionPooler': {
|
||||||
'numberOfInstances': 2,
|
'numberOfInstances': 2,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -137,7 +137,7 @@ class EndToEndTestCase(unittest.TestCase):
|
|||||||
'postgresqls', 'acid-minimal-cluster',
|
'postgresqls', 'acid-minimal-cluster',
|
||||||
{
|
{
|
||||||
'spec': {
|
'spec': {
|
||||||
'enableConnectionPool': False,
|
'enableConnectionPooler': False,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
k8s.wait_for_pods_to_stop(pod_selector)
|
k8s.wait_for_pods_to_stop(pod_selector)
|
||||||
@@ -147,7 +147,7 @@ class EndToEndTestCase(unittest.TestCase):
|
|||||||
'postgresqls', 'acid-minimal-cluster',
|
'postgresqls', 'acid-minimal-cluster',
|
||||||
{
|
{
|
||||||
'spec': {
|
'spec': {
|
||||||
'enableConnectionPool': True,
|
'enableConnectionPooler': True,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
k8s.wait_for_pod_start(pod_selector)
|
k8s.wait_for_pod_start(pod_selector)
|
||||||
|
|||||||
Reference in New Issue
Block a user