From a0746ba87693e0d72618825e7d3e49dfdc0b23e7 Mon Sep 17 00:00:00 2001 From: jitendracandela <78074038+jitendracandela@users.noreply.github.com> Date: Thu, 24 Mar 2022 19:03:23 +0530 Subject: [PATCH] Wifi 7435 (#439) * removed dfs key and added radio config in rf Signed-off-by: jitendracandela * removed dfs logic Signed-off-by: jitendracandela * changed setup_params_general numbers Signed-off-by: jitendracandela --- libs/controller/controller_2x/controller.py | 16 +- .../dfs_20MHz/test_dfs_20_bridge.py | 180 ++++++++++++------ .../dfs_40MHz/test_dfs_40_bridge.py | 76 +++++--- .../dfs_80MHz/test_dfs_80_bridge.py | 45 +++-- tests/fixtures_2x.py | 5 - 5 files changed, 205 insertions(+), 117 deletions(-) diff --git a/libs/controller/controller_2x/controller.py b/libs/controller/controller_2x/controller.py index c80bdfd49..f2782dc81 100644 --- a/libs/controller/controller_2x/controller.py +++ b/libs/controller/controller_2x/controller.py @@ -468,7 +468,7 @@ class UProfileUtility: ssid_info.append(temp) return ssid_info - def set_radio_config(self, radio_config={}, DFS=False, channel=None, bw=None): + def set_radio_config(self, radio_config={}): base_radio_config_2g = { "band": "2G", "country": "CA", @@ -493,17 +493,9 @@ class UProfileUtility: # for keys in radio_config[band]: # base_radio_config_6g[keys] = radio_config[band][keys] - if DFS: - self.base_profile_config["radios"].append({ - "band": "5G", - "country": "CA", - "channel-mode": "VHT", - "channel-width": bw, - "channel": channel - }) - else: - self.base_profile_config["radios"].append(base_radio_config_2g) - self.base_profile_config["radios"].append(base_radio_config_5g) + + self.base_profile_config["radios"].append(base_radio_config_2g) + self.base_profile_config["radios"].append(base_radio_config_5g) print(self.base_profile_config) self.vlan_section["ssids"] = [] self.vlan_ids = [] diff --git a/tests/e2e/basic/dfs_test/wpa2_personal/dfs_20MHz/test_dfs_20_bridge.py b/tests/e2e/basic/dfs_test/wpa2_personal/dfs_20MHz/test_dfs_20_bridge.py index 36e0486ec..4054d394d 100644 --- a/tests/e2e/basic/dfs_test/wpa2_personal/dfs_20MHz/test_dfs_20_bridge.py +++ b/tests/e2e/basic/dfs_test/wpa2_personal/dfs_20MHz/test_dfs_20_bridge.py @@ -13,11 +13,16 @@ setup_params_general1 = { {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} ] }, - "dfs": { - "channel": 52, - "channel_bandwidth": 20 + "rf": { + "5G": { + "band": "5G", + "country": "CA", + "allow-dfs": True, + "channel-mode": "VHT", + "channel-width": 20, + "channel": 52 + } }, - "rf": {}, "radius": False } @pytest.mark.parametrize( @@ -38,7 +43,7 @@ class TestDFSChannel52Bw20(object): profile_data = setup_params_general1["ssid_modes"]["wpa2_personal"][0] ssid_name = profile_data["ssid_name"] security_key = profile_data["security_key"] - channel = setup_params_general1["dfs"]["channel"] + channel = setup_params_general1["rf"]["5G"]["channel"] security = "wpa2" band = "fiveg" mode = "BRIDGE" @@ -87,11 +92,16 @@ setup_params_general2 = { {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} ] }, - "dfs": { - "channel": 100, - "channel_bandwidth": 20 + "rf": { + "5G": { + "band": "5G", + "country": "CA", + "allow-dfs": True, + "channel-mode": "VHT", + "channel-width": 20, + "channel": 100 + } }, - "rf": {}, "radius": False } @pytest.mark.parametrize( @@ -112,7 +122,7 @@ class TestDFSChannel100Bw20(object): profile_data = setup_params_general2["ssid_modes"]["wpa2_personal"][0] ssid_name = profile_data["ssid_name"] security_key = profile_data["security_key"] - channel = setup_params_general2["dfs"]["channel"] + channel = setup_params_general2["rf"]["5G"]["channel"] security = "wpa2" band = "fiveg" mode = "BRIDGE" @@ -161,11 +171,16 @@ setup_params_general3 = { {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} ] }, - "dfs": { - "channel": 104, - "channel_bandwidth": 20 + "rf": { + "5G": { + "band": "5G", + "country": "CA", + "allow-dfs": True, + "channel-mode": "VHT", + "channel-width": 20, + "channel": 104 + } }, - "rf": {}, "radius": False } @pytest.mark.parametrize( @@ -186,7 +201,7 @@ class TestDFSChannel104Bw20(object): profile_data = setup_params_general3["ssid_modes"]["wpa2_personal"][0] ssid_name = profile_data["ssid_name"] security_key = profile_data["security_key"] - channel = setup_params_general3["dfs"]["channel"] + channel = setup_params_general3["rf"]["5G"]["channel"] security = "wpa2" band = "fiveg" mode = "BRIDGE" @@ -235,11 +250,16 @@ setup_params_general4 = { {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} ] }, - "dfs": { - "channel": 56, - "channel_bandwidth": 20 + "rf": { + "5G": { + "band": "5G", + "country": "CA", + "allow-dfs": True, + "channel-mode": "VHT", + "channel-width": 20, + "channel": 56 + } }, - "rf": {}, "radius": False } @pytest.mark.parametrize( @@ -260,7 +280,7 @@ class TestDFSChannel56Bw20(object): profile_data = setup_params_general4["ssid_modes"]["wpa2_personal"][0] ssid_name = profile_data["ssid_name"] security_key = profile_data["security_key"] - channel = setup_params_general4["dfs"]["channel"] + channel = setup_params_general4["rf"]["5G"]["channel"] security = "wpa2" band = "fiveg" mode = "BRIDGE" @@ -309,11 +329,16 @@ setup_params_general5 = { {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} ] }, - "dfs": { - "channel": 60, - "channel_bandwidth": 20 + "rf": { + "5G": { + "band": "5G", + "country": "CA", + "allow-dfs": True, + "channel-mode": "VHT", + "channel-width": 20, + "channel": 60 + } }, - "rf": {}, "radius": False } @pytest.mark.parametrize( @@ -334,7 +359,7 @@ class TestDFSChannel60Bw20(object): profile_data = setup_params_general5["ssid_modes"]["wpa2_personal"][0] ssid_name = profile_data["ssid_name"] security_key = profile_data["security_key"] - channel = setup_params_general5["dfs"]["channel"] + channel = setup_params_general5["rf"]["5G"]["channel"] security = "wpa2" band = "fiveg" mode = "BRIDGE" @@ -383,11 +408,16 @@ setup_params_general6 = { {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} ] }, - "dfs": { - "channel": 64, - "channel_bandwidth": 20 + "rf": { + "5G": { + "band": "5G", + "country": "CA", + "allow-dfs": True, + "channel-mode": "VHT", + "channel-width": 20, + "channel": 64 + } }, - "rf": {}, "radius": False } @pytest.mark.parametrize( @@ -408,7 +438,7 @@ class TestDFSChannel64Bw20(object): profile_data = setup_params_general6["ssid_modes"]["wpa2_personal"][0] ssid_name = profile_data["ssid_name"] security_key = profile_data["security_key"] - channel = setup_params_general6["dfs"]["channel"] + channel = setup_params_general6["rf"]["5G"]["channel"] security = "wpa2" band = "fiveg" mode = "BRIDGE" @@ -457,11 +487,16 @@ setup_params_general7 = { {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} ] }, - "dfs": { - "channel": 108, - "channel_bandwidth": 20 + "rf": { + "5G": { + "band": "5G", + "country": "CA", + "allow-dfs": True, + "channel-mode": "VHT", + "channel-width": 20, + "channel": 108 + } }, - "rf": {}, "radius": False } @pytest.mark.parametrize( @@ -482,7 +517,7 @@ class TestDFSChannel108Bw20(object): profile_data = setup_params_general7["ssid_modes"]["wpa2_personal"][0] ssid_name = profile_data["ssid_name"] security_key = profile_data["security_key"] - channel = setup_params_general7["dfs"]["channel"] + channel = setup_params_general7["rf"]["5G"]["channel"] security = "wpa2" band = "fiveg" mode = "BRIDGE" @@ -531,11 +566,16 @@ setup_params_general8 = { {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} ] }, - "dfs": { - "channel": 112, - "channel_bandwidth": 20 + "rf": { + "5G": { + "band": "5G", + "country": "CA", + "allow-dfs": True, + "channel-mode": "VHT", + "channel-width": 20, + "channel": 112 + } }, - "rf": {}, "radius": False } @pytest.mark.parametrize( @@ -556,7 +596,7 @@ class TestDFSChannel112Bw20(object): profile_data = setup_params_general8["ssid_modes"]["wpa2_personal"][0] ssid_name = profile_data["ssid_name"] security_key = profile_data["security_key"] - channel = setup_params_general8["dfs"]["channel"] + channel = setup_params_general8["rf"]["5G"]["channel"] security = "wpa2" band = "fiveg" mode = "BRIDGE" @@ -679,11 +719,16 @@ setup_params_general10 = { {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} ] }, - "dfs": { - "channel": 132, - "channel_bandwidth": 20 + "rf": { + "5G": { + "band": "5G", + "country": "CA", + "allow-dfs": True, + "channel-mode": "VHT", + "channel-width": 20, + "channel": 132 + } }, - "rf": {}, "radius": False } @pytest.mark.parametrize( @@ -704,7 +749,7 @@ class TestDFSChannel132Bw20(object): profile_data = setup_params_general10["ssid_modes"]["wpa2_personal"][0] ssid_name = profile_data["ssid_name"] security_key = profile_data["security_key"] - channel = setup_params_general10["dfs"]["channel"] + channel = setup_params_general10["rf"]["5G"]["channel"] security = "wpa2" band = "fiveg" mode = "BRIDGE" @@ -753,11 +798,16 @@ setup_params_general11 = { {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} ] }, - "dfs": { - "channel": 136, - "channel_bandwidth": 20 + "rf": { + "5G": { + "band": "5G", + "country": "CA", + "allow-dfs": True, + "channel-mode": "VHT", + "channel-width": 20, + "channel": 136 + } }, - "rf": {}, "radius": False } @pytest.mark.parametrize( @@ -778,7 +828,7 @@ class TestDFSChannel136Bw20(object): profile_data = setup_params_general11["ssid_modes"]["wpa2_personal"][0] ssid_name = profile_data["ssid_name"] security_key = profile_data["security_key"] - channel = setup_params_general11["dfs"]["channel"] + channel = setup_params_general11["rf"]["5G"]["channel"] security = "wpa2" band = "fiveg" mode = "BRIDGE" @@ -827,11 +877,16 @@ setup_params_general12 = { {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} ] }, - "dfs": { - "channel": 140, - "channel_bandwidth": 20 + "rf": { + "5G": { + "band": "5G", + "country": "CA", + "allow-dfs": True, + "channel-mode": "VHT", + "channel-width": 20, + "channel": 140 + } }, - "rf": {}, "radius": False } @pytest.mark.parametrize( @@ -852,7 +907,7 @@ class TestDFSChannel140Bw20(object): profile_data = setup_params_general12["ssid_modes"]["wpa2_personal"][0] ssid_name = profile_data["ssid_name"] security_key = profile_data["security_key"] - channel = setup_params_general12["dfs"]["channel"] + channel = setup_params_general12["rf"]["5G"]["channel"] security = "wpa2" band = "fiveg" mode = "BRIDGE" @@ -901,11 +956,16 @@ setup_params_general13 = { {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} ] }, - "dfs": { - "channel": 144, - "channel_bandwidth": 20 + "rf": { + "5G": { + "band": "5G", + "country": "CA", + "allow-dfs": True, + "channel-mode": "VHT", + "channel-width": 20, + "channel": 144 + } }, - "rf": {}, "radius": False } @pytest.mark.parametrize( @@ -926,7 +986,7 @@ class TestDFSChannel144Bw20(object): profile_data = setup_params_general13["ssid_modes"]["wpa2_personal"][0] ssid_name = profile_data["ssid_name"] security_key = profile_data["security_key"] - channel = setup_params_general13["dfs"]["channel"] + channel = setup_params_general13["rf"]["5G"]["channel"] security = "wpa2" band = "fiveg" mode = "BRIDGE" diff --git a/tests/e2e/basic/dfs_test/wpa2_personal/dfs_40MHz/test_dfs_40_bridge.py b/tests/e2e/basic/dfs_test/wpa2_personal/dfs_40MHz/test_dfs_40_bridge.py index 61d6b3bf5..c5379c80c 100644 --- a/tests/e2e/basic/dfs_test/wpa2_personal/dfs_40MHz/test_dfs_40_bridge.py +++ b/tests/e2e/basic/dfs_test/wpa2_personal/dfs_40MHz/test_dfs_40_bridge.py @@ -13,11 +13,16 @@ setup_params_general1 = { {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} ] }, - "dfs": { - "channel": 52, - "channel_bandwidth": 40 + "rf": { + "5G": { + "band": "5G", + "country": "CA", + "allow-dfs": True, + "channel-mode": "VHT", + "channel-width": 40, + "channel": 52 + } }, - "rf": {}, "radius": False } @pytest.mark.parametrize( @@ -38,7 +43,7 @@ class TestDFSChannel52Bw40(object): profile_data = setup_params_general1["ssid_modes"]["wpa2_personal"][0] ssid_name = profile_data["ssid_name"] security_key = profile_data["security_key"] - channel = setup_params_general1["dfs"]["channel"] + channel = setup_params_general1["rf"]["5G"]["channel"] security = "wpa2" band = "fiveg" mode = "BRIDGE" @@ -87,11 +92,16 @@ setup_params_general2 = { {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} ] }, - "dfs": { - "channel": 100, - "channel_bandwidth": 40 + "rf": { + "5G": { + "band": "5G", + "country": "CA", + "allow-dfs": True, + "channel-mode": "VHT", + "channel-width": 40, + "channel": 100 + } }, - "rf": {}, "radius": False } @pytest.mark.parametrize( @@ -112,7 +122,7 @@ class TestDFSChannel100Bw40(object): profile_data = setup_params_general2["ssid_modes"]["wpa2_personal"][0] ssid_name = profile_data["ssid_name"] security_key = profile_data["security_key"] - channel = setup_params_general2["dfs"]["channel"] + channel = setup_params_general2["rf"]["5G"]["channel"] security = "wpa2" band = "fiveg" mode = "BRIDGE" @@ -309,11 +319,16 @@ setup_params_general5 = { {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} ] }, - "dfs": { - "channel": 60, - "channel_bandwidth": 40 + "rf": { + "5G": { + "band": "5G", + "country": "CA", + "allow-dfs": True, + "channel-mode": "VHT", + "channel-width": 40, + "channel": 60 + } }, - "rf": {}, "radius": False } @pytest.mark.parametrize( @@ -334,7 +349,7 @@ class TestDFSChannel60Bw40(object): profile_data = setup_params_general5["ssid_modes"]["wpa2_personal"][0] ssid_name = profile_data["ssid_name"] security_key = profile_data["security_key"] - channel = setup_params_general5["dfs"]["channel"] + channel = setup_params_general5["rf"]["5G"]["channel"] security = "wpa2" band = "fiveg" mode = "BRIDGE" @@ -457,11 +472,16 @@ setup_params_general7 = { {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} ] }, - "dfs": { - "channel": 108, - "channel_bandwidth": 40 + "rf": { + "5G": { + "band": "5G", + "country": "CA", + "allow-dfs": True, + "channel-mode": "VHT", + "channel-width": 40, + "channel": 108 + } }, - "rf": {}, "radius": False } @pytest.mark.parametrize( @@ -482,7 +502,7 @@ class TestDFSChannel108Bw40(object): profile_data = setup_params_general7["ssid_modes"]["wpa2_personal"][0] ssid_name = profile_data["ssid_name"] security_key = profile_data["security_key"] - channel = setup_params_general7["dfs"]["channel"] + channel = setup_params_general7["rf"]["5G"]["channel"] security = "wpa2" band = "fiveg" mode = "BRIDGE" @@ -753,11 +773,17 @@ setup_params_general11 = { {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} ] }, - "dfs": { - "channel": 132, - "channel_bandwidth": 40 + "rf": { + "5G": { + "band": "5G", + "country": "CA", + "allow-dfs": True, + "channel-mode": "VHT", + "channel-width": 40, + "channel": 132 + } + }, - "rf": {}, "radius": False } @pytest.mark.parametrize( @@ -778,7 +804,7 @@ class TestDFSChannel132Bw40(object): profile_data = setup_params_general11["ssid_modes"]["wpa2_personal"][0] ssid_name = profile_data["ssid_name"] security_key = profile_data["security_key"] - channel = setup_params_general11["dfs"]["channel"] + channel = setup_params_general11["rf"]["5G"]["channel"] security = "wpa2" band = "fiveg" mode = "BRIDGE" diff --git a/tests/e2e/basic/dfs_test/wpa2_personal/dfs_80MHz/test_dfs_80_bridge.py b/tests/e2e/basic/dfs_test/wpa2_personal/dfs_80MHz/test_dfs_80_bridge.py index 9e3d35426..fa90244c3 100644 --- a/tests/e2e/basic/dfs_test/wpa2_personal/dfs_80MHz/test_dfs_80_bridge.py +++ b/tests/e2e/basic/dfs_test/wpa2_personal/dfs_80MHz/test_dfs_80_bridge.py @@ -13,11 +13,16 @@ setup_params_general1 = { {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} ] }, - "dfs": { - "channel": 52, - "channel_bandwidth": 80 + "rf": { + "5G": { + "band": "5G", + "country": "CA", + "allow-dfs": True, + "channel-mode": "VHT", + "channel-width": 80, + "channel": 52 + } }, - "rf": {}, "radius": False } @pytest.mark.parametrize( @@ -38,7 +43,7 @@ class TestDFSChannel52Bw80(object): profile_data = setup_params_general1["ssid_modes"]["wpa2_personal"][0] ssid_name = profile_data["ssid_name"] security_key = profile_data["security_key"] - channel = setup_params_general1["dfs"]["channel"] + channel = setup_params_general1["rf"]["5G"]["channel"] security = "wpa2" band = "fiveg" mode = "BRIDGE" @@ -87,11 +92,16 @@ setup_params_general2 = { {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} ] }, - "dfs": { - "channel": 100, - "channel_bandwidth": 80 + "rf": { + "5G": { + "band": "5G", + "country": "CA", + "allow-dfs": True, + "channel-mode": "VHT", + "channel-width": 80, + "channel": 100 + } }, - "rf": {}, "radius": False } @pytest.mark.parametrize( @@ -112,7 +122,7 @@ class TestDFSChannel100Bw80(object): profile_data = setup_params_general2["ssid_modes"]["wpa2_personal"][0] ssid_name = profile_data["ssid_name"] security_key = profile_data["security_key"] - channel = setup_params_general2["dfs"]["channel"] + channel = setup_params_general2["rf"]["5G"]["channel"] security = "wpa2" band = "fiveg" mode = "BRIDGE" @@ -753,11 +763,16 @@ setup_params_general11 = { {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} ] }, - "dfs": { - "channel": 132, - "channel_bandwidth": 80 + "rf": { + "5G": { + "band": "5G", + "country": "CA", + "allow-dfs": True, + "channel-mode": "VHT", + "channel-width": 80, + "channel": 132 + } }, - "rf": {}, "radius": False } @pytest.mark.parametrize( @@ -778,7 +793,7 @@ class TestDFSChannel132Bw80(object): profile_data = setup_params_general11["ssid_modes"]["wpa2_personal"][0] ssid_name = profile_data["ssid_name"] security_key = profile_data["security_key"] - channel = setup_params_general11["dfs"]["channel"] + channel = setup_params_general11["rf"]["5G"]["channel"] security = "wpa2" band = "fiveg" mode = "BRIDGE" diff --git a/tests/fixtures_2x.py b/tests/fixtures_2x.py index 0e9d3aa02..4560f008b 100644 --- a/tests/fixtures_2x.py +++ b/tests/fixtures_2x.py @@ -380,11 +380,6 @@ class Fixtures_2x: test_cases = {} profile_data = {} var = "" - list_key = list(parameter.keys()) - - if "dfs" in list_key: - print("In dfs") - instantiate_profile_obj.set_radio_config(DFS=True, channel=parameter["dfs"]["channel"], bw=parameter["dfs"]["channel_bandwidth"]) if len(parameter['rf']) > 0: print("Country code channel division") instantiate_profile_obj.set_radio_config(radio_config=parameter['rf'])