Skip to content

Commit

Permalink
Merge pull request #18349 from DeepthiYV/firewalld_test
Browse files Browse the repository at this point in the history
Fix firewalld test for 15-SP6
  • Loading branch information
dzedro committed Dec 22, 2023
2 parents ef48ca9 + 2207b2c commit b1712f3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/console/firewalld.pm
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ sub collect_in_fwd_rule_count {
} else {
script_run("nft list chain inet firewalld filter_IN_public_allow");
assert_script_run("nft list chain inet firewalld filter_IN_public_allow | wc -l | tee /tmp/nr_in_public.txt");
if (is_leap("<16.0") || is_sle("<16")) {
if (is_leap('<15.6') || is_sle('<15-SP6')) {
script_run("nft list chain inet firewalld filter_FWDI_public");
assert_script_run("nft list chain inet firewalld filter_FWDI_public | wc -l | tee /tmp/nr_fwdi_public.txt");
} else {
Expand All @@ -107,7 +107,7 @@ sub verify_in_fwd_rule_count {
} else {
script_run("nft list chain inet firewalld filter_IN_public_allow");
assert_script_run("test `nft list chain inet firewalld filter_IN_public_allow | wc -l` -eq `cat /tmp/nr_in_public.txt`");
if (is_leap("<16.0") || is_sle("<16")) {
if (is_leap("<15.6") || is_sle("<15-SP6")) {
script_run("nft list chain inet firewalld filter_FWDI_public");
assert_script_run("test `nft list chain inet firewalld filter_FWDI_public | wc -l` -eq `cat /tmp/nr_fwdi_public.txt`");
} else {
Expand Down Expand Up @@ -156,7 +156,7 @@ sub test_masquerading {
script_run("iptables -t nat -L --line-numbers");
assert_script_run("iptables -t nat -L PRE_public_allow --line-numbers | sed '/^num\\|^\$\\|^Chain/d' | wc -l | tee /tmp/nr_rules_nat_pre.txt");
assert_script_run("iptables -t nat -L POST_public_allow --line-numbers | sed '/^num\\|^\$\\|^Chain/d' | wc -l | tee /tmp/nr_rules_nat_post.txt");
} elsif (is_leap("<16.0") || is_sle("<16")) {
} elsif (is_leap("<15.6") || is_sle("<15-SP6")) {
script_run("nft list chain ip firewalld nat_PRE_public_allow");
script_run("nft list chain ip firewalld nat_POST_public_allow");
assert_script_run("nft list chain ip firewalld nat_PRE_public_allow | wc -l | tee /tmp/nr_rules_nat_pre.txt");
Expand All @@ -174,7 +174,7 @@ sub test_masquerading {
if (uses_iptables) {
assert_script_run("iptables -t nat -L PRE_public_allow | grep 'to::22'");
assert_script_run("iptables -t nat -L POST_public_allow | grep MASQUERADE");
} elsif (is_leap("<16.0") || is_sle("<16")) {
} elsif (is_leap("<15.6") || is_sle("<15-SP6")) {
assert_script_run("nft list chain ip firewalld nat_PRE_public_allow | grep 'redirect to :22'");
assert_script_run("nft list chain ip firewalld nat_POST_public_allow | grep masquerade");
} else {
Expand All @@ -189,7 +189,7 @@ sub test_masquerading {
script_run("iptables -t nat -L --line-numbers");
assert_script_run("test `iptables -t nat -L PRE_public_allow --line-numbers | sed '/^num\\|^\$\\|^Chain/d' | wc -l` -eq `cat /tmp/nr_rules_nat_pre.txt`");
assert_script_run("test `iptables -t nat -L POST_public_allow --line-numbers | sed '/^num\\|^\$\\|^Chain/d' | wc -l` -eq `cat /tmp/nr_rules_nat_post.txt`");
} elsif (is_leap("<16.0") || is_sle("<16")) {
} elsif (is_leap("<15.6") || is_sle("<15-SP6")) {
script_run("nft list chain ip firewalld nat_PRE_public_allow");
script_run("nft list chain ip firewalld nat_POST_public_allow");
assert_script_run("test `nft list chain ip firewalld nat_PRE_public_allow | wc -l` -eq `cat /tmp/nr_rules_nat_pre.txt`");
Expand Down

0 comments on commit b1712f3

Please sign in to comment.