diff --git a/index.html b/index.html index 4340116081..847f53eb25 100644 --- a/index.html +++ b/index.html @@ -1,7 +1,7 @@
- +tests.common
tests.common
tests.common
tests.common
tests.common
-def create_and_check_volume(client, volume_name, num_of_replicas=3, size='16777216', backing_image='', frontend='blockdev', snapshot_data_integrity='ignored')
+def create_and_check_volume(client, volume_name, num_of_replicas=3, size='16777216', backing_image='', frontend='blockdev', snapshot_data_integrity='ignored', access_mode='rwo')
Create a new volume with the specified parameters. Assert that the new @@ -7429,7 +7436,8 @@
def create_and_check_volume(client, volume_name,
num_of_replicas=3, size=SIZE, backing_image="",
frontend=VOLUME_FRONTEND_BLOCKDEV,
- snapshot_data_integrity=SNAPSHOT_DATA_INTEGRITY_IGNORED): # NOQA
+ snapshot_data_integrity=SNAPSHOT_DATA_INTEGRITY_IGNORED, # NOQA
+ access_mode=ACCESS_MODE_RWO):
"""
Create a new volume with the specified parameters. Assert that the new
volume is detached and that all of the requested parameters match.
@@ -7448,7 +7456,8 @@ Returns
client.create_volume(name=volume_name, size=size,
numberOfReplicas=num_of_replicas,
backingImage=backing_image, frontend=frontend,
- snapshotDataIntegrity=snapshot_data_integrity)
+ snapshotDataIntegrity=snapshot_data_integrity,
+ accessMode=access_mode)
volume = wait_for_volume_detached(client, volume_name)
assert volume.name == volume_name
assert volume.size == size
@@ -10764,7 +10773,7 @@ Args
-def prepare_pod_with_data_in_mb(client, core_api, csi_pv, pvc, pod_make, volume_name, volume_size='1073741824', num_of_replicas=3, data_path='/data/test', data_size_in_mb=100, add_liveness_probe=True)
+def prepare_pod_with_data_in_mb(client, core_api, csi_pv, pvc, pod_make, volume_name, volume_size='1073741824', num_of_replicas=3, data_path='/data/test', data_size_in_mb=100, add_liveness_probe=True, access_mode='rwo')
@@ -10775,7 +10784,8 @@ Args
def prepare_pod_with_data_in_mb(
client, core_api, csi_pv, pvc, pod_make, volume_name,
volume_size=str(1*Gi), num_of_replicas=3, data_path="/data/test",
- data_size_in_mb=DATA_SIZE_IN_MB_1, add_liveness_probe=True):# NOQA:
+ data_size_in_mb=DATA_SIZE_IN_MB_1, add_liveness_probe=True,
+ access_mode=ACCESS_MODE_RWO):# NOQA:
pod_name = volume_name + "-pod"
pv_name = volume_name
@@ -10800,7 +10810,8 @@ Args
create_and_check_volume(client, volume_name,
num_of_replicas=num_of_replicas,
- size=volume_size)
+ size=volume_size,
+ access_mode=access_mode)
core_api.create_persistent_volume(csi_pv)
core_api.create_namespaced_persistent_volume_claim(
body=pvc, namespace='default')
diff --git a/integration/test_backing_image.html b/integration/test_backing_image.html
index 5dda23f56e..efb765cc07 100644
--- a/integration/test_backing_image.html
+++ b/integration/test_backing_image.html
@@ -105,9 +105,10 @@ Module tests.test_backing_image
8. Delete the backing image.
"""
- volume = create_and_check_volume(
- client, volume_name, 3,
- str(BACKING_IMAGE_EXT4_SIZE), bi_name)
+ volume = create_and_check_volume(client, volume_name,
+ num_of_replicas=3,
+ size=str(BACKING_IMAGE_EXT4_SIZE),
+ backing_image=bi_name)
lht_host_id = get_self_host_id()
volume.attach(hostId=lht_host_id)
volume = wait_for_volume_healthy(client, volume_name)
@@ -172,9 +173,10 @@ Module tests.test_backing_image
lht_host_id = get_self_host_id()
volume_name1 = volume_name_prefix + "-1"
- volume1 = create_and_check_volume(
- client, volume_name1, 3,
- str(BACKING_IMAGE_EXT4_SIZE), bi_name)
+ volume1 = create_and_check_volume(client, volume_name1,
+ num_of_replicas=3,
+ size=str(BACKING_IMAGE_EXT4_SIZE),
+ backing_image=bi_name)
volume1.attach(hostId=lht_host_id)
volume1 = wait_for_volume_healthy(client, volume_name1)
assert volume1.backingImage == bi_name
@@ -204,9 +206,10 @@ Module tests.test_backing_image
check_volume_data(volume1, data)
volume_name2 = volume_name_prefix + "-2"
- volume2 = create_and_check_volume(
- client, volume_name2, 3,
- str(BACKING_IMAGE_EXT4_SIZE), bi_name)
+ volume2 = create_and_check_volume(client, volume_name2,
+ num_of_replicas=3,
+ size=str(BACKING_IMAGE_EXT4_SIZE),
+ backing_image=bi_name)
volume2.attach(hostId=lht_host_id)
volume2 = wait_for_volume_healthy(client, volume_name2)
assert volume1.backingImage == bi_name
@@ -556,10 +559,10 @@ Module tests.test_backing_image
client, BACKING_IMAGE_NAME, bi_url)
# Step 2
- volume = create_and_check_volume(
- client, volume_name, 3,
- str(BACKING_IMAGE_EXT4_SIZE),
- BACKING_IMAGE_NAME)
+ volume = create_and_check_volume(client, volume_name,
+ num_of_replicas=3,
+ size=str(BACKING_IMAGE_EXT4_SIZE),
+ backing_image=BACKING_IMAGE_NAME)
# Step 3
lht_host_id = get_self_host_id()
@@ -613,13 +616,13 @@ Module tests.test_backing_image
# Step 2
lht_host_id = get_self_host_id()
- volume1 = create_and_check_volume(
- client, volume_name="vol-1", size=str(1 * Gi),
- backing_image=backing_img1_name)
+ volume1 = create_and_check_volume(client, "vol-1",
+ size=str(1 * Gi),
+ backing_image=backing_img1_name)
- volume2 = create_and_check_volume(
- client, volume_name="vol-2", size=str(1 * Gi),
- backing_image=backing_img2_name)
+ volume2 = create_and_check_volume(client, "vol-2",
+ size=str(1 * Gi),
+ backing_image=backing_img2_name)
# Step 3
volume1.attach(hostId=lht_host_id)
@@ -683,9 +686,9 @@ Module tests.test_backing_image
lht_host_id = get_self_host_id()
volume1_name = "vol1"
- volume1 = create_and_check_volume(
- client, volume1_name, 3,
- str(1 * Gi))
+ volume1 = create_and_check_volume(client, volume1_name,
+ num_of_replicas=3,
+ size=str(1 * Gi))
volume1.attach(hostId=lht_host_id)
volume1 = wait_for_volume_healthy(client, volume1_name)
volume_endpoint = get_volume_endpoint(volume1)
@@ -701,9 +704,9 @@ Module tests.test_backing_image
# Create volume with that backing image
volume2_name = "vol2"
- volume2 = create_and_check_volume(
- client, volume_name=volume2_name, size=str(1 * Gi),
- backing_image=backing_img["name"])
+ volume2 = create_and_check_volume(client, volume2_name,
+ size=str(1 * Gi),
+ backing_image=backing_img["name"])
volume2.attach(hostId=lht_host_id)
@@ -768,9 +771,10 @@ Functions
8. Delete the backing image.
"""
- volume = create_and_check_volume(
- client, volume_name, 3,
- str(BACKING_IMAGE_EXT4_SIZE), bi_name)
+ volume = create_and_check_volume(client, volume_name,
+ num_of_replicas=3,
+ size=str(BACKING_IMAGE_EXT4_SIZE),
+ backing_image=bi_name)
lht_host_id = get_self_host_id()
volume.attach(hostId=lht_host_id)
volume = wait_for_volume_healthy(client, volume_name)
@@ -825,13 +829,13 @@ Functions
# Step 2
lht_host_id = get_self_host_id()
- volume1 = create_and_check_volume(
- client, volume_name="vol-1", size=str(1 * Gi),
- backing_image=backing_img1_name)
+ volume1 = create_and_check_volume(client, "vol-1",
+ size=str(1 * Gi),
+ backing_image=backing_img1_name)
- volume2 = create_and_check_volume(
- client, volume_name="vol-2", size=str(1 * Gi),
- backing_image=backing_img2_name)
+ volume2 = create_and_check_volume(client, "vol-2",
+ size=str(1 * Gi),
+ backing_image=backing_img2_name)
# Step 3
volume1.attach(hostId=lht_host_id)
@@ -901,9 +905,10 @@ Functions
lht_host_id = get_self_host_id()
volume_name1 = volume_name_prefix + "-1"
- volume1 = create_and_check_volume(
- client, volume_name1, 3,
- str(BACKING_IMAGE_EXT4_SIZE), bi_name)
+ volume1 = create_and_check_volume(client, volume_name1,
+ num_of_replicas=3,
+ size=str(BACKING_IMAGE_EXT4_SIZE),
+ backing_image=bi_name)
volume1.attach(hostId=lht_host_id)
volume1 = wait_for_volume_healthy(client, volume_name1)
assert volume1.backingImage == bi_name
@@ -933,9 +938,10 @@ Functions
check_volume_data(volume1, data)
volume_name2 = volume_name_prefix + "-2"
- volume2 = create_and_check_volume(
- client, volume_name2, 3,
- str(BACKING_IMAGE_EXT4_SIZE), bi_name)
+ volume2 = create_and_check_volume(client, volume_name2,
+ num_of_replicas=3,
+ size=str(BACKING_IMAGE_EXT4_SIZE),
+ backing_image=bi_name)
volume2.attach(hostId=lht_host_id)
volume2 = wait_for_volume_healthy(client, volume_name2)
assert volume1.backingImage == bi_name
@@ -985,10 +991,10 @@ Functions
client, BACKING_IMAGE_NAME, bi_url)
# Step 2
- volume = create_and_check_volume(
- client, volume_name, 3,
- str(BACKING_IMAGE_EXT4_SIZE),
- BACKING_IMAGE_NAME)
+ volume = create_and_check_volume(client, volume_name,
+ num_of_replicas=3,
+ size=str(BACKING_IMAGE_EXT4_SIZE),
+ backing_image=BACKING_IMAGE_NAME)
# Step 3
lht_host_id = get_self_host_id()
@@ -1692,9 +1698,9 @@ Functions
lht_host_id = get_self_host_id()
volume1_name = "vol1"
- volume1 = create_and_check_volume(
- client, volume1_name, 3,
- str(1 * Gi))
+ volume1 = create_and_check_volume(client, volume1_name,
+ num_of_replicas=3,
+ size=str(1 * Gi))
volume1.attach(hostId=lht_host_id)
volume1 = wait_for_volume_healthy(client, volume1_name)
volume_endpoint = get_volume_endpoint(volume1)
@@ -1710,9 +1716,9 @@ Functions
# Create volume with that backing image
volume2_name = "vol2"
- volume2 = create_and_check_volume(
- client, volume_name=volume2_name, size=str(1 * Gi),
- backing_image=backing_img["name"])
+ volume2 = create_and_check_volume(client, volume2_name,
+ size=str(1 * Gi),
+ backing_image=backing_img["name"])
volume2.attach(hostId=lht_host_id)
diff --git a/integration/test_basic.html b/integration/test_basic.html
index fc87a755e7..274e215f63 100644
--- a/integration/test_basic.html
+++ b/integration/test_basic.html
@@ -299,8 +299,10 @@ Module tests.test_basic
numberOfReplicas=2,
frontend="invalid_frontend")
- volume = create_and_check_volume(client, volume_name, num_replicas, SIZE,
- backing_image)
+ volume = create_and_check_volume(client, volume_name,
+ num_of_replicas=num_replicas,
+ size=SIZE,
+ backing_image=backing_image)
assert volume.restoreRequired is False
def validate_volume_basic(expected, actual):
@@ -377,8 +379,11 @@ Module tests.test_basic
def volume_iscsi_basic_test(client, volume_name, backing_image=""): # NOQA
host_id = get_self_host_id()
- volume = create_and_check_volume(client, volume_name, 3, SIZE,
- backing_image, VOLUME_FRONTEND_ISCSI)
+ volume = create_and_check_volume(client, volume_name,
+ num_of_replicas=3,
+ size=SIZE,
+ backing_image=backing_image,
+ frontend=VOLUME_FRONTEND_ISCSI)
volume.attach(hostId=host_id)
volume = common.wait_for_volume_healthy(client, volume_name)
@@ -587,8 +592,10 @@ Module tests.test_basic
def backup_status_for_unavailable_replicas_test(client, volume_name, # NOQA
size, backing_image=""): # NOQA
- volume = create_and_check_volume(client, volume_name, 2, str(size),
- backing_image)
+ volume = create_and_check_volume(client, volume_name,
+ num_of_replicas=2,
+ size=str(size),
+ backing_image=backing_image)
lht_hostId = get_self_host_id()
volume = volume.attach(hostId=lht_hostId)
@@ -774,7 +781,9 @@ Module tests.test_basic
backupstore_cleanup(client)
host_id = get_self_host_id()
- vol = create_and_check_volume(client, volume_name, 2, SIZE)
+ vol = create_and_check_volume(client, volume_name,
+ num_of_replicas=2,
+ size=SIZE)
vol.attach(hostId=host_id)
vol = common.wait_for_volume_healthy(client, volume_name)
@@ -849,7 +858,9 @@ Module tests.test_basic
host_id = get_self_host_id()
- vol = create_and_check_volume(client, volume_name, 2, SIZE)
+ vol = create_and_check_volume(client, volume_name,
+ num_of_replicas=2,
+ size=SIZE)
vol.attach(hostId=host_id)
vol = common.wait_for_volume_healthy(client, volume_name)
@@ -946,7 +957,9 @@ Module tests.test_basic
host_id = get_self_host_id()
- vol = create_and_check_volume(client, volume_name, 2, SIZE)
+ vol = create_and_check_volume(client, volume_name,
+ num_of_replicas=2,
+ size=SIZE)
vol.attach(hostId=host_id)
vol = common.wait_for_volume_healthy(client, volume_name)
@@ -1025,7 +1038,9 @@ Module tests.test_basic
host_id = get_self_host_id()
- vol = create_and_check_volume(client, volume_name, 2, SIZE)
+ vol = create_and_check_volume(client, volume_name,
+ num_of_replicas=2,
+ size=SIZE)
vol.attach(hostId=host_id)
vol = common.wait_for_volume_healthy(client, volume_name)
@@ -1350,8 +1365,10 @@ Module tests.test_basic
def backup_test(client, volume_name, size, backing_image="", compression_method=DEFAULT_BACKUP_COMPRESSION_METHOD): # NOQA
- volume = create_and_check_volume(client, volume_name, 2, size,
- backing_image)
+ volume = create_and_check_volume(client, volume_name,
+ num_of_replicas=2,
+ size=size,
+ backing_image=backing_image)
lht_hostId = get_self_host_id()
volume = volume.attach(hostId=lht_hostId)
@@ -1410,8 +1427,10 @@ Module tests.test_basic
def backup_labels_test(client, random_labels, volume_name, size=SIZE, backing_image=""): # NOQA
host_id = get_self_host_id()
- volume = create_and_check_volume(client, volume_name, 2, size,
- backing_image)
+ volume = create_and_check_volume(client, volume_name,
+ num_of_replicas=2,
+ size=size,
+ backing_image=backing_image)
volume.attach(hostId=host_id)
volume = common.wait_for_volume_healthy(client, volume_name)
@@ -1461,7 +1480,9 @@ Module tests.test_basic
def restore_inc_test(client, core_api, volume_name, pod): # NOQA
- std_volume = create_and_check_volume(client, volume_name, 2, SIZE)
+ std_volume = create_and_check_volume(client, volume_name,
+ num_of_replicas=2,
+ size=SIZE)
lht_host_id = get_self_host_id()
std_volume.attach(hostId=lht_host_id)
std_volume = common.wait_for_volume_healthy(client, volume_name)
@@ -2105,7 +2126,8 @@ Module tests.test_basic
host_id = get_self_host_id()
replica_count = 2
- volume = create_and_check_volume(client, volume_name, replica_count)
+ volume = create_and_check_volume(client, volume_name,
+ num_of_replicas=replica_count)
volume.attach(hostId=host_id)
volume = common.wait_for_volume_healthy(client, volume_name)
@@ -2210,11 +2232,8 @@ Module tests.test_basic
pv_name = pvc_name
- volume = create_and_check_volume(
- client,
- volume_name,
- size=VOLUME_SIZE
- )
+ volume = create_and_check_volume(client, volume_name,
+ size=VOLUME_SIZE)
wait_for_volume_detached(client, volume_name)
@@ -2432,7 +2451,9 @@ Module tests.test_basic
5. Check if size round up '2147483648' and the written data.
"""
- volume = create_and_check_volume(client, volume_name, 2, str(1 * Gi))
+ volume = create_and_check_volume(client, volume_name,
+ num_of_replicas=2,
+ size=str(1 * Gi))
self_hostId = get_self_host_id()
volume.attach(hostId=self_hostId, disableFrontend=False)
@@ -2494,7 +2515,9 @@ Module tests.test_basic
"""
lht_host_id = get_self_host_id()
- std_volume = create_and_check_volume(client, volume_name, 2, SIZE)
+ std_volume = create_and_check_volume(client, volume_name,
+ num_of_replicas=2,
+ size=SIZE)
std_volume.attach(hostId=lht_host_id)
std_volume = common.wait_for_volume_healthy(client, volume_name)
@@ -4222,7 +4245,9 @@ Module tests.test_basic
setting = client.update(setting, value=static_sc_name)
assert setting.value == static_sc_name
- volume = create_and_check_volume(client, volume_name, 2, str(1 * Gi))
+ volume = create_and_check_volume(client, volume_name,
+ num_of_replicas=2,
+ size=str(1 * Gi))
create_pv_for_volume(client, core_api, volume, volume_name)
create_pvc_for_volume(client, core_api, volume, volume_name)
@@ -5858,8 +5883,10 @@ Functions
def backup_labels_test(client, random_labels, volume_name, size=SIZE, backing_image=""): # NOQA
host_id = get_self_host_id()
- volume = create_and_check_volume(client, volume_name, 2, size,
- backing_image)
+ volume = create_and_check_volume(client, volume_name,
+ num_of_replicas=2,
+ size=size,
+ backing_image=backing_image)
volume.attach(hostId=host_id)
volume = common.wait_for_volume_healthy(client, volume_name)
@@ -5887,8 +5914,10 @@ Functions
def backup_status_for_unavailable_replicas_test(client, volume_name, # NOQA
size, backing_image=""): # NOQA
- volume = create_and_check_volume(client, volume_name, 2, str(size),
- backing_image)
+ volume = create_and_check_volume(client, volume_name,
+ num_of_replicas=2,
+ size=str(size),
+ backing_image=backing_image)
lht_hostId = get_self_host_id()
volume = volume.attach(hostId=lht_hostId)
@@ -5962,8 +5991,10 @@ Functions
Expand source code
def backup_test(client, volume_name, size, backing_image="", compression_method=DEFAULT_BACKUP_COMPRESSION_METHOD): # NOQA
- volume = create_and_check_volume(client, volume_name, 2, size,
- backing_image)
+ volume = create_and_check_volume(client, volume_name,
+ num_of_replicas=2,
+ size=size,
+ backing_image=backing_image)
lht_hostId = get_self_host_id()
volume = volume.attach(hostId=lht_hostId)
@@ -6181,7 +6212,9 @@ Functions
Expand source code
def restore_inc_test(client, core_api, volume_name, pod): # NOQA
- std_volume = create_and_check_volume(client, volume_name, 2, SIZE)
+ std_volume = create_and_check_volume(client, volume_name,
+ num_of_replicas=2,
+ size=SIZE)
lht_host_id = get_self_host_id()
std_volume.attach(hostId=lht_host_id)
std_volume = common.wait_for_volume_healthy(client, volume_name)
@@ -9123,7 +9156,9 @@ Functions
backupstore_cleanup(client)
host_id = get_self_host_id()
- vol = create_and_check_volume(client, volume_name, 2, SIZE)
+ vol = create_and_check_volume(client, volume_name,
+ num_of_replicas=2,
+ size=SIZE)
vol.attach(hostId=host_id)
vol = common.wait_for_volume_healthy(client, volume_name)
@@ -9211,7 +9246,9 @@ Functions
host_id = get_self_host_id()
- vol = create_and_check_volume(client, volume_name, 2, SIZE)
+ vol = create_and_check_volume(client, volume_name,
+ num_of_replicas=2,
+ size=SIZE)
vol.attach(hostId=host_id)
vol = common.wait_for_volume_healthy(client, volume_name)
@@ -9316,7 +9353,9 @@ Functions
host_id = get_self_host_id()
- vol = create_and_check_volume(client, volume_name, 2, SIZE)
+ vol = create_and_check_volume(client, volume_name,
+ num_of_replicas=2,
+ size=SIZE)
vol.attach(hostId=host_id)
vol = common.wait_for_volume_healthy(client, volume_name)
@@ -9455,7 +9494,9 @@ Functions
host_id = get_self_host_id()
- vol = create_and_check_volume(client, volume_name, 2, SIZE)
+ vol = create_and_check_volume(client, volume_name,
+ num_of_replicas=2,
+ size=SIZE)
vol.attach(hostId=host_id)
vol = common.wait_for_volume_healthy(client, volume_name)
@@ -9617,7 +9658,9 @@ Functions
setting = client.update(setting, value=static_sc_name)
assert setting.value == static_sc_name
- volume = create_and_check_volume(client, volume_name, 2, str(1 * Gi))
+ volume = create_and_check_volume(client, volume_name,
+ num_of_replicas=2,
+ size=str(1 * Gi))
create_pv_for_volume(client, core_api, volume, volume_name)
create_pvc_for_volume(client, core_api, volume, volume_name)
@@ -10203,7 +10246,9 @@ Functions
5. Check if size round up '2147483648' and the written data.
"""
- volume = create_and_check_volume(client, volume_name, 2, str(1 * Gi))
+ volume = create_and_check_volume(client, volume_name,
+ num_of_replicas=2,
+ size=str(1 * Gi))
self_hostId = get_self_host_id()
volume.attach(hostId=self_hostId, disableFrontend=False)
@@ -11273,7 +11318,9 @@ Functions
"""
lht_host_id = get_self_host_id()
- std_volume = create_and_check_volume(client, volume_name, 2, SIZE)
+ std_volume = create_and_check_volume(client, volume_name,
+ num_of_replicas=2,
+ size=SIZE)
std_volume.attach(hostId=lht_host_id)
std_volume = common.wait_for_volume_healthy(client, volume_name)
@@ -12128,11 +12175,8 @@ Functions
pv_name = pvc_name
- volume = create_and_check_volume(
- client,
- volume_name,
- size=VOLUME_SIZE
- )
+ volume = create_and_check_volume(client, volume_name,
+ size=VOLUME_SIZE)
wait_for_volume_detached(client, volume_name)
@@ -12895,7 +12939,8 @@ Functions
host_id = get_self_host_id()
replica_count = 2
- volume = create_and_check_volume(client, volume_name, replica_count)
+ volume = create_and_check_volume(client, volume_name,
+ num_of_replicas=replica_count)
volume.attach(hostId=host_id)
volume = common.wait_for_volume_healthy(client, volume_name)
@@ -13014,8 +13059,10 @@ Functions
numberOfReplicas=2,
frontend="invalid_frontend")
- volume = create_and_check_volume(client, volume_name, num_replicas, SIZE,
- backing_image)
+ volume = create_and_check_volume(client, volume_name,
+ num_of_replicas=num_replicas,
+ size=SIZE,
+ backing_image=backing_image)
assert volume.restoreRequired is False
def validate_volume_basic(expected, actual):
@@ -13088,8 +13135,11 @@ Functions
def volume_iscsi_basic_test(client, volume_name, backing_image=""): # NOQA
host_id = get_self_host_id()
- volume = create_and_check_volume(client, volume_name, 3, SIZE,
- backing_image, VOLUME_FRONTEND_ISCSI)
+ volume = create_and_check_volume(client, volume_name,
+ num_of_replicas=3,
+ size=SIZE,
+ backing_image=backing_image,
+ frontend=VOLUME_FRONTEND_ISCSI)
volume.attach(hostId=host_id)
volume = common.wait_for_volume_healthy(client, volume_name)
diff --git a/integration/test_cluster_autoscaler.html b/integration/test_cluster_autoscaler.html
index 95a5443b8e..e724317c35 100644
--- a/integration/test_cluster_autoscaler.html
+++ b/integration/test_cluster_autoscaler.html
@@ -175,9 +175,8 @@ Module tests.test_cluster_autoscaler
nodes = client.list_node()
scale_size = len(nodes)-1
- volume = create_and_check_volume(
- client, volume_name, num_of_replicas=scale_size
- )
+ volume = create_and_check_volume(client, volume_name,
+ num_of_replicas=scale_size)
create_pv_for_volume(client, core_api, volume, volume.name)
create_pvc_for_volume(client, core_api, volume, volume.name)
@@ -656,9 +655,8 @@ Functions
nodes = client.list_node()
scale_size = len(nodes)-1
- volume = create_and_check_volume(
- client, volume_name, num_of_replicas=scale_size
- )
+ volume = create_and_check_volume(client, volume_name,
+ num_of_replicas=scale_size)
create_pv_for_volume(client, core_api, volume, volume.name)
create_pvc_for_volume(client, core_api, volume, volume.name)
diff --git a/integration/test_ha.html b/integration/test_ha.html
index 07d8cc9eec..8984d85c6b 100644
--- a/integration/test_ha.html
+++ b/integration/test_ha.html
@@ -141,8 +141,10 @@ Module tests.test_ha
def ha_simple_recovery_test(client, volume_name, size, backing_image=""): # NOQA
- volume = create_and_check_volume(client, volume_name, 2, size,
- backing_image)
+ volume = create_and_check_volume(client, volume_name,
+ num_of_replicas=2,
+ size=size,
+ backing_image=backing_image)
host_id = get_self_host_id()
volume = volume.attach(hostId=host_id)
@@ -276,7 +278,8 @@ Module tests.test_ha
assert setting.name == SETTING_AUTO_SALVAGE
assert setting.value == "false"
- volume = create_and_check_volume(client, volume_name, 2,
+ volume = create_and_check_volume(client, volume_name,
+ num_of_replicas=2,
backing_image=backing_image)
host_id = get_self_host_id()
@@ -319,7 +322,8 @@ Module tests.test_ha
assert setting.name == SETTING_AUTO_SALVAGE
assert setting.value == "false"
- volume = create_and_check_volume(client, volume_name, 2,
+ volume = create_and_check_volume(client, volume_name,
+ num_of_replicas=2,
backing_image=backing_image)
volume.attach(hostId=host_id)
volume = wait_for_volume_healthy(client, volume_name)
@@ -367,7 +371,8 @@ Module tests.test_ha
assert setting.name == SETTING_DISABLE_REVISION_COUNTER
assert setting.value == "true"
- volume = create_and_check_volume(client, volume_name, 3,
+ volume = create_and_check_volume(client, volume_name,
+ num_of_replicas=3,
backing_image=backing_image)
host_id = get_self_host_id()
@@ -411,7 +416,8 @@ Module tests.test_ha
assert setting.name == "disable-revision-counter"
assert setting.value == "false"
- volume = create_and_check_volume(client, volume_name, 3,
+ volume = create_and_check_volume(client, volume_name,
+ num_of_replicas=3,
backing_image=backing_image)
host_id = get_self_host_id()
@@ -535,7 +541,8 @@ Module tests.test_ha
FIXME: Move out of test_ha.py
"""
- volume = create_and_check_volume(client, volume_name, 1)
+ volume = create_and_check_volume(client, volume_name,
+ num_of_replicas=1)
host_id = get_self_host_id()
volume = volume.attach(hostId=host_id)
@@ -567,7 +574,9 @@ Module tests.test_ha
"""
original_size = str(3 * Gi)
expand_size = str(4 * Gi)
- volume = create_and_check_volume(client, volume_name, 2, original_size)
+ volume = create_and_check_volume(client, volume_name,
+ num_of_replicas=2,
+ size=original_size)
host_id = get_self_host_id()
volume.attach(hostId=host_id)
@@ -1909,7 +1918,8 @@ Module tests.test_ha
6. Read the data from the volume and verify the md5sum.
"""
replica_count = 3
- volume = create_and_check_volume(client, volume_name, replica_count)
+ volume = create_and_check_volume(client, volume_name,
+ num_of_replicas=replica_count)
host_id = get_self_host_id()
volume = volume.attach(hostId=host_id)
volume = wait_for_volume_healthy(client, volume_name)
@@ -2516,7 +2526,9 @@ Module tests.test_ha
node = common.wait_for_disk_update(client, node.name, len(update_disks))
volume_name_2 = volume_name + '-2'
- volume_2 = create_and_check_volume(client, volume_name_2, 3, str(1 * Gi))
+ volume_2 = create_and_check_volume(client, volume_name_2,
+ num_of_replicas=3,
+ size=str(1 * Gi))
volume_2.attach(hostId=host_id)
volume_2 = wait_for_volume_healthy(client, volume_name_2)
write_volume_random_data(volume_2)
@@ -2875,7 +2887,8 @@ Module tests.test_ha
node2 = common.wait_for_node_update(client, node2.id, "allowScheduling",
False)
- volume1 = create_and_check_volume(client, "vol-1", num_of_replicas=2,
+ volume1 = create_and_check_volume(client, "vol-1",
+ num_of_replicas=2,
size=str(3 * Gi))
volume1.attach(hostId=node3.id)
@@ -2922,10 +2935,12 @@ Module tests.test_ha
"""
prepare_engine_not_fully_deployed_environment(client, core_api)
- volume1 = create_and_check_volume(client, "vol-1", num_of_replicas=2,
+ volume1 = create_and_check_volume(client, "vol-1",
+ num_of_replicas=2,
size=str(3 * Gi))
- volume2 = create_and_check_volume(client, "vol-2", num_of_replicas=2,
+ volume2 = create_and_check_volume(client, "vol-2",
+ num_of_replicas=2,
size=str(3 * Gi))
default_img = common.get_default_engine_image(client)
@@ -2999,7 +3014,8 @@ Module tests.test_ha
prepare_engine_not_fully_deployed_environment(client, core_api)
# step 1
- volume1 = create_and_check_volume(client, "vol-1", num_of_replicas=2,
+ volume1 = create_and_check_volume(client, "vol-1",
+ num_of_replicas=2,
size=str(1 * Gi))
# node1: tainted node, node2: self host node, node3: the last one
@@ -3584,7 +3600,8 @@ Functions
assert setting.name == SETTING_AUTO_SALVAGE
assert setting.value == "false"
- volume = create_and_check_volume(client, volume_name, 2,
+ volume = create_and_check_volume(client, volume_name,
+ num_of_replicas=2,
backing_image=backing_image)
host_id = get_self_host_id()
@@ -3627,7 +3644,8 @@ Functions
assert setting.name == SETTING_AUTO_SALVAGE
assert setting.value == "false"
- volume = create_and_check_volume(client, volume_name, 2,
+ volume = create_and_check_volume(client, volume_name,
+ num_of_replicas=2,
backing_image=backing_image)
volume.attach(hostId=host_id)
volume = wait_for_volume_healthy(client, volume_name)
@@ -3675,7 +3693,8 @@ Functions
assert setting.name == SETTING_DISABLE_REVISION_COUNTER
assert setting.value == "true"
- volume = create_and_check_volume(client, volume_name, 3,
+ volume = create_and_check_volume(client, volume_name,
+ num_of_replicas=3,
backing_image=backing_image)
host_id = get_self_host_id()
@@ -3719,7 +3738,8 @@ Functions
assert setting.name == "disable-revision-counter"
assert setting.value == "false"
- volume = create_and_check_volume(client, volume_name, 3,
+ volume = create_and_check_volume(client, volume_name,
+ num_of_replicas=3,
backing_image=backing_image)
host_id = get_self_host_id()
@@ -3760,8 +3780,10 @@ Functions
Expand source code
def ha_simple_recovery_test(client, volume_name, size, backing_image=""): # NOQA
- volume = create_and_check_volume(client, volume_name, 2, size,
- backing_image)
+ volume = create_and_check_volume(client, volume_name,
+ num_of_replicas=2,
+ size=size,
+ backing_image=backing_image)
host_id = get_self_host_id()
volume = volume.attach(hostId=host_id)
@@ -5126,10 +5148,12 @@ Functions
"""
prepare_engine_not_fully_deployed_environment(client, core_api)
- volume1 = create_and_check_volume(client, "vol-1", num_of_replicas=2,
+ volume1 = create_and_check_volume(client, "vol-1",
+ num_of_replicas=2,
size=str(3 * Gi))
- volume2 = create_and_check_volume(client, "vol-2", num_of_replicas=2,
+ volume2 = create_and_check_volume(client, "vol-2",
+ num_of_replicas=2,
size=str(3 * Gi))
default_img = common.get_default_engine_image(client)
@@ -5239,7 +5263,8 @@ Functions
prepare_engine_not_fully_deployed_environment(client, core_api)
# step 1
- volume1 = create_and_check_volume(client, "vol-1", num_of_replicas=2,
+ volume1 = create_and_check_volume(client, "vol-1",
+ num_of_replicas=2,
size=str(1 * Gi))
# node1: tainted node, node2: self host node, node3: the last one
@@ -5497,7 +5522,8 @@ Functions
node2 = common.wait_for_node_update(client, node2.id, "allowScheduling",
False)
- volume1 = create_and_check_volume(client, "vol-1", num_of_replicas=2,
+ volume1 = create_and_check_volume(client, "vol-1",
+ num_of_replicas=2,
size=str(3 * Gi))
volume1.attach(hostId=node3.id)
@@ -5792,7 +5818,8 @@ Functions
FIXME: Move out of test_ha.py
"""
- volume = create_and_check_volume(client, volume_name, 1)
+ volume = create_and_check_volume(client, volume_name,
+ num_of_replicas=1)
host_id = get_self_host_id()
volume = volume.attach(hostId=host_id)
@@ -5844,7 +5871,9 @@ Functions
"""
original_size = str(3 * Gi)
expand_size = str(4 * Gi)
- volume = create_and_check_volume(client, volume_name, 2, original_size)
+ volume = create_and_check_volume(client, volume_name,
+ num_of_replicas=2,
+ size=original_size)
host_id = get_self_host_id()
volume.attach(hostId=host_id)
@@ -6352,7 +6381,8 @@ Functions
6. Read the data from the volume and verify the md5sum.
"""
replica_count = 3
- volume = create_and_check_volume(client, volume_name, replica_count)
+ volume = create_and_check_volume(client, volume_name,
+ num_of_replicas=replica_count)
host_id = get_self_host_id()
volume = volume.attach(hostId=host_id)
volume = wait_for_volume_healthy(client, volume_name)
@@ -6932,7 +6962,9 @@ Functions
node = common.wait_for_disk_update(client, node.name, len(update_disks))
volume_name_2 = volume_name + '-2'
- volume_2 = create_and_check_volume(client, volume_name_2, 3, str(1 * Gi))
+ volume_2 = create_and_check_volume(client, volume_name_2,
+ num_of_replicas=3,
+ size=str(1 * Gi))
volume_2.attach(hostId=host_id)
volume_2 = wait_for_volume_healthy(client, volume_name_2)
write_volume_random_data(volume_2)
diff --git a/integration/test_migration.html b/integration/test_migration.html
index 8fa5a9fd07..0ced467e74 100644
--- a/integration/test_migration.html
+++ b/integration/test_migration.html
@@ -432,10 +432,9 @@ Module tests.test_migration
"""
# Step 1
lht_host_id = get_self_host_id()
- volume = create_and_check_volume(client,
- volume_name,
- REPLICA_COUNT,
- SIZE)
+ volume = create_and_check_volume(client, volume_name,
+ num_of_replicas=REPLICA_COUNT,
+ size=SIZE)
attachment_id = common.generate_attachment_ticket_id()
volume.attach(attachmentID=attachment_id, hostId=lht_host_id)
@@ -1059,10 +1058,9 @@ Functions
"""
# Step 1
lht_host_id = get_self_host_id()
- volume = create_and_check_volume(client,
- volume_name,
- REPLICA_COUNT,
- SIZE)
+ volume = create_and_check_volume(client, volume_name,
+ num_of_replicas=REPLICA_COUNT,
+ size=SIZE)
attachment_id = common.generate_attachment_ticket_id()
volume.attach(attachmentID=attachment_id, hostId=lht_host_id)
diff --git a/integration/test_orphan.html b/integration/test_orphan.html
index 578be1a52c..e517ec907d 100644
--- a/integration/test_orphan.html
+++ b/integration/test_orphan.html
@@ -89,7 +89,9 @@ Module tests.test_orphan
nodes = client.list_node()
- volume = create_and_check_volume(client, volume_name, len(nodes), SIZE)
+ volume = create_and_check_volume(client, volume_name,
+ num_of_replicas=len(nodes),
+ size=SIZE)
volume.attach(hostId=lht_hostId, disableFrontend=False)
wait_for_volume_healthy(client, volume_name)
@@ -874,7 +876,9 @@ Functions
nodes = client.list_node()
- volume = create_and_check_volume(client, volume_name, len(nodes), SIZE)
+ volume = create_and_check_volume(client, volume_name,
+ num_of_replicas=len(nodes),
+ size=SIZE)
volume.attach(hostId=lht_hostId, disableFrontend=False)
wait_for_volume_healthy(client, volume_name)
diff --git a/integration/test_recurring_job.html b/integration/test_recurring_job.html
index 8b820aee33..35fcf1bbd8 100644
--- a/integration/test_recurring_job.html
+++ b/integration/test_recurring_job.html
@@ -97,6 +97,8 @@ Module tests.test_recurring_job
from common import wait_for_cron_job_create
from common import wait_for_cron_job_delete
+from common import ACCESS_MODE_RWO
+from common import ACCESS_MODE_RWX
from common import JOB_LABEL
from common import KUBERNETES_STATUS_LABEL
from common import LONGHORN_NAMESPACE
@@ -2110,7 +2112,8 @@ Module tests.test_recurring_job
@pytest.mark.recurring_job # NOQA
-def test_recurring_job_filesystem_trim(client, core_api, batch_v1_api, volume_name, csi_pv, pvc, pod_make): # NOQA
+@pytest.mark.parametrize("access_mode", [ACCESS_MODE_RWO, ACCESS_MODE_RWX]) # NOQA
+def test_recurring_job_filesystem_trim(client, core_api, batch_v1_api, volume_name, csi_pv, pvc, pod_make, access_mode): # NOQA
"""
Scenario: test recurring job filesystem-trim
@@ -2131,7 +2134,8 @@ Module tests.test_recurring_job
"""
pod_name, _, _, _ = \
prepare_pod_with_data_in_mb(client, core_api, csi_pv, pvc, pod_make,
- volume_name, data_size_in_mb=10)
+ volume_name, data_size_in_mb=10,
+ access_mode=access_mode)
volume = client.by_id_volume(volume_name)
@@ -3400,7 +3404,7 @@ Delete m
-def test_recurring_job_filesystem_trim(client, core_api, batch_v1_api, volume_name, csi_pv, pvc, pod_make)
+def test_recurring_job_filesystem_trim(client, core_api, batch_v1_api, volume_name, csi_pv, pvc, pod_make, access_mode)
Scenario: test recurring job filesystem-trim
@@ -3421,7 +3425,8 @@ Delete m
Expand source code
@pytest.mark.recurring_job # NOQA
-def test_recurring_job_filesystem_trim(client, core_api, batch_v1_api, volume_name, csi_pv, pvc, pod_make): # NOQA
+@pytest.mark.parametrize("access_mode", [ACCESS_MODE_RWO, ACCESS_MODE_RWX]) # NOQA
+def test_recurring_job_filesystem_trim(client, core_api, batch_v1_api, volume_name, csi_pv, pvc, pod_make, access_mode): # NOQA
"""
Scenario: test recurring job filesystem-trim
@@ -3442,7 +3447,8 @@ Delete m
"""
pod_name, _, _, _ = \
prepare_pod_with_data_in_mb(client, core_api, csi_pv, pvc, pod_make,
- volume_name, data_size_in_mb=10)
+ volume_name, data_size_in_mb=10,
+ access_mode=access_mode)
volume = client.by_id_volume(volume_name)
diff --git a/integration/test_scheduling.html b/integration/test_scheduling.html
index 467299013c..e603d32c9c 100644
--- a/integration/test_scheduling.html
+++ b/integration/test_scheduling.html
@@ -1110,8 +1110,7 @@ Module tests.test_scheduling
pod1['metadata']['name'] = pod1_name
- volume1 = create_and_check_volume(client,
- volume1_name,
+ volume1 = create_and_check_volume(client, volume1_name,
num_of_replicas=1,
size=volume1_size)
@@ -2387,8 +2386,7 @@ Functions
pod1['metadata']['name'] = pod1_name
- volume1 = create_and_check_volume(client,
- volume1_name,
+ volume1 = create_and_check_volume(client, volume1_name,
num_of_replicas=1,
size=volume1_size)
diff --git a/integration/test_settings.html b/integration/test_settings.html
index 691faf545d..deacc4e895 100644
--- a/integration/test_settings.html
+++ b/integration/test_settings.html
@@ -676,9 +676,10 @@ Module tests.test_settings
]
for volume_name in volume_names:
- create_and_check_volume(
- client, volume_name, 3, str(BACKING_IMAGE_EXT4_SIZE),
- BACKING_IMAGE_NAME)
+ create_and_check_volume(client, volume_name,
+ num_of_replicas=3,
+ size=str(BACKING_IMAGE_EXT4_SIZE),
+ backing_image=BACKING_IMAGE_NAME)
# Step 4
lht_host_id = get_self_host_id()
@@ -1852,9 +1853,10 @@ Functions
]
for volume_name in volume_names:
- create_and_check_volume(
- client, volume_name, 3, str(BACKING_IMAGE_EXT4_SIZE),
- BACKING_IMAGE_NAME)
+ create_and_check_volume(client, volume_name,
+ num_of_replicas=3,
+ size=str(BACKING_IMAGE_EXT4_SIZE),
+ backing_image=BACKING_IMAGE_NAME)
# Step 4
lht_host_id = get_self_host_id()
diff --git a/integration/test_snapshot.html b/integration/test_snapshot.html
index 782cabc5f5..32c856e09c 100644
--- a/integration/test_snapshot.html
+++ b/integration/test_snapshot.html
@@ -349,7 +349,9 @@ Module tests.test_snapshot
"""
# Step 1
- volume = create_and_check_volume(client, volume_name, 3, size=str(2 * Gi))
+ volume = create_and_check_volume(client, volume_name,
+ num_of_replicas=3,
+ size=str(2 * Gi))
lht_hostId = get_self_host_id()
volume = volume.attach(hostId=lht_hostId)
@@ -600,7 +602,8 @@ Module tests.test_snapshot
"""
# Step 1
- volume = create_and_check_volume(client, volume_name, 3,
+ volume = create_and_check_volume(client, volume_name,
+ num_of_replicas=3,
size=str(volume_size * Mi),
snapshot_data_integrity=snapshot_data_integrity) # NOQA
@@ -632,7 +635,8 @@ Module tests.test_snapshot
"""
# Step 1
- volume = create_and_check_volume(client, volume_name, 3,
+ volume = create_and_check_volume(client, volume_name,
+ num_of_replicas=3,
size=str(16 * Mi),
snapshot_data_integrity=snapshot_data_integrity) # NOQA
@@ -672,7 +676,8 @@ Module tests.test_snapshot
"""
# Step 1
- volume = create_and_check_volume(client, volume_name, 3,
+ volume = create_and_check_volume(client, volume_name,
+ num_of_replicas=3,
size=str(16 * Mi),
snapshot_data_integrity=snapshot_data_integrity) # NOQA
@@ -722,7 +727,9 @@ Module tests.test_snapshot
client.update(setting, value="true")
lht_hostId = get_self_host_id()
- volume = create_and_check_volume(client, volume_name, 3, size=str(1 * Gi))
+ volume = create_and_check_volume(client, volume_name,
+ num_of_replicas=3,
+ size=str(1 * Gi))
volume = volume.attach(hostId=lht_hostId)
wait_for_volume_healthy(client, volume_name)
volume = client.by_id_volume(volume_name)
@@ -781,7 +788,8 @@ Functions
"""
# Step 1
- volume = create_and_check_volume(client, volume_name, 3,
+ volume = create_and_check_volume(client, volume_name,
+ num_of_replicas=3,
size=str(volume_size * Mi),
snapshot_data_integrity=snapshot_data_integrity) # NOQA
@@ -830,7 +838,8 @@ Functions
"""
# Step 1
- volume = create_and_check_volume(client, volume_name, 3,
+ volume = create_and_check_volume(client, volume_name,
+ num_of_replicas=3,
size=str(16 * Mi),
snapshot_data_integrity=snapshot_data_integrity) # NOQA
@@ -889,7 +898,8 @@ Functions
"""
# Step 1
- volume = create_and_check_volume(client, volume_name, 3,
+ volume = create_and_check_volume(client, volume_name,
+ num_of_replicas=3,
size=str(16 * Mi),
snapshot_data_integrity=snapshot_data_integrity) # NOQA
@@ -1078,7 +1088,9 @@ Functions
"""
# Step 1
- volume = create_and_check_volume(client, volume_name, 3, size=str(2 * Gi))
+ volume = create_and_check_volume(client, volume_name,
+ num_of_replicas=3,
+ size=str(2 * Gi))
lht_hostId = get_self_host_id()
volume = volume.attach(hostId=lht_hostId)
@@ -1334,7 +1346,9 @@ Functions
client.update(setting, value="true")
lht_hostId = get_self_host_id()
- volume = create_and_check_volume(client, volume_name, 3, size=str(1 * Gi))
+ volume = create_and_check_volume(client, volume_name,
+ num_of_replicas=3,
+ size=str(1 * Gi))
volume = volume.attach(hostId=lht_hostId)
wait_for_volume_healthy(client, volume_name)
volume = client.by_id_volume(volume_name)
diff --git a/integration/test_upgrade.html b/integration/test_upgrade.html
index c1ea99c5be..27067b8e2d 100644
--- a/integration/test_upgrade.html
+++ b/integration/test_upgrade.html
@@ -377,11 +377,9 @@ Module tests.test_upgrade
set_backupstore_nfs(client)
mount_nfs_backupstore(client)
backup_vol_name = "backup-vol"
- backup_vol = create_and_check_volume(
- client,
- backup_vol_name,
- 2,
- str(DEFAULT_VOLUME_SIZE * Gi))
+ backup_vol = create_and_check_volume(client, backup_vol_name,
+ num_of_replicas=2,
+ size=str(DEFAULT_VOLUME_SIZE * Gi))
backup_vol.attach(hostId=host_id)
backup_vol = wait_for_volume_healthy(client, backup_vol_name)
data0 = {'pos': 0, 'len': BACKUP_BLOCK_SIZE,
@@ -1063,11 +1061,9 @@ Prerequisite
set_backupstore_nfs(client)
mount_nfs_backupstore(client)
backup_vol_name = "backup-vol"
- backup_vol = create_and_check_volume(
- client,
- backup_vol_name,
- 2,
- str(DEFAULT_VOLUME_SIZE * Gi))
+ backup_vol = create_and_check_volume(client, backup_vol_name,
+ num_of_replicas=2,
+ size=str(DEFAULT_VOLUME_SIZE * Gi))
backup_vol.attach(hostId=host_id)
backup_vol = wait_for_volume_healthy(client, backup_vol_name)
data0 = {'pos': 0, 'len': BACKUP_BLOCK_SIZE,
diff --git a/integration/test_zone.html b/integration/test_zone.html
index 435f4988bc..32b3c2f6ea 100644
--- a/integration/test_zone.html
+++ b/integration/test_zone.html
@@ -173,7 +173,8 @@ Module tests.test_zone
wait_longhorn_node_zone_updated(client)
- volume = create_and_check_volume(client, volume_name, num_of_replicas=2)
+ volume = create_and_check_volume(client, volume_name,
+ num_of_replicas=2)
host_id = get_self_host_id()
@@ -2601,7 +2602,8 @@ Examples
wait_longhorn_node_zone_updated(client)
- volume = create_and_check_volume(client, volume_name, num_of_replicas=2)
+ volume = create_and_check_volume(client, volume_name,
+ num_of_replicas=2)
host_id = get_self_host_id()