Skip to content

Commit

Permalink
Update testing docs
Browse files Browse the repository at this point in the history
Signed-off-by: innobead <[email protected]>
  • Loading branch information
innobead committed Jan 15, 2024
1 parent 1dc26c1 commit ab1dee2
Showing 1 changed file with 19 additions and 40 deletions.
59 changes: 19 additions & 40 deletions integration/test_settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,7 @@ <h1 class="title">Module <code>tests.test_settings</code></h1>
2. Verify the request fails.
3. Create a volume and attach it.
4. Set `taint-toleration` to &#34;key1=value1:NoSchedule; key2:NoExecute&#34;.
5. Verify that cannot update toleration setting when any volume is
attached.
5. Verify that can update toleration setting when any volume is attached.
6. Generate and write `data1` into the volume.
7. Detach the volume.
8. Set `taint-toleration` to &#34;key1=value1:NoSchedule; key2:NoExecute&#34;.
Expand Down Expand Up @@ -184,19 +183,15 @@ <h1 class="title">Module <code>tests.test_settings</code></h1>
&#34;effect&#34;: &#34;NoExecute&#34;
},
]
with pytest.raises(Exception) as e:
client.update(setting, value=setting_value_str)
assert &#39;cannot modify toleration setting before all volumes are detached&#39; \
in str(e.value)
setting = client.update(setting, value=setting_value_str)
assert setting.value == setting_value_str

data1 = write_volume_random_data(volume)
check_volume_data(volume, data1)

volume.detach()
wait_for_volume_detached(client, volume_name)

setting = client.update(setting, value=setting_value_str)
assert setting.value == setting_value_str
wait_for_toleration_update(core_api, apps_api, count, setting_value_dicts)

client, node = wait_for_longhorn_node_ready()
Expand Down Expand Up @@ -522,8 +517,8 @@ <h1 class="title">Module <code>tests.test_settings</code></h1>
for the Setting.
2. Create a new Priority Class in Kubernetes.
3. Create and attach a Volume.
4. Verify that the Priority Class Setting cannot be updated with an
attached Volume.
4. Verify that the Priority Class Setting can be updated with an attached
volume.
5. Generate and write `data1`.
6. Detach the Volume.
7. Update the Priority Class Setting to the new Priority Class.
Expand Down Expand Up @@ -557,20 +552,15 @@ <h1 class="title">Module <code>tests.test_settings</code></h1>
volume.attach(hostId=get_self_host_id())
volume = wait_for_volume_healthy(client, volume_name)

with pytest.raises(Exception) as e:
client.update(setting, value=name)
assert &#39;cannot modify priority class setting before all volumes are &#39; \
&#39;detached&#39; in str(e.value)
setting = client.update(setting, value=name)
assert setting.value == name

data1 = write_volume_random_data(volume)
check_volume_data(volume, data1)

volume.detach()
wait_for_volume_detached(client, volume_name)

setting = client.update(setting, value=name)
assert setting.value == name

wait_for_priority_class_update(core_api, apps_api, count, priority_class)

