From fee00aac396e000ccedd726982c00cbb72dc8a2d Mon Sep 17 00:00:00 2001 From: yangchiu Date: Sun, 28 Jan 2024 04:29:13 +0000 Subject: [PATCH] Update testing docs Signed-off-by: yangchiu --- index.html | 2 +- integration/common.html | 31 +++-- integration/test_backing_image.html | 106 ++++++++-------- integration/test_basic.html | 146 +++++++++++++++-------- integration/test_cluster_autoscaler.html | 10 +- integration/test_ha.html | 88 +++++++++----- integration/test_migration.html | 14 +-- integration/test_orphan.html | 8 +- integration/test_recurring_job.html | 16 ++- integration/test_scheduling.html | 6 +- integration/test_settings.html | 14 ++- integration/test_snapshot.html | 34 ++++-- integration/test_upgrade.html | 16 +-- integration/test_zone.html | 6 +- 14 files changed, 307 insertions(+), 190 deletions(-) diff --git a/index.html b/index.html index 4340116081..847f53eb25 100644 --- a/index.html +++ b/index.html @@ -1,7 +1,7 @@ - + Longhorn Manual Test Cases diff --git a/integration/common.html b/integration/common.html index 7c92b18227..e2a449065b 100644 --- a/integration/common.html +++ b/integration/common.html @@ -315,6 +315,9 @@ <h1 class="title">Module <code>tests.common</code></h1> FS_TYPE_EXT4 = "ext4" FS_TYPE_XFS = "xfs" +ACCESS_MODE_RWO = "rwo" +ACCESS_MODE_RWX = "rwx" + ATTACHER_TYPE_CSI_ATTACHER = "csi-attacher" ATTACHER_TYPE_LONGHORN_API = "longhorn-api" ATTACHER_TYPE_LONGHORN_UPGRADER = "longhorn-upgrader" @@ -521,7 +524,8 @@ <h1 class="title">Module <code>tests.common</code></h1> 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. @@ -540,7 +544,8 @@ <h1 class="title">Module <code>tests.common</code></h1> 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 @@ -5015,7 +5020,8 @@ <h1 class="title">Module <code>tests.common</code></h1> 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 @@ -5040,7 +5046,8 @@ <h1 class="title">Module <code>tests.common</code></h1> 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') @@ -7409,7 +7416,7 @@ <h2 id="returns">Returns</h2> </details> </dd> <dt id="tests.common.create_and_check_volume"><code class="name flex"> -<span>def <span class="ident">create_and_check_volume</span></span>(<span>client, volume_name, num_of_replicas=3, size='16777216', backing_image='', frontend='blockdev', snapshot_data_integrity='ignored')</span> +<span>def <span class="ident">create_and_check_volume</span></span>(<span>client, volume_name, num_of_replicas=3, size='16777216', backing_image='', frontend='blockdev', snapshot_data_integrity='ignored', access_mode='rwo')</span> </code></dt> <dd> <div class="desc"><p>Create a new volume with the specified parameters. Assert that the new @@ -7429,7 +7436,8 @@ <h2 id="returns">Returns</h2> <pre><code class="python">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 @@ <h2 id="returns">Returns</h2> 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 @@ <h2 id="args">Args</h2> </details> </dd> <dt id="tests.common.prepare_pod_with_data_in_mb"><code class="name flex"> -<span>def <span class="ident">prepare_pod_with_data_in_mb</span></span>(<span>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)</span> +<span>def <span class="ident">prepare_pod_with_data_in_mb</span></span>(<span>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')</span> </code></dt> <dd> <div class="desc"></div> @@ -10775,7 +10784,8 @@ <h2 id="args">Args</h2> <pre><code class="python">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 @@ <h2 id="args">Args</h2> 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 @@ <h1 class="title">Module <code>tests.test_backing_image</code></h1> 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 @@ <h1 class="title">Module <code>tests.test_backing_image</code></h1> 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 @@ <h1 class="title">Module <code>tests.test_backing_image</code></h1> 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 @@ <h1 class="title">Module <code>tests.test_backing_image</code></h1> 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 @@ <h1 class="title">Module <code>tests.test_backing_image</code></h1> # 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 @@ <h1 class="title">Module <code>tests.test_backing_image</code></h1> 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 @@ <h1 class="title">Module <code>tests.test_backing_image</code></h1> # 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 @@ <h2 class="section-title" id="header-functions">Functions</h2> 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 @@ <h2 class="section-title" id="header-functions">Functions</h2> # 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 @@ <h2 class="section-title" id="header-functions">Functions</h2> 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 @@ <h2 class="section-title" id="header-functions">Functions</h2> 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 @@ <h2 class="section-title" id="header-functions">Functions</h2> 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 @@ <h2 class="section-title" id="header-functions">Functions</h2> 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 @@ <h2 class="section-title" id="header-functions">Functions</h2> # 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 @@ <h1 class="title">Module <code>tests.test_basic</code></h1> 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 @@ <h1 class="title">Module <code>tests.test_basic</code></h1> 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 @@ <h1 class="title">Module <code>tests.test_basic</code></h1> 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 @@ <h1 class="title">Module <code>tests.test_basic</code></h1> 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 @@ <h1 class="title">Module <code>tests.test_basic</code></h1> 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 @@ <h1 class="title">Module <code>tests.test_basic</code></h1> 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 @@ <h1 class="title">Module <code>tests.test_basic</code></h1> 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 @@ <h1 class="title">Module <code>tests.test_basic</code></h1> 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 @@ <h1 class="title">Module <code>tests.test_basic</code></h1> 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 @@ <h1 class="title">Module <code>tests.test_basic</code></h1> 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 @@ <h1 class="title">Module <code>tests.test_basic</code></h1> 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 @@ <h1 class="title">Module <code>tests.test_basic</code></h1> 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 @@ <h1 class="title">Module <code>tests.test_basic</code></h1> 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 @@ <h1 class="title">Module <code>tests.test_basic</code></h1> """ 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 @@ <h1 class="title">Module <code>tests.test_basic</code></h1> 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 @@ <h2 class="section-title" id="header-functions">Functions</h2> <pre><code class="python">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 @@ <h2 class="section-title" id="header-functions">Functions</h2> </summary> <pre><code class="python">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 @@ <h2 class="section-title" id="header-functions">Functions</h2> <span>Expand source code</span> </summary> <pre><code class="python">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 @@ <h2 class="section-title" id="header-functions">Functions</h2> <span>Expand source code</span> </summary> <pre><code class="python">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 @@ <h2 class="section-title" id="header-functions">Functions</h2> 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 @@ <h2 class="section-title" id="header-functions">Functions</h2> 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 @@ <h2 class="section-title" id="header-functions">Functions</h2> 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 @@ <h2 class="section-title" id="header-functions">Functions</h2> 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 @@ <h2 class="section-title" id="header-functions">Functions</h2> 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 @@ <h2 class="section-title" id="header-functions">Functions</h2> 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 @@ <h2 class="section-title" id="header-functions">Functions</h2> """ 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 @@ <h2 class="section-title" id="header-functions">Functions</h2> 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 @@ <h2 class="section-title" id="header-functions">Functions</h2> 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 @@ <h2 class="section-title" id="header-functions">Functions</h2> 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 @@ <h2 class="section-title" id="header-functions">Functions</h2> </summary> <pre><code class="python">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 @@ <h1 class="title">Module <code>tests.test_cluster_autoscaler</code></h1> 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 @@ <h2 class="section-title" id="header-functions">Functions</h2> 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 @@ <h1 class="title">Module <code>tests.test_ha</code></h1> 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 @@ <h1 class="title">Module <code>tests.test_ha</code></h1> 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 @@ <h1 class="title">Module <code>tests.test_ha</code></h1> 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 @@ <h1 class="title">Module <code>tests.test_ha</code></h1> 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 @@ <h1 class="title">Module <code>tests.test_ha</code></h1> 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 @@ <h1 class="title">Module <code>tests.test_ha</code></h1> 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 @@ <h1 class="title">Module <code>tests.test_ha</code></h1> """ 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 @@ <h1 class="title">Module <code>tests.test_ha</code></h1> 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 @@ <h1 class="title">Module <code>tests.test_ha</code></h1> 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 @@ <h1 class="title">Module <code>tests.test_ha</code></h1> 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 @@ <h1 class="title">Module <code>tests.test_ha</code></h1> """ 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 @@ <h1 class="title">Module <code>tests.test_ha</code></h1> 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 @@ <h2 class="section-title" id="header-functions">Functions</h2> 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 @@ <h2 class="section-title" id="header-functions">Functions</h2> 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 @@ <h2 class="section-title" id="header-functions">Functions</h2> 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 @@ <h2 class="section-title" id="header-functions">Functions</h2> 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 @@ <h2 class="section-title" id="header-functions">Functions</h2> <span>Expand source code</span> </summary> <pre><code class="python">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 @@ <h2 class="section-title" id="header-functions">Functions</h2> """ 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 @@ <h2 class="section-title" id="header-functions">Functions</h2> 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 @@ <h2 class="section-title" id="header-functions">Functions</h2> 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 @@ <h2 class="section-title" id="header-functions">Functions</h2> 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 @@ <h2 class="section-title" id="header-functions">Functions</h2> """ 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 @@ <h2 class="section-title" id="header-functions">Functions</h2> 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 @@ <h2 class="section-title" id="header-functions">Functions</h2> 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 @@ <h1 class="title">Module <code>tests.test_migration</code></h1> """ # 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 @@ <h2 class="section-title" id="header-functions">Functions</h2> """ # 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 @@ <h1 class="title">Module <code>tests.test_orphan</code></h1> 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 @@ <h2 class="section-title" id="header-functions">Functions</h2> 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 @@ <h1 class="title">Module <code>tests.test_recurring_job</code></h1> 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 @@ <h1 class="title">Module <code>tests.test_recurring_job</code></h1> @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 @@ <h1 class="title">Module <code>tests.test_recurring_job</code></h1> """ 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 @@ <h1 id="delete-multiple-recurring-jobs-should-reflect-on-the-cron-jobs">Delete m </details> </dd> <dt id="tests.test_recurring_job.test_recurring_job_filesystem_trim"><code class="name flex"> -<span>def <span class="ident">test_recurring_job_filesystem_trim</span></span>(<span>client, core_api, batch_v1_api, volume_name, csi_pv, pvc, pod_make)</span> +<span>def <span class="ident">test_recurring_job_filesystem_trim</span></span>(<span>client, core_api, batch_v1_api, volume_name, csi_pv, pvc, pod_make, access_mode)</span> </code></dt> <dd> <div class="desc"><p>Scenario: test recurring job filesystem-trim</p> @@ -3421,7 +3425,8 @@ <h1 id="delete-multiple-recurring-jobs-should-reflect-on-the-cron-jobs">Delete m <span>Expand source code</span> </summary> <pre><code class="python">@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 @@ <h1 id="delete-multiple-recurring-jobs-should-reflect-on-the-cron-jobs">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 @@ <h1 class="title">Module <code>tests.test_scheduling</code></h1> 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 @@ <h2 class="section-title" id="header-functions">Functions</h2> 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 @@ <h1 class="title">Module <code>tests.test_settings</code></h1> ] 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 @@ <h2 class="section-title" id="header-functions">Functions</h2> ] 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 @@ <h1 class="title">Module <code>tests.test_snapshot</code></h1> """ # 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 @@ <h1 class="title">Module <code>tests.test_snapshot</code></h1> """ # 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 @@ <h1 class="title">Module <code>tests.test_snapshot</code></h1> """ # 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 @@ <h1 class="title">Module <code>tests.test_snapshot</code></h1> """ # 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 @@ <h1 class="title">Module <code>tests.test_snapshot</code></h1> 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 @@ <h2 class="section-title" id="header-functions">Functions</h2> """ # 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 @@ <h2 class="section-title" id="header-functions">Functions</h2> """ # 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 @@ <h2 class="section-title" id="header-functions">Functions</h2> """ # 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 @@ <h2 class="section-title" id="header-functions">Functions</h2> """ # 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 @@ <h2 class="section-title" id="header-functions">Functions</h2> 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 @@ <h1 class="title">Module <code>tests.test_upgrade</code></h1> 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 @@ <h2 id="prerequisite">Prerequisite</h2> 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 @@ <h1 class="title">Module <code>tests.test_zone</code></h1> 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 @@ <h2 id="examples">Examples</h2> 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()