Skip to content

Commit

Permalink
Add test case test_drain_with_block_for_eviction_if_contains_last_rep…
Browse files Browse the repository at this point in the history
…lica_success

ref: 7521

Signed-off-by: Chris <[email protected]>
  • Loading branch information
chriscchien committed Feb 21, 2024
1 parent 6a084af commit 8feda8b
Show file tree
Hide file tree
Showing 3 changed files with 257 additions and 75 deletions.
2 changes: 1 addition & 1 deletion manager/integration/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM registry.suse.com/bci/python:3.9

ARG KUBECTL_VERSION=v1.17.0
ARG KUBECTL_VERSION=v1.28.4
ARG YQ_VERSION=v4.24.2
ARG TERRAFORM_VERSION=1.3.5
ARG ARCH=amd64
Expand Down
39 changes: 39 additions & 0 deletions manager/integration/tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -6123,3 +6123,42 @@ def wait_for_instance_manager_count(client, number, retry_counts=120):
time.sleep(RETRY_INTERVAL_LONG)

return len(ims)


def create_deployment_and_write_data(client, # NOQA
core_api, # NOQA
make_deployment_with_pvc, # NOQA
volume_name, # NOQA
size, # NOQA
replica_count, # NOQA
data_size, # NOQA
attach_node_id=None): # NOQA
apps_api = get_apps_api_client()
volume = client.create_volume(name=volume_name,
size=size,
numberOfReplicas=replica_count)
volume = wait_for_volume_detached(client, volume_name)

pvc_name = volume_name + "-pvc"
create_pv_for_volume(client, core_api, volume, volume_name)
create_pvc_for_volume(client, core_api, volume, pvc_name)
deployment_name = volume_name + "-dep"
deployment = make_deployment_with_pvc(deployment_name, pvc_name)
if attach_node_id:
deployment["spec"]["template"]["spec"]["nodeSelector"] \
= {"kubernetes.io/hostname": attach_node_id}

create_and_wait_deployment(apps_api, deployment)

data_path = '/data/test'
deployment_pod_names = get_deployment_pod_names(core_api,
deployment)
write_pod_volume_random_data(core_api,
deployment_pod_names[0],
data_path,
data_size)
checksum = get_pod_data_md5sum(core_api,
deployment_pod_names[0],
data_path)

return client.by_id_volume(volume_name), deployment_pod_names[0], checksum
Loading

0 comments on commit 8feda8b

Please sign in to comment.