Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test case test_drain_with_block_for_eviction_success #1733

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
40 changes: 40 additions & 0 deletions manager/integration/tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@
"allow-empty-node-selector-volume"
SETTING_REPLICA_DISK_SOFT_ANTI_AFFINITY = "replica-disk-soft-anti-affinity"
SETTING_ALLOW_EMPTY_DISK_SELECTOR_VOLUME = "allow-empty-disk-selector-volume"
SETTING_NODE_DRAIN_POLICY = "node-drain-policy"

DEFAULT_BACKUP_COMPRESSION_METHOD = "lz4"
BACKUP_COMPRESSION_METHOD_LZ4 = "lz4"
Expand Down Expand Up @@ -6122,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