-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add validation E2E tests #258
Add validation E2E tests #258
Conversation
/hold WIP |
b690f28
to
2aeae01
Compare
e0d5cae
to
123a482
Compare
/unhold |
discovery-infra/test_infra/utils.py
Outdated
@@ -346,6 +346,91 @@ def is_cluster_in_status(client, cluster_id, statuses): | |||
log.exception("Failed to get cluster %s info", cluster_id) | |||
|
|||
|
|||
def wait_till_cluster_validation_is_in_status( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these functions can go in Cluster class
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
||
# Check initial validations | ||
self.wait_until_cluster_is_pending_for_input(cluster_id, api_client) | ||
orig_cluster = api_client.cluster_get(cluster_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use cluster.get_details
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
self.assert_cluster_validation(orig_cluster, "network", "ntp-server-configured", "success") | ||
|
||
# Check base DNS domain | ||
api_client.update_cluster(cluster_id, {"base_dns_domain": ""}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here use Cluster
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
ram_node.start() | ||
|
||
self.wait_until_hosts_are_discovered(cluster_id=cluster_id, api_client=api_client, additional_statuses=[consts.NodesStatus.INSUFFICIENT]) | ||
self.wait_for_host_validation(api_client, cluster_id, vcpu_host_id, "hardware", "has-min-cpu-cores", ["success"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe the strings part will benefit from keyword arguments, to explain what "hardware"
, "has-min-cpu-cores"
and ["success"]
are exactly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's clear, given the method deals with validations?
vcpu_node.start() | ||
|
||
ram_node.shutdown() | ||
ram_node.set_ram_kib(int(env_variables['master_memory']) * 1024) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Im thinking now that if test will fail somewhere, then there wont be a clean up for the CPU \ RAM changes (to bring it back to correct values).
can you please add a fixture for applying a proper cleanup for this test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We reuse VMs between tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, but;
- stop all nodes
- format disk
- set correct boot order
before\after each test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
0e2f743
to
933fee8
Compare
/lgtm |
/lgtm |
discovery-infra/tests/base_test.py
Outdated
@@ -26,6 +26,8 @@ def nodes(self, setup_node_controller): | |||
controller = setup_node_controller | |||
nodes = Nodes(controller, env_variables["private_ssh_key_path"]) | |||
nodes.set_correct_boot_order(start_nodes=False) | |||
nodes.run_for_all_nodes("reset_cpu_cores") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missed that - this should be running after the yield (both this and the next line)
no?
save orig, run tests, do changes, then back to orig
discovery-infra/tests/base_test.py
Outdated
@@ -26,6 +26,8 @@ def nodes(self, setup_node_controller): | |||
controller = setup_node_controller | |||
nodes = Nodes(controller, env_variables["private_ssh_key_path"]) | |||
nodes.set_correct_boot_order(start_nodes=False) | |||
nodes.run_for_all_nodes("reset_cpu_cores") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not something specific to test?
I think this must be part of specific test fixture there is not need for this for all tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we will leave it here anyway? its one place for cleanup, more intuitive. what WDYT?
933fee8
to
5199a03
Compare
5199a03
to
20206dc
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: avishayt, tsorya The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
No description provided.