From e80eaf29c7f2d9a1cd545df708dcbc300eb1db32 Mon Sep 17 00:00:00 2001 From: khushboo-rancher Date: Tue, 14 Nov 2023 21:44:36 +0000 Subject: [PATCH] Update testing docs Signed-off-by: khushboo-rancher --- index.html | 2 +- integration/test_scheduling.html | 192 ++++++++++++++++++++++++++++++- 2 files changed, 189 insertions(+), 5 deletions(-) diff --git a/index.html b/index.html index e3f58935e0..73c3c900fc 100644 --- a/index.html +++ b/index.html @@ -1,7 +1,7 @@ - + Longhorn Manual Test Cases diff --git a/integration/test_scheduling.html b/integration/test_scheduling.html index 7ec1b04de6..467299013c 100644 --- a/integration/test_scheduling.html +++ b/integration/test_scheduling.html @@ -1753,6 +1753,38 @@ <h1 class="title">Module <code>tests.test_scheduling</code></h1> @pytest.mark.skip(reason="TODO") +def test_allow_empty_node_selector_volume_setting(): # NOQA + """ + Test the global setting allow-empty-node-selector-volume + + If true, a replica of the volume without node selector + can be scheduled on node with tags. + + If false, a replica of the volume without node selector + can not be scheduled on node with tags. + + Setup + - Prepare 3 nodes + - Add `AVAIL` tag to nodes + - Set allow-empty-node-selector-volume to `false` + + When + - Create a Volume with 3 replicas without tag + + Then + - All replicas can not be scheduled to the nodes + + When + - Remove `AVAIL` tag from one of the node + - Set allow-empty-node-selector-volume to `true` + + Then + - Wait for a while for controller to resync the volume, + all replicas can be scheduled to the nodes + """ + pass + + def test_global_disk_soft_anti_affinity(): # NOQA """ 1. When Replica Disk Soft Anti-Affinity is false, it should be impossible @@ -1803,6 +1835,38 @@ <h1 class="title">Module <code>tests.test_scheduling</code></h1> @pytest.mark.skip(reason="TODO") +def test_allow_empty_disk_selector_volume_setting(): # NOQA + """ + Test the global setting allow-empty-disk-selector-volume + + If true, a replica of the volume without disk selector + can be scheduled on disk with tags. + + If false, a replica of the volume without disk selector + can not be scheduled on disk with tags. + + Setup + - Prepare 3 nodes each with one disk + - Add `AVAIL` tag to every disk + - Set allow-empty-disk-selector-volume to `false` + + When + - Create a Volume with 3 replicas without tag + + Then + - All replicas can not be scheduled to the disks on the nodes + + When + - Remove `AVAIL` tag from one of the node + - Set allow-empty-disk-selector-volume to `true` + + Then + - Wait for a while for controller to resync the volume, + all replicas can be scheduled to the disks on the nodes + """ + pass + + def test_volume_disk_soft_anti_affinity(): # NOQA """ 1. When Replica Disk Soft Anti-Affinity is disabled, it should be @@ -1975,6 +2039,126 @@ <h2 class="section-title" id="header-functions">Functions</h2> client.update(setting, value="true")</code></pre> </details> </dd> +<dt id="tests.test_scheduling.test_allow_empty_disk_selector_volume_setting"><code class="name flex"> +<span>def <span class="ident">test_allow_empty_disk_selector_volume_setting</span></span>(<span>)</span> +</code></dt> +<dd> +<div class="desc"><p>Test the global setting allow-empty-disk-selector-volume</p> +<p>If true, a replica of the volume without disk selector +can be scheduled on disk with tags.</p> +<p>If false, a replica of the volume without disk selector +can not be scheduled on disk with tags.</p> +<p>Setup +- Prepare 3 nodes each with one disk +- Add <code>AVAIL</code> tag to every disk +- Set allow-empty-disk-selector-volume to <code>false</code></p> +<p>When +- Create a Volume with 3 replicas without tag</p> +<p>Then +- All replicas can not be scheduled to the disks on the nodes</p> +<p>When +- Remove <code>AVAIL</code> tag from one of the node +- Set allow-empty-disk-selector-volume to <code>true</code></p> +<p>Then +- Wait for a while for controller to resync the volume, +all replicas can be scheduled to the disks on the nodes</p></div> +<details class="source"> +<summary> +<span>Expand source code</span> +</summary> +<pre><code class="python">@pytest.mark.skip(reason="TODO") +def test_allow_empty_disk_selector_volume_setting(): # NOQA + """ + Test the global setting allow-empty-disk-selector-volume + + If true, a replica of the volume without disk selector + can be scheduled on disk with tags. + + If false, a replica of the volume without disk selector + can not be scheduled on disk with tags. + + Setup + - Prepare 3 nodes each with one disk + - Add `AVAIL` tag to every disk + - Set allow-empty-disk-selector-volume to `false` + + When + - Create a Volume with 3 replicas without tag + + Then + - All replicas can not be scheduled to the disks on the nodes + + When + - Remove `AVAIL` tag from one of the node + - Set allow-empty-disk-selector-volume to `true` + + Then + - Wait for a while for controller to resync the volume, + all replicas can be scheduled to the disks on the nodes + """ + pass</code></pre> +</details> +</dd> +<dt id="tests.test_scheduling.test_allow_empty_node_selector_volume_setting"><code class="name flex"> +<span>def <span class="ident">test_allow_empty_node_selector_volume_setting</span></span>(<span>)</span> +</code></dt> +<dd> +<div class="desc"><p>Test the global setting allow-empty-node-selector-volume</p> +<p>If true, a replica of the volume without node selector +can be scheduled on node with tags.</p> +<p>If false, a replica of the volume without node selector +can not be scheduled on node with tags.</p> +<p>Setup +- Prepare 3 nodes +- Add <code>AVAIL</code> tag to nodes +- Set allow-empty-node-selector-volume to <code>false</code></p> +<p>When +- Create a Volume with 3 replicas without tag</p> +<p>Then +- All replicas can not be scheduled to the nodes</p> +<p>When +- Remove <code>AVAIL</code> tag from one of the node +- Set allow-empty-node-selector-volume to <code>true</code></p> +<p>Then +- Wait for a while for controller to resync the volume, +all replicas can be scheduled to the nodes</p></div> +<details class="source"> +<summary> +<span>Expand source code</span> +</summary> +<pre><code class="python">@pytest.mark.skip(reason="TODO") +def test_allow_empty_node_selector_volume_setting(): # NOQA + """ + Test the global setting allow-empty-node-selector-volume + + If true, a replica of the volume without node selector + can be scheduled on node with tags. + + If false, a replica of the volume without node selector + can not be scheduled on node with tags. + + Setup + - Prepare 3 nodes + - Add `AVAIL` tag to nodes + - Set allow-empty-node-selector-volume to `false` + + When + - Create a Volume with 3 replicas without tag + + Then + - All replicas can not be scheduled to the nodes + + When + - Remove `AVAIL` tag from one of the node + - Set allow-empty-node-selector-volume to `true` + + Then + - Wait for a while for controller to resync the volume, + all replicas can be scheduled to the nodes + """ + pass</code></pre> +</details> +</dd> <dt id="tests.test_scheduling.test_data_locality_basic"><code class="name flex"> <span>def <span class="ident">test_data_locality_basic</span></span>(<span>client, core_api, volume_name, pod, settings_reset)</span> </code></dt> @@ -2729,8 +2913,7 @@ <h2 class="section-title" id="header-functions">Functions</h2> <summary> <span>Expand source code</span> </summary> -<pre><code class="python">@pytest.mark.skip(reason="TODO") -def test_global_disk_soft_anti_affinity(): # NOQA +<pre><code class="python">def test_global_disk_soft_anti_affinity(): # NOQA """ 1. When Replica Disk Soft Anti-Affinity is false, it should be impossible to schedule replicas to the same disk. @@ -4186,8 +4369,7 @@ <h2 class="section-title" id="header-functions">Functions</h2> <summary> <span>Expand source code</span> </summary> -<pre><code class="python">@pytest.mark.skip(reason="TODO") -def test_volume_disk_soft_anti_affinity(): # NOQA +<pre><code class="python">def test_volume_disk_soft_anti_affinity(): # NOQA """ 1. When Replica Disk Soft Anti-Affinity is disabled, it should be impossible to schedule replicas to the same disk. @@ -4292,6 +4474,8 @@ <h1>Index</h1> <li><code><a title="tests.test_scheduling.get_host_replica" href="#tests.test_scheduling.get_host_replica">get_host_replica</a></code></li> <li><code><a title="tests.test_scheduling.replica_auto_balance_with_data_locality_test" href="#tests.test_scheduling.replica_auto_balance_with_data_locality_test">replica_auto_balance_with_data_locality_test</a></code></li> <li><code><a title="tests.test_scheduling.reset_settings" href="#tests.test_scheduling.reset_settings">reset_settings</a></code></li> +<li><code><a title="tests.test_scheduling.test_allow_empty_disk_selector_volume_setting" href="#tests.test_scheduling.test_allow_empty_disk_selector_volume_setting">test_allow_empty_disk_selector_volume_setting</a></code></li> +<li><code><a title="tests.test_scheduling.test_allow_empty_node_selector_volume_setting" href="#tests.test_scheduling.test_allow_empty_node_selector_volume_setting">test_allow_empty_node_selector_volume_setting</a></code></li> <li><code><a title="tests.test_scheduling.test_data_locality_basic" href="#tests.test_scheduling.test_data_locality_basic">test_data_locality_basic</a></code></li> <li><code><a title="tests.test_scheduling.test_data_locality_strict_local_node_affinity" href="#tests.test_scheduling.test_data_locality_strict_local_node_affinity">test_data_locality_strict_local_node_affinity</a></code></li> <li><code><a title="tests.test_scheduling.test_global_disk_soft_anti_affinity" href="#tests.test_scheduling.test_global_disk_soft_anti_affinity">test_global_disk_soft_anti_affinity</a></code></li>