Skip to content
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

SDAF calculate subnets #20203

Merged
merged 1 commit into from
Oct 29, 2024
Merged

Conversation

lpalovsky
Copy link
Contributor

@lpalovsky lpalovsky commented Sep 17, 2024

Current SDAF test use static network space settings which prevents running
multiple concurrent tests. This PR adds functionality to create and assign
unique addess space for each test using 'lease' file and a set of rules inside Azure container
named 'network-spaces'.

3 parallel tests:
Start condition:
2 lease files older than 7200s:
192.168.39.192
192.168.42.128

Test 1:
Found both lease files available
https://openqaworker15.qa.suse.cz/tests/298290#step/deploy_workload_zone/75
Picked 192.168.39.192
https://openqaworker15.qa.suse.cz/tests/298290#step/deploy_workload_zone/95

  • modification time updated

Test 2:
https://openqaworker15.qa.suse.cz/tests/298288#step/deploy_workload_zone/75
192.168.42.128 - is taken as 192.168.39.192 is already used by Test 1
https://openqaworker15.qa.suse.cz/tests/298288#step/deploy_workload_zone/95

Test 3.
No file older than 7200s available - new file created
https://openqaworker15.qa.suse.cz/tests/298292#step/deploy_workload_zone/76

@lpalovsky lpalovsky self-assigned this Sep 17, 2024
@lpalovsky lpalovsky force-pushed the sdaf_subnet_isolation branch 29 times, most recently from 89e6909 to e33402b Compare September 23, 2024 13:24
lib/sles4sap/azure_cli.pm Outdated Show resolved Hide resolved
=back

Replaces placeholder pattern B<%OPENQA_VARIABLE%> with corresponding OpenQA variable value.
If OpenQA variable is not set, placeholder is replaced with empty value.
Copy link
Contributor

@mpagot mpagot Sep 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this one is different in comparision to what HanaSR is doing

@lpalovsky lpalovsky force-pushed the sdaf_subnet_isolation branch 5 times, most recently from 9509e6d to dbd2d83 Compare September 26, 2024 14:09
my ($tfvars_file) = @_;
croak 'Variable "$tfvars_file" undefined' unless defined($tfvars_file);
my @variables = split("\n", script_output("grep -oP \'(\?<=%)[A-Z_]+(?=%)\' $tfvars_file"));
my %to_replace = map { '%' . $_ . '%' => get_var($_, '') } @variables;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it OK that this can end up replacing some of the placeholders for empty strings if the settings are not defined?

Copy link
Contributor Author

@lpalovsky lpalovsky Oct 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I created a new ticket to review whole tfvars mechanism: TEAM-9786
This was a function to provide a good enough solution for development purposes. There will be a need for something more flexible than template and placeholders.

@lpalovsky lpalovsky force-pushed the sdaf_subnet_isolation branch 5 times, most recently from 83d92d2 to e75f876 Compare September 27, 2024 07:14
@lpalovsky
Copy link
Contributor Author

lpalovsky commented Sep 27, 2024

VRs with latest changes, both running in parallel:
https://openqaworker15.qa.suse.cz/tests/298408#live
https://openqaworker15.qa.suse.cz/tests/298406#live

@lpalovsky lpalovsky force-pushed the sdaf_subnet_isolation branch 2 times, most recently from c1fe600 to d633344 Compare September 27, 2024 07:43
Copy link
Contributor

@mpagot mpagot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

);

my $lease_id = script_output($az_cmd, proceed_on_failure => 1);
return ($lease_id) if qesap_az_validate_uuid_pattern($lease_id); # Return only valid output.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest to add one more sentence about the fact that process can fails and in this case ...


=back

Acquire network lease for a blob.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please describe the return value, seems that it could be nothing or a single element list (why an array is needed if it only has one element?)

Copy link
Contributor Author

@lpalovsky lpalovsky Sep 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Acquire network lease for a blob. Returns blob lease UUID which is later required for getting permission to modify
blob file. 

t/21_sles4sap_azure_cli.t Outdated Show resolved Hide resolved
Copy link
Contributor

@alvarocarvajald alvarocarvajald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lpalovsky lpalovsky force-pushed the sdaf_subnet_isolation branch 4 times, most recently from e617dda to 79fca1c Compare September 27, 2024 09:06
@lpalovsky
Copy link
Contributor Author

Executing new VRs with suggestions applied
2 parallel tests:
Test A:

Test B:

@lpalovsky lpalovsky merged commit f3c2cc1 into os-autoinst:master Oct 29, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants