updated the env script to support pytest.ini creation and option to add test packages depending upon the user input

Also added an option to not apply config which a particular dut doesn't support

Signed-off-by: shivam <shivam.thakur@candelatech.com>
This commit is contained in:
shivam
2022-08-17 12:26:33 +05:30
parent d1eaa51288
commit 2f40d19b67
4 changed files with 122 additions and 99 deletions

View File

@@ -1443,18 +1443,22 @@ class UProfileUtility:
"channel": "auto"
}
for band in radio_config:
if band == "2G":
if band == "2G" and radio_config[band] is not None:
for keys in radio_config[band]:
base_radio_config_2g[keys] = radio_config[band][keys]
if band == "5G":
if band == "5G" and radio_config[band] is not None:
for keys in radio_config[band]:
base_radio_config_5g[keys] = radio_config[band][keys]
if band == "6G":
if band == "6G" and radio_config[band] is not None:
for keys in radio_config[band]:
base_radio_config_6g[keys] = radio_config[band][keys]
self.base_profile_config["radios"].append(base_radio_config_2g)
self.base_profile_config["radios"].append(base_radio_config_5g)
if radio_config["2G"] is not None:
self.base_profile_config["radios"].append(base_radio_config_2g)
if radio_config["5G"] is not None:
self.base_profile_config["radios"].append(base_radio_config_5g)
if radio_config["6G"] is not None:
self.base_profile_config["radios"].append(base_radio_config_6g)
self.vlan_section["ssids"] = []
self.vlan_ids = []

View File

@@ -162,7 +162,6 @@ class tip_2x:
base_dict[i[0]].append(self.tip_2x_specific_encryption_translation[i[1]])
if i[1] in self.supported_bands:
base_dict[i[1]].append((self.tip_2x_specific_encryption_translation[i[0]]))
temp = []
for i in list(base_dict.values()):
for j in i:
@@ -175,7 +174,6 @@ class tip_2x:
temp_conf = configuration["ssid_modes"].copy()
for i in temp_conf:
for j in range(len(temp_conf[i])):
for k in temp_conf[i][j]["appliedRadios"]:
if self.tip_2x_specific_encryption_translation[i] not in base_dict[k]:
configuration["ssid_modes"][i][j]["appliedRadios"].remove(k)
@@ -187,7 +185,24 @@ class tip_2x:
for ssids in configuration["ssid_modes"]:
for i in configuration["ssid_modes"][ssids]:
i["security"] = self.tip_2x_specific_encryption_translation[ssids]
return configuration
temp_conf = configuration.copy()
for i in range(0, len(self.device_under_tests_info)):
if configuration["mode"] not in self.device_under_tests_info[i]["supported_modes"]:
pytest.skip(configuration["mode"] + " is not Supported by DUT")
for enc in configuration["ssid_modes"]:
for idx in configuration["ssid_modes"][enc]:
print(idx)
check = all(item in self.device_under_tests_info[i]["supported_bands"] for item in idx["appliedRadios"])
print(check)
if not check:
temp_conf["ssid_modes"][enc].remove(idx)
for key in configuration["rf"]:
# print(key)
if key not in self.device_under_tests_info[i]["supported_bands"]:
print(key)
temp_conf["rf"][key] = None
return temp_conf
"""
setup_basic_configuration - Method to configure AP in basic operating modes with multiple SSID's and multiple AP's
@@ -218,7 +233,6 @@ class tip_2x:
profile_object.add_ssid(ssid_data=ssid_data)
logging.info(
"Configuration That is getting pushed: " + json.dumps(profile_object.base_profile_config, indent=2))
# Setup Config Apply on all AP's
ret_val = dict()
for i in range(0, len(self.device_under_tests_info)):
@@ -873,7 +887,7 @@ if __name__ == '__main__':
"radius": False
}
target = [['2G', 'wpa2_personal'], ['5G', 'wpa2_personal']]
# d = var.setup_configuration_data(configuration=setup_params_general, requested_combination=target)
d = var.setup_basic_configuration(configuration=setup_params_general, requested_combination=target)
print(d)
# var.setup_firmware()

View File

@@ -129,4 +129,97 @@ except ImportError as e:
echo -e "########################################################################################################################" >> tests/imports.py
# TODO Create a perfecto pip module baseline method
fi
fi
fi
WLAN_TESTING_PATH=$(pwd)"/tests/"
echo $WLAN_TESTING_PATH
rm tests/pytest.ini
touch tests/pytest.ini
echo -e "[pytest]
python_files = test_*.py setup_*.py
norecursedirs = .svn _build tmp*
addopts= --junitxml=test_everything.xml
log_format = %(asctime)s %(levelname)s %(message)s
log_date_format = %Y-%m-%d %H:%M:%S
;norecursedirs=out build
num_stations=1
testpaths =
$WLAN_TESTING_PATH
# Cloud SDK settings
sdk-customer-id=2
#fIRMWARE Option
firmware=0
# Radius Settings
radius_server_ip=192.168.200.75
radius_port=1812
radius_secret=testing123
# Testrail Info
tr_url=https://telecominfraproject.testrail.com
tr_user=cicd@tip.com
tr_pass=Open$Wifi123
tr_project_id=WLAN
tr_prefix=TIP_
milestone=29
filterwarnings=ignore::UserWarning
markers =
; Test Suites, It Contains
ow_sanity_lf: OpenWifi Sanity Test Plan
ow_performance_lf: OpenWifi Performance Test Plan
ow_sanity_interop: OpenWifi Sanity with Interop
; Test Suites, It Contains
client_connectivity_tests: Client Connectivity Test Cases with bridge|nat|vlan modes across 2.4|5|6 GHz bands with Various Encryptions
dfs_tests: Dynamic Frequency Selection Test Cases
multi_psk_tests: Multi PSK Test Cases
rate_limiting_tests: Rate Limiting Test Cases
dvlan_tests: Dynamic VLAN Test Cases
dynamic_qos_tests: Dynamic QOS Test Cases
multi_vlan_tests: Multi VLAN Combination based Test Cases
client_scale_tests: Client Capacity Tests with maximum possible Stations bridge|nat|vlan 2.4|5|6 GHz Bands
peak_throughput_tests: Single Client Peak Performance Test with various Bandwidths across 2.4|5|6 GHz Bands with various Client Types
dataplane_tests: Single Client Throughput Test with various pkt sizes with UL|DL|BI with AC|AX Client Types across 2.4|5|6 GHz Bands
multi_band_tests: Multi Band Performance Test on bridge|nat|vlan mode with Single Client on each of the 2.4|5|6 GHz Bands
rate_vs_range_tests: Rate verses Range Tests with Various Combinations bridge|nat|vlan 2.4|5|6 GHz Bands
rate_vs_orientation_tests: Rate verses Orientation Tests with Various Combinations bridge|nat|vlan 2.4|5|6 GHz Bands
rx_sensitivity_tests: Receiver Sensitivity Tests with Various Combinations bridge|nat|vlan 2.4|5|6 GHz Bands
spatial_consistency_tests: Spatial Consistency Tests with Various Combinations bridge|nat|vlan 2.4|5|6 GHz Bands
multi_assoc_disassoc_tests: Multi Association and Disassociation Tests with Various Combinations bridge|nat|vlan 2.4|5|6 GHz Bands
multi_station_performance_tests: Multi Station Performance Tests with Various Combinations bridge|nat|vlan 2.4|5|6 GHz Bands
mu_mimo_performance_tests: Multi User MIMO Tests with Various Combinations bridge|nat|vlan 2.4|5|6 GHz Bands
ofdma_tests: OFDMA Tests with Various Combinations bridge|nat|vlan 2.4|5|6 GHz Bands
; Supported Markers
bridge: Use this marker to run bridge mode tests in each of the above test plans/suites
nat: Use this marker to run nat mode tests in each of the above test plans/suites
vlan: Use this marker to run vlan mode tests in each of the above test plans/suites
twog: Use this marker to run 2.4 GHz tests in each of the above test plans/suites
fiveg: Use this marker to run 5 GHz tests in each of the above test plans/suites
sixg: Use this marker to run 6 GHz tests in each of the above test plans/suites
open: Use this marker to run open Encryption tests in each of the above test plans/suites
wpa: Use this marker to run wpa Encryption tests in each of the above test plans/suites
wpa2_personal: Use this marker to run wpa2_personal Encryption tests in each of the above test plans/suites
wpa3_personal: Use this marker to run wpa3_personal Encryption tests in each of the above test plans/suites
wpa3_personal_mixed: Use this marker to run wpa3_personal_mixed Encryption tests in each of the above test plans/suites
wpa_wpa2_personal_mixed: Use this marker to run wpa_wpa2_personal_mixed Encryption tests in each of the above test plans/suites
wpa_enterprise: Use this marker to run wpa_enterprise Encryption tests in each of the above test plans/suites
wpa2_enterprise: Use this marker to run wpa2_enterprise Encryption tests in each of the above test plans/suites
wpa3_enterprise: Use this marker to run wpa3_enterprise Encryption tests in each of the above test plans/suites
wpa_wpa2_enterprise_mixed: Use this marker to run wpa_wpa2_enterprise_mixed Encryption tests in each of the above test plans/suites
wpa3_enterprise_mixed: Use this marker to run wpa3_enterprise_mixed Encryption tests in each of the above test plans/suites
" >> tests/pytest.ini

View File

@@ -1,88 +0,0 @@
[pytest]
python_files = test_*.py setup_*.py
norecursedirs = .svn _build tmp*
addopts= --junitxml=test_everything.xml
log_format = %(asctime)s %(levelname)s %(message)s
log_date_format = %Y-%m-%d %H:%M:%S
;norecursedirs=out build
num_stations=1
testpaths =
/home/shivam/projects/tip/wlan-testing/tests
# Cloud SDK settings
sdk-customer-id=2
#fIRMWARE Option
firmware=0
# Radius Settings
radius_server_ip=192.168.200.75
radius_port=1812
radius_secret=testing123
# Testrail Info
tr_url=https://telecominfraproject.testrail.com
tr_user=cicd@tip.com
tr_pass=Open$Wifi123
tr_project_id=WLAN
tr_prefix=TIP_
milestone=29
filterwarnings=ignore::UserWarning
markers =
; Test Suites, It Contains
ow_sanity_lf: OpenWifi Sanity Test Plan
ow_performance_lf: OpenWifi Performance Test Plan
ow_sanity_interop: OpenWifi Sanity with Interop
; Test Suites, It Contains
client_connectivity_tests: Client Connectivity Test Cases with bridge|nat|vlan modes across 2.4|5|6 GHz bands with Various Encryptions
dfs_tests: Dynamic Frequency Selection Test Cases
multi_psk_tests: Multi PSK Test Cases
rate_limiting_tests: Rate Limiting Test Cases
dvlan_tests: Dynamic VLAN Test Cases
dynamic_qos_tests: Dynamic QOS Test Cases
multi_vlan_tests: Multi VLAN Combination based Test Cases
client_scale_tests: Client Capacity Tests with maximum possible Stations bridge|nat|vlan 2.4|5|6 GHz Bands
peak_throughput_tests: Single Client Peak Performance Test with various Bandwidths across 2.4|5|6 GHz Bands with various Client Types
dataplane_tests: Single Client Throughput Test with various pkt sizes with UL|DL|BI with AC|AX Client Types across 2.4|5|6 GHz Bands
multi_band_tests: Multi Band Performance Test on bridge|nat|vlan mode with Single Client on each of the 2.4|5|6 GHz Bands
rate_vs_range_tests: Rate verses Range Tests with Various Combinations bridge|nat|vlan 2.4|5|6 GHz Bands
rate_vs_orientation_tests: Rate verses Orientation Tests with Various Combinations bridge|nat|vlan 2.4|5|6 GHz Bands
rx_sensitivity_tests: Receiver Sensitivity Tests with Various Combinations bridge|nat|vlan 2.4|5|6 GHz Bands
spatial_consistency_tests: Spatial Consistency Tests with Various Combinations bridge|nat|vlan 2.4|5|6 GHz Bands
multi_assoc_disassoc_tests: Multi Association and Disassociation Tests with Various Combinations bridge|nat|vlan 2.4|5|6 GHz Bands
multi_station_performance_tests: Multi Station Performance Tests with Various Combinations bridge|nat|vlan 2.4|5|6 GHz Bands
mu_mimo_performance_tests: Multi User MIMO Tests with Various Combinations bridge|nat|vlan 2.4|5|6 GHz Bands
ofdma_tests: OFDMA Tests with Various Combinations bridge|nat|vlan 2.4|5|6 GHz Bands
; Supported Markers
bridge: Use this marker to run bridge mode tests in each of the above test plans/suites
nat: Use this marker to run nat mode tests in each of the above test plans/suites
vlan: Use this marker to run vlan mode tests in each of the above test plans/suites
twog: Use this marker to run 2.4 GHz tests in each of the above test plans/suites
fiveg: Use this marker to run 5 GHz tests in each of the above test plans/suites
sixg: Use this marker to run 6 GHz tests in each of the above test plans/suites
open: Use this marker to run open Encryption tests in each of the above test plans/suites
wpa: Use this marker to run wpa Encryption tests in each of the above test plans/suites
wpa2_personal: Use this marker to run wpa2_personal Encryption tests in each of the above test plans/suites
wpa3_personal: Use this marker to run wpa3_personal Encryption tests in each of the above test plans/suites
wpa3_personal_mixed: Use this marker to run wpa3_personal_mixed Encryption tests in each of the above test plans/suites
wpa_wpa2_personal_mixed: Use this marker to run wpa_wpa2_personal_mixed Encryption tests in each of the above test plans/suites
wpa_enterprise: Use this marker to run wpa_enterprise Encryption tests in each of the above test plans/suites
wpa2_enterprise: Use this marker to run wpa2_enterprise Encryption tests in each of the above test plans/suites
wpa3_enterprise: Use this marker to run wpa3_enterprise Encryption tests in each of the above test plans/suites
wpa_wpa2_enterprise_mixed: Use this marker to run wpa_wpa2_enterprise_mixed Encryption tests in each of the above test plans/suites
wpa3_enterprise_mixed: Use this marker to run wpa3_enterprise_mixed Encryption tests in each of the above test plans/suites