[CVP,Q4] Fix several small issues found during testing
Change-Id: Ied92729a59fa9b053a09ce27733bb0db1df692e8
Related-PROD: PROD-30482
diff --git a/test_set/cvp-sanity/tests/test_drivetrain.py b/test_set/cvp-sanity/tests/test_drivetrain.py
index 3a9f1b6..f892932 100644
--- a/test_set/cvp-sanity/tests/test_drivetrain.py
+++ b/test_set/cvp-sanity/tests/test_drivetrain.py
@@ -309,7 +309,7 @@
continue
actual_version = BranchSpec[0].getElementsByTagName('name')[0].childNodes[0].data
- if actual_version not in expected_version and expected_version != '':
+ if expected_version and actual_version not in expected_version:
version_mismatch.append("Job {0} has {1} branch."
"Expected {2}".format(job_name,
actual_version,
@@ -432,4 +432,4 @@
sep="\n" + "-" * 20 + "\n",
kubectl_output=pods_statuses_output,
report=report_with_errors
- )
\ No newline at end of file
+ )
diff --git a/test_set/cvp-sanity/tests/test_mounts.py b/test_set/cvp-sanity/tests/test_mounts.py
index c9ba9ce..5fe40fc 100644
--- a/test_set/cvp-sanity/tests/test_mounts.py
+++ b/test_set/cvp-sanity/tests/test_mounts.py
@@ -32,8 +32,12 @@
for node in mounts_by_nodes:
if node in exclude_nodes:
continue
- result[node] = "\n".join(sorted(mounts_by_nodes[node].split()))
- pretty_result[node] = sorted(mounts_by_nodes[node].split())
+ if isinstance(mounts_by_nodes[node], bool):
+ result[node] = 'Cannot access this node'
+ pretty_result[node] = 'Cannot access this node'
+ else:
+ result[node] = "\n".join(sorted(mounts_by_nodes[node].split()))
+ pretty_result[node] = sorted(mounts_by_nodes[node].split())
if not result:
pytest.skip("These nodes are skipped")
diff --git a/test_set/cvp-sanity/tests/test_packet_checker.py b/test_set/cvp-sanity/tests/test_packet_checker.py
index 6c1ccc9..29f922d 100644
--- a/test_set/cvp-sanity/tests/test_packet_checker.py
+++ b/test_set/cvp-sanity/tests/test_packet_checker.py
@@ -86,7 +86,7 @@
if len(total_nodes) < 2:
pytest.skip("Nothing to compare - only 1 node")
list_of_pip_packages = local_salt_client.cmd(tgt="L@"+','.join(nodes_in_group),
- param='pip.freeze', expr_form='compound')
+ fun='pip.freeze', expr_form='compound')
nodes = []
diff --git a/test_set/cvp-sanity/tests/test_repo_list.py b/test_set/cvp-sanity/tests/test_repo_list.py
index 5e70eeb..0e29bc6 100644
--- a/test_set/cvp-sanity/tests/test_repo_list.py
+++ b/test_set/cvp-sanity/tests/test_repo_list.py
@@ -1,3 +1,6 @@
+import json
+
+
def test_list_of_repo_on_nodes(local_salt_client, nodes_in_group):
# TODO: pillar.get
info_salt = local_salt_client.cmd(tgt='L@' + ','.join(
@@ -40,7 +43,6 @@
fail_counter = 0
my_set.update(actual_repo_list)
my_set.update(expected_salt_data)
- import json
for repo in my_set:
rows = []
if repo not in actual_repo_list: