Skip to content

Commit

Permalink
Update testing docs
Browse files Browse the repository at this point in the history
Signed-off-by: khushboo-rancher <[email protected]>
  • Loading branch information
khushboo-rancher committed Nov 14, 2023
1 parent 90bb2e4 commit e80eaf2
Show file tree
Hide file tree
Showing 2 changed files with 189 additions and 5 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="generator" content="Hugo 0.120.3">
<meta name="generator" content="Hugo 0.120.4">
<meta charset="utf-8">
<title>
Longhorn Manual Test Cases
Expand Down
192 changes: 188 additions & 4 deletions integration/test_scheduling.html
Original file line number Diff line number Diff line change
Expand Up @@ -1753,6 +1753,38 @@ <h1 class="title">Module <code>tests.test_scheduling</code></h1>


@pytest.mark.skip(reason=&#34;TODO&#34;)
def test_allow_empty_node_selector_volume_setting(): # NOQA
&#34;&#34;&#34;
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
&#34;&#34;&#34;
pass


def test_global_disk_soft_anti_affinity(): # NOQA
&#34;&#34;&#34;
1. When Replica Disk Soft Anti-Affinity is false, it should be impossible
Expand Down Expand Up @@ -1803,6 +1835,38 @@ <h1 class="title">Module <code>tests.test_scheduling</code></h1>


@pytest.mark.skip(reason=&#34;TODO&#34;)
def test_allow_empty_disk_selector_volume_setting(): # NOQA
&#34;&#34;&#34;
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
&#34;&#34;&#34;
pass


def test_volume_disk_soft_anti_affinity(): # NOQA
&#34;&#34;&#34;
1. When Replica Disk Soft Anti-Affinity is disabled, it should be
Expand Down Expand Up @@ -1975,6 +2039,126 @@ <h2 class="section-title" id="header-functions">Functions</h2>
client.update(setting, value=&#34;true&#34;)</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=&#34;TODO&#34;)
def test_allow_empty_disk_selector_volume_setting(): # NOQA
&#34;&#34;&#34;
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
&#34;&#34;&#34;
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=&#34;TODO&#34;)
def test_allow_empty_node_selector_volume_setting(): # NOQA
&#34;&#34;&#34;
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
&#34;&#34;&#34;
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>
Expand Down Expand Up @@ -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=&#34;TODO&#34;)
def test_global_disk_soft_anti_affinity(): # NOQA
<pre><code class="python">def test_global_disk_soft_anti_affinity(): # NOQA
&#34;&#34;&#34;
1. When Replica Disk Soft Anti-Affinity is false, it should be impossible
to schedule replicas to the same disk.
Expand Down Expand Up @@ -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=&#34;TODO&#34;)
def test_volume_disk_soft_anti_affinity(): # NOQA
<pre><code class="python">def test_volume_disk_soft_anti_affinity(): # NOQA
&#34;&#34;&#34;
1. When Replica Disk Soft Anti-Affinity is disabled, it should be
impossible to schedule replicas to the same disk.
Expand Down Expand Up @@ -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>
Expand Down

0 comments on commit e80eaf2

Please sign in to comment.