Project

General

Profile

action #120411

Updated by JERiveraMoya over 1 year ago

#### Motivation 
 In the current build 40.1 we have systemic failures in the test modules introduced in #113492 that all fail in `validate_script_output`: 

 * [yast2_firewall_set_default_zone_prepare](https://openqa.suse.de/tests/9920019#step/yast2_firewall_set_default_zone_prepare/16) 
 * [yast2_firewall_set_default_zone](https://openqa.suse.de/tests/9920019#step/yast2_firewall_set_default_zone/14) 
 * [yast2_firewall_set_service_port](https://openqa.suse.de/tests/9920019#step/yast2_firewall_set_service_port/20) 

 According to https://bugzilla.suse.com/show_bug.cgi?id=1204893 we need to **restart** the firewall to validate properly the configuration in SLE due to defaults, reload doesn't work (see why in the bug) and that explains why for openSUSE we don't need a restart. 

 #### Acceptance criteria 
 **AC1**: Apply firewall restart after each command that change configuration only in SLE 

 #### Additional information 
 https://firewalld.org/documentation/man-pages/firewall-cmd.html (search for `FlushAllOnReload`) 
 For UI testing As a suggestion, for simplicity, even if we always avoid conditions, specially those magic ones is_sle, is_tumbleweed, which just have tendency don't want to accumulate and create spaghetti code. For UI add condition to test, we have different patterns can do exception here to be use. 
 On the other hand for validation "arrange" our test data, instead of the system, packages are different between different products using test data, so `my %settings` might contain a ternary condition and architectures so if it is more tricky to avoid conditions. we could use: 
 - similar patterns than with UI (too complex, probably it is not worth it) 
 - test data or TDD (looks weird in cases like this when only one command is different, some command are set in code other in test data... no-go) 
 - conditional logic: 
   Probably sle, type the best solution, but only if firewald restart command, which we know exactly to what is conditional and it is not is_sle and derivatives, in this case that particular setting for firewall, so we can express in the code this difference based concatenate on that default that change between products, it is clear code, therefore we could: 
   - check the value of FlushAllOnReload (only one at the beginning of the test). 
   - restart or not accordingly. `validate_script_output(...`. 

Back