Skip to content

Commit

Permalink
test_openshift: do the OpenShift test by walking through sources
Browse files Browse the repository at this point in the history
  • Loading branch information
ruda committed Sep 12, 2023
1 parent 7e3adaa commit 20f1ce6
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions camayoc/tests/qpc/cli/test_openshift.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,19 @@ def validate_openshift_report(cluster, details, deployments):
cluster_nodes = cluster["nodes"]
total_clusters = 0
seen_nodes = []
facts = details["sources"][0]["facts"]
for fact in facts:
if "node" in fact:
assert fact["node"]["kind"] == "node"
seen_nodes.append(fact["node"]["name"])
if "cluster" in fact:
assert fact["cluster"]["uuid"] == cluster_id
assert fact["cluster"]["version"] == cluster_version
total_clusters += 1
if "projects" in fact:
assert len(fact["projects"]) > 0
if "workloads" in fact:
assert len(fact["workloads"]) > 0
for source in details["sources"]:
for fact in source["facts"]:
if "node" in fact:
assert fact["node"]["kind"] == "node"
seen_nodes.append(fact["node"]["name"])
if "cluster" in fact:
assert fact["cluster"]["uuid"] == cluster_id
assert fact["cluster"]["version"] == cluster_version
total_clusters += 1
if "projects" in fact:
assert len(fact["projects"]) > 0
if "workloads" in fact:
assert len(fact["workloads"]) > 0
assert total_clusters == 1, "Only one system fact should have a 'cluster' key"
assert set(cluster_nodes) == set(seen_nodes), "The number of expected nodes diverged"
#
Expand Down

0 comments on commit 20f1ce6

Please sign in to comment.