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 ab1dee2 commit ba892f6
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 8 deletions.
32 changes: 32 additions & 0 deletions integration/common.html
Original file line number Diff line number Diff line change
Expand Up @@ -2219,6 +2219,17 @@ <h1 class="title">Module <code>tests.common</code></h1>
return image


def wait_for_engine_image_incompatible(client, image_name):
wait_for_engine_image_creation(client, image_name)
for i in range(RETRY_COUNTS):
image = client.by_id_engine_image(image_name)
if image.incompatible:
break
time.sleep(RETRY_INTERVAL)
assert image.incompatible
return image


def wait_for_engine_image_condition(client, image_name, state):
&#34;&#34;&#34;
state: &#34;True&#34;, &#34;False&#34;
Expand Down Expand Up @@ -13198,6 +13209,26 @@ <h2 id="returns">Returns</h2>
assert deleted</code></pre>
</details>
</dd>
<dt id="tests.common.wait_for_engine_image_incompatible"><code class="name flex">
<span>def <span class="ident">wait_for_engine_image_incompatible</span></span>(<span>client, image_name)</span>
</code></dt>
<dd>
<div class="desc"></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">def wait_for_engine_image_incompatible(client, image_name):
wait_for_engine_image_creation(client, image_name)
for i in range(RETRY_COUNTS):
image = client.by_id_engine_image(image_name)
if image.incompatible:
break
time.sleep(RETRY_INTERVAL)
assert image.incompatible
return image</code></pre>
</details>
</dd>
<dt id="tests.common.wait_for_engine_image_ref_count"><code class="name flex">
<span>def <span class="ident">wait_for_engine_image_ref_count</span></span>(<span>client, image_name, count)</span>
</code></dt>
Expand Down Expand Up @@ -15479,6 +15510,7 @@ <h1>Index</h1>
<li><code><a title="tests.common.wait_for_engine_image_condition" href="#tests.common.wait_for_engine_image_condition">wait_for_engine_image_condition</a></code></li>
<li><code><a title="tests.common.wait_for_engine_image_creation" href="#tests.common.wait_for_engine_image_creation">wait_for_engine_image_creation</a></code></li>
<li><code><a title="tests.common.wait_for_engine_image_deletion" href="#tests.common.wait_for_engine_image_deletion">wait_for_engine_image_deletion</a></code></li>
<li><code><a title="tests.common.wait_for_engine_image_incompatible" href="#tests.common.wait_for_engine_image_incompatible">wait_for_engine_image_incompatible</a></code></li>
<li><code><a title="tests.common.wait_for_engine_image_ref_count" href="#tests.common.wait_for_engine_image_ref_count">wait_for_engine_image_ref_count</a></code></li>
<li><code><a title="tests.common.wait_for_engine_image_state" href="#tests.common.wait_for_engine_image_state">wait_for_engine_image_state</a></code></li>
<li><code><a title="tests.common.wait_for_expansion_error_clear" href="#tests.common.wait_for_expansion_error_clear">wait_for_expansion_error_clear</a></code></li>
Expand Down
17 changes: 9 additions & 8 deletions integration/test_engine_upgrade.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ <h1 class="title">Module <code>tests.test_engine_upgrade</code></h1>
from common import wait_for_volume_detached
from common import wait_for_engine_image_deletion
from common import wait_for_engine_image_ref_count, wait_for_engine_image_state
from common import wait_for_engine_image_incompatible
from common import get_volume_engine, write_volume_random_data
from common import check_volume_endpoint
from common import wait_for_volume_replicas_mode
Expand Down Expand Up @@ -478,8 +479,8 @@ <h1 class="title">Module <code>tests.test_engine_upgrade</code></h1>
ctl_v, ctl_minv,
data_v, data_minv)
img = client.create_engine_image(image=fail_cli_v_image)
img = wait_for_engine_image_state(client, img.name, &#34;incompatible&#34;)
assert img.state == &#34;incompatible&#34;
img = wait_for_engine_image_incompatible(client, img.name)
assert img.incompatible
assert img.cliAPIVersion == cli_minv - 1
assert img.cliAPIMinVersion == cli_minv - 1
client.delete(img)
Expand All @@ -490,8 +491,8 @@ <h1 class="title">Module <code>tests.test_engine_upgrade</code></h1>
ctl_v, ctl_minv,
data_v, data_minv)
img = client.create_engine_image(image=fail_cli_minv_image)
img = wait_for_engine_image_state(client, img.name, &#34;incompatible&#34;)
assert img.state == &#34;incompatible&#34;
img = wait_for_engine_image_incompatible(client, img.name)
assert img.incompatible
assert img.cliAPIVersion == cli_v + 1
assert img.cliAPIMinVersion == cli_v + 1
client.delete(img)
Expand Down Expand Up @@ -2204,8 +2205,8 @@ <h2 class="section-title" id="header-functions">Functions</h2>
ctl_v, ctl_minv,
data_v, data_minv)
img = client.create_engine_image(image=fail_cli_v_image)
img = wait_for_engine_image_state(client, img.name, &#34;incompatible&#34;)
assert img.state == &#34;incompatible&#34;
img = wait_for_engine_image_incompatible(client, img.name)
assert img.incompatible
assert img.cliAPIVersion == cli_minv - 1
assert img.cliAPIMinVersion == cli_minv - 1
client.delete(img)
Expand All @@ -2216,8 +2217,8 @@ <h2 class="section-title" id="header-functions">Functions</h2>
ctl_v, ctl_minv,
data_v, data_minv)
img = client.create_engine_image(image=fail_cli_minv_image)
img = wait_for_engine_image_state(client, img.name, &#34;incompatible&#34;)
assert img.state == &#34;incompatible&#34;
img = wait_for_engine_image_incompatible(client, img.name)
assert img.incompatible
assert img.cliAPIVersion == cli_v + 1
assert img.cliAPIMinVersion == cli_v + 1
client.delete(img)
Expand Down

0 comments on commit ba892f6

Please sign in to comment.