From ab1dee2e793183b4e391f3c932f0227b4c01944a Mon Sep 17 00:00:00 2001 From: innobead Date: Mon, 15 Jan 2024 06:35:30 +0000 Subject: [PATCH] Update testing docs Signed-off-by: innobead --- integration/test_settings.html | 59 +++++++++++----------------------- 1 file changed, 19 insertions(+), 40 deletions(-) diff --git a/integration/test_settings.html b/integration/test_settings.html index fd0bc96e5f..691faf545d 100644 --- a/integration/test_settings.html +++ b/integration/test_settings.html @@ -134,8 +134,7 @@

Module tests.test_settings

2. Verify the request fails. 3. Create a volume and attach it. 4. Set `taint-toleration` to "key1=value1:NoSchedule; key2:NoExecute". - 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 "key1=value1:NoSchedule; key2:NoExecute". @@ -184,10 +183,8 @@

Module tests.test_settings

"effect": "NoExecute" }, ] - with pytest.raises(Exception) as e: - client.update(setting, value=setting_value_str) - assert 'cannot modify toleration setting before all volumes are detached' \ - 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) @@ -195,8 +192,6 @@

Module tests.test_settings

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() @@ -522,8 +517,8 @@

Module tests.test_settings

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. @@ -557,10 +552,8 @@

Module tests.test_settings

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 'cannot modify priority class setting before all volumes are ' \ - 'detached' 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) @@ -568,9 +561,6 @@

Module tests.test_settings

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() @@ -1267,7 +1257,7 @@

Module tests.test_settings

[SETTING_BACKUP_TARGET, SETTING_TAINT_TOLERATION], [target, - ""]) + "key1=value1:NoSchedule"]) cleanup_volume_by_name(client, vol_name) @@ -2281,8 +2271,8 @@

Functions

for the Setting.
  • Create a new Priority Class in Kubernetes.
  • Create and attach a Volume.
  • -
  • Verify that the Priority Class Setting cannot be updated with an -attached Volume.
  • +
  • Verify that the Priority Class Setting can be updated with an attached +volume.
  • Generate and write data1.
  • Detach the Volume.
  • Update the Priority Class Setting to the new Priority Class.
  • @@ -2312,8 +2302,8 @@

    Functions

    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. @@ -2347,10 +2337,8 @@

    Functions

    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 'cannot modify priority class setting before all volumes are ' \ - 'detached' 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) @@ -2358,9 +2346,6 @@

    Functions

    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() @@ -2459,8 +2444,7 @@

    Functions

  • Verify the request fails.
  • Create a volume and attach it.
  • Set taint-toleration to "key1=value1:NoSchedule; key2:NoExecute".
  • -
  • Verify that cannot update toleration setting when any volume is -attached.
  • +
  • Verify that can update toleration setting when any volume is attached.
  • Generate and write data1 into the volume.
  • Detach the volume.
  • Set taint-toleration to "key1=value1:NoSchedule; key2:NoExecute".
  • @@ -2489,8 +2473,7 @@

    Functions

    2. Verify the request fails. 3. Create a volume and attach it. 4. Set `taint-toleration` to "key1=value1:NoSchedule; key2:NoExecute". - 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 "key1=value1:NoSchedule; key2:NoExecute". @@ -2539,10 +2522,8 @@

    Functions

    "effect": "NoExecute" }, ] - with pytest.raises(Exception) as e: - client.update(setting, value=setting_value_str) - assert 'cannot modify toleration setting before all volumes are detached' \ - 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) @@ -2550,8 +2531,6 @@

    Functions

    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() @@ -2771,7 +2750,7 @@

    Functions

    [SETTING_BACKUP_TARGET, SETTING_TAINT_TOLERATION], [target, - ""]) + "key1=value1:NoSchedule"]) cleanup_volume_by_name(client, vol_name)