client, node = wait_for_longhorn_node_ready()
Expand Down Expand Up @@ -1267,7 +1257,7 @@ <h1 class="title">Module <code>tests.test_settings</code></h1>
[SETTING_BACKUP_TARGET,
SETTING_TAINT_TOLERATION],
[target,
&#34;&#34;])
&#34;key1=value1:NoSchedule&#34;])

cleanup_volume_by_name(client, vol_name)

Expand Down Expand Up @@ -2281,8 +2271,8 @@ <h2 class="section-title" id="header-functions">Functions</h2>
for the Setting.</li>
<li>Create a new Priority Class in Kubernetes.</li>
<li>Create and attach a Volume.</li>
<li>Verify that the Priority Class Setting cannot be updated with an
attached Volume.</li>
<li>Verify that the Priority Class Setting can be updated with an attached
volume.</li>
<li>Generate and write <code>data1</code>.</li>
<li>Detach the Volume.</li>
<li>Update the Priority Class Setting to the new Priority Class.</li>
Expand Down Expand Up @@ -2312,8 +2302,8 @@ <h2 class="section-title" id="header-functions">Functions</h2>
for the Setting.
2. Create a new Priority Class in Kubernetes.
3. Create and attach a Volume.
4. Verify that the Priority Class Setting cannot be updated with an
attached Volume.
4. Verify that the Priority Class Setting can be updated with an attached
volume.
5. Generate and write `data1`.
6. Detach the Volume.
7. Update the Priority Class Setting to the new Priority Class.
Expand Down Expand Up @@ -2347,20 +2337,15 @@ <h2 class="section-title" id="header-functions">Functions</h2>
volume.attach(hostId=get_self_host_id())
volume = wait_for_volume_healthy(client, volume_name)

with pytest.raises(Exception) as e:
client.update(setting, value=name)
assert &#39;cannot modify priority class setting before all volumes are &#39; \
&#39;detached&#39; in str(e.value)
setting = client.update(setting, value=name)
assert setting.value == name

data1 = write_volume_random_data(volume)
check_volume_data(volume, data1)

volume.detach()
wait_for_volume_detached(client, volume_name)

setting = client.update(setting, value=name)
assert setting.value == name

wait_for_priority_class_update(core_api, apps_api, count, priority_class)

client, node = wait_for_longhorn_node_ready()
Expand Down Expand Up @@ -2459,8 +2444,7 @@ <h2 class="section-title" id="header-functions">Functions</h2>
<li>Verify the request fails.</li>
<li>Create a volume and attach it.</li>
<li>Set <code>taint-toleration</code> to "key1=value1:NoSchedule; key2:NoExecute".</li>
<li>Verify that cannot update toleration setting when any volume is
attached.</li>
<li>Verify that can update toleration setting when any volume is attached.</li>
<li>Generate and write <code>data1</code> into the volume.</li>
<li>Detach the volume.</li>
<li>Set <code>taint-toleration</code> to "key1=value1:NoSchedule; key2:NoExecute".</li>
Expand Down Expand Up @@ -2489,8 +2473,7 @@ <h2 class="section-title" id="header-functions">Functions</h2>
2. Verify the request fails.
3. Create a volume and attach it.
4. Set `taint-toleration` to &#34;key1=value1:NoSchedule; key2:NoExecute&#34;.
5. Verify that cannot update toleration setting when any volume is
attached.
5. Verify that can update toleration setting when any volume is attached.
6. Generate and write `data1` into the volume.
7. Detach the volume.
8. Set `taint-toleration` to &#34;key1=value1:NoSchedule; key2:NoExecute&#34;.
Expand Down Expand Up @@ -2539,19 +2522,15 @@ <h2 class="section-title" id="header-functions">Functions</h2>
&#34;effect&#34;: &#34;NoExecute&#34;
},
]
with pytest.raises(Exception) as e:
client.update(setting, value=setting_value_str)
assert &#39;cannot modify toleration setting before all volumes are detached&#39; \
in str(e.value)
setting = client.update(setting, value=setting_value_str)
assert setting.value == setting_value_str

data1 = write_volume_random_data(volume)
check_volume_data(volume, data1)

volume.detach()
wait_for_volume_detached(client, volume_name)

setting = client.update(setting, value=setting_value_str)
assert setting.value == setting_value_str
wait_for_toleration_update(core_api, apps_api, count, setting_value_dicts)

client, node = wait_for_longhorn_node_ready()
Expand Down Expand Up @@ -2771,7 +2750,7 @@ <h2 class="section-title" id="header-functions">Functions</h2>
[SETTING_BACKUP_TARGET,
SETTING_TAINT_TOLERATION],
[target,
&#34;&#34;])
&#34;key1=value1:NoSchedule&#34;])

cleanup_volume_by_name(client, vol_name)</code></pre>
</details>
Expand Down

0 comments on commit ab1dee2

Please sign in to comment.