Skip to content

Commit

Permalink
Added additional validation in dvlan test cases (#1008)
Browse files Browse the repository at this point in the history
* Fixed IndexError in dvlan test cases

Signed-off-by: jitendracandela <[email protected]>

* Modified upstream port for dvlan test cases

Signed-off-by: jitendracandela <[email protected]>

---------

Signed-off-by: jitendracandela <[email protected]>
  • Loading branch information
jitendracandela authored Nov 28, 2024
1 parent 0f7cf49 commit 7a997a6
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def test_radius_vlan_info_retained_after_periodic_reauthentication_5g_wpa2(self,
mode = mode, band = band, eap = eap,
ttls_passwd = ttls_passwd, ieee80211w = 0,
identity = identity, num_sta = 1,
dut_data = setup_configuration, cleanup=False)
dut_data = setup_configuration, cleanup=False, d_vlan=True)

station_ip = get_test_library.station_data[list(get_test_library.station_data.keys())[0]]['ip']
eth_ip = get_test_library.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
Expand Down Expand Up @@ -224,6 +224,7 @@ def test_radius_vlan_info_retained_after_periodic_reauthentication_5g_wpa2(self,
assert True, result
else:
assert False, result
assert passes == "PASS", result

@pytest.mark.absenceofvlanid
@pytest.mark.wpa2_enterprise
Expand Down Expand Up @@ -253,7 +254,7 @@ def test_ssid_vlan_used_in_absence_of_radius_vlan_5g_wpa2(self, get_test_library

passes, result = get_test_library.enterprise_client_connectivity_test(ssid=ssid_name, security=security,
extra_securities=extra_secu, vlan_id=vlan, mode=mode, band=band, eap=eap,
d_vlan=True, ttls_passwd=ttls_passwd, ieee80211w=0, identity=identity,
d_vlan=False, ttls_passwd=ttls_passwd, ieee80211w=0, identity=identity,
num_sta=1, dut_data=setup_configuration)

station_ip = get_test_library.station_data[list(get_test_library.station_data.keys())[0]]['ip']
Expand Down Expand Up @@ -349,7 +350,7 @@ def test_client_association_ap_with_dynamic_vlan_5g_wpa2(self, get_test_library,
mode=mode, band=band, eap=eap,
ttls_passwd=ttls_passwd, ieee80211w=0,
identity=identity, num_sta=1,
dut_data=setup_configuration)
dut_data=setup_configuration, d_vlan=True)

station_ip = get_test_library.station_data[list(get_test_library.station_data.keys())[0]]['ip']
eth_ssid_vlan_ip = get_test_library.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
Expand All @@ -376,6 +377,7 @@ def test_client_association_ap_with_dynamic_vlan_5g_wpa2(self, get_test_library,
assert True, result
elif not val:
assert False, result
assert passes == "PASS", result

@pytest.mark.subsequent_user_for_same_user_account
@pytest.mark.wpa2_enterprise
Expand Down Expand Up @@ -458,10 +460,14 @@ def test_subsequent_user_for_different_user_account_5g_wpa2(self, get_test_libra
dynamic_vlan_pass = ["passwordA", "passwordB"]

for user_id, user_pass, cnt in zip(dynamic_vlan_user, dynamic_vlan_pass, range(0, len(vlan))):
if cnt == 0:
d_vlan = False
else:
d_vlan = True
passes, result = get_test_library.enterprise_client_connectivity_test(ssid=ssid_name, passkey="[BLANK]",
security=security, extra_securities=extra_secu, mode=mode, band=band, vlan_id=vlan,
num_sta=1, ttls_passwd=user_pass, ieee80211w=0, dut_data=setup_configuration,
eap=eap, identity=user_id)
eap=eap, identity=user_id, d_vlan=d_vlan)

station_ip = get_test_library.station_data[list(get_test_library.station_data.keys())[0]]['ip']
sta_ip.append(station_ip)
Expand All @@ -484,4 +490,5 @@ def test_subsequent_user_for_different_user_account_5g_wpa2(self, get_test_libra
if val:
assert True, result
elif not val:
assert False, result
assert False, result
assert passes == "PASS", result
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def test_radius_vlan_info_retained_after_periodic_reauthentication_2g_wpa2(self,
mode = mode, band = band, eap = eap,
ttls_passwd = ttls_passwd, ieee80211w = 0,
identity = identity, num_sta = 1,
dut_data = setup_configuration, cleanup=False)
dut_data = setup_configuration, cleanup=False, d_vlan=True)

station_ip = get_test_library.station_data[list(get_test_library.station_data.keys())[0]]['ip']
eth_ip = get_test_library.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
Expand Down Expand Up @@ -228,6 +228,8 @@ def test_radius_vlan_info_retained_after_periodic_reauthentication_2g_wpa2(self,
else:
assert False, result

assert passes == "PASS", result

@pytest.mark.absenceofvlanid
@pytest.mark.wpa2_enterprise
@pytest.mark.twog
Expand Down Expand Up @@ -255,7 +257,7 @@ def test_ssid_vlan_used_in_absence_of_radius_vlan_2g_wpa2(self, get_test_library

passes, result = get_test_library.enterprise_client_connectivity_test(ssid=ssid_name, security=security,
extra_securities=extra_secu, vlan_id=vlan, mode=mode, band=band, eap=eap,
d_vlan=True, ttls_passwd=ttls_passwd, ieee80211w=0, identity=identity,
d_vlan=False, ttls_passwd=ttls_passwd, ieee80211w=0, identity=identity,
num_sta=1, dut_data=setup_configuration)

station_ip = get_test_library.station_data[list(get_test_library.station_data.keys())[0]]['ip']
Expand Down Expand Up @@ -351,7 +353,7 @@ def test_client_association_ap_with_dynamic_vlan_2g_wpa2(self, get_test_library,
mode=mode, band=band, eap=eap,
ttls_passwd=ttls_passwd, ieee80211w=0,
identity=identity, num_sta=1,
dut_data=setup_configuration)
dut_data=setup_configuration, d_vlan=True)

station_ip = get_test_library.station_data[list(get_test_library.station_data.keys())[0]]['ip']
eth_ssid_vlan_ip = get_test_library.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
Expand Down Expand Up @@ -379,6 +381,8 @@ def test_client_association_ap_with_dynamic_vlan_2g_wpa2(self, get_test_library,
elif not val:
assert False, result

assert passes == "PASS", result

@pytest.mark.subsequent_user_for_same_user_account
@pytest.mark.wpa2_enterprise
@pytest.mark.twog
Expand Down Expand Up @@ -460,11 +464,15 @@ def test_subsequent_user_for_different_user_account_2g_wpa2(self, get_test_libra
dynamic_vlan_pass = ["passwordA", "passwordB"]

for user_id, user_pass, cnt in zip(dynamic_vlan_user, dynamic_vlan_pass, range(0, len(vlan))):
if cnt == 0:
d_vlan = False
else:
d_vlan = True
passes, result = get_test_library.enterprise_client_connectivity_test(ssid=ssid_name, passkey="[BLANK]",
security=security, extra_securities=extra_secu,
mode=mode, band=band, vlan_id=vlan, dut_data=setup_configuration,
num_sta=1, ttls_passwd=user_pass, ieee80211w=0,
wep_key="NA", ca_cert="NA", eap=eap, identity=user_id)
wep_key="NA", ca_cert="NA", eap=eap, identity=user_id, d_vlan=d_vlan)

station_ip = get_test_library.station_data[list(get_test_library.station_data.keys())[0]]['ip']
sta_ip.append(station_ip)
Expand All @@ -487,3 +495,5 @@ def test_subsequent_user_for_different_user_account_2g_wpa2(self, get_test_libra
assert True, result
elif not val:
assert False, result

assert passes == "PASS", result
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def test_radius_vlan_info_retained_after_periodic_reauthentication_5g_wpa3(self,
mode = mode, band = band, eap = eap,
ttls_passwd = ttls_passwd, ieee80211w = 0,
identity = identity, num_sta = 1, key_mgmt="WPA-EAP-SHA256",
dut_data = setup_configuration, cleanup=False)
dut_data = setup_configuration, cleanup=False, d_vlan=True)

station_ip = get_test_library.station_data[list(get_test_library.station_data.keys())[0]]['ip']
eth_ip = get_test_library.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
Expand Down Expand Up @@ -222,6 +222,8 @@ def test_radius_vlan_info_retained_after_periodic_reauthentication_5g_wpa3(self,
else:
assert False, result

assert passes == "PASS", result

@pytest.mark.absenceofvlanid
@pytest.mark.wpa3_enterprise
@pytest.mark.fiveg
Expand Down Expand Up @@ -249,7 +251,7 @@ def test_ssid_vlan_used_in_absence_of_radius_vlan_5g_wpa3(self, get_test_library

passes, result = get_test_library.enterprise_client_connectivity_test(ssid=ssid_name, security=security,
extra_securities=extra_secu, vlan_id=vlan, mode=mode, band=band, eap=eap,
d_vlan=True, ttls_passwd=ttls_passwd, ieee80211w=0, identity=identity,
d_vlan=False, ttls_passwd=ttls_passwd, ieee80211w=0, identity=identity,
num_sta=1, dut_data=setup_configuration, key_mgmt="WPA-EAP-SHA256")

station_ip = get_test_library.station_data[list(get_test_library.station_data.keys())[0]]['ip']
Expand Down Expand Up @@ -344,7 +346,7 @@ def test_client_association_ap_with_dynamic_vlan_5g_wpa3(self, get_test_library,
mode=mode, band=band, eap=eap,
ttls_passwd=ttls_passwd, ieee80211w=0,
identity=identity, num_sta=1, key_mgmt="WPA-EAP-SHA256",
dut_data=setup_configuration)
dut_data=setup_configuration, d_vlan=True)

station_ip = get_test_library.station_data[list(get_test_library.station_data.keys())[0]]['ip']
eth_ssid_vlan_ip = get_test_library.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
Expand Down Expand Up @@ -372,6 +374,8 @@ def test_client_association_ap_with_dynamic_vlan_5g_wpa3(self, get_test_library,
elif not val:
assert False, result

assert passes == "PASS", result

@pytest.mark.subsequent_user_for_same_user_account
@pytest.mark.wpa3_enterprise
@pytest.mark.fiveg
Expand Down Expand Up @@ -452,10 +456,14 @@ def test_subsequent_user_for_different_user_account_5g_wpa3(self, get_test_libra
dynamic_vlan_pass = ["passwordA", "passwordB"]

for user_id, user_pass, cnt in zip(dynamic_vlan_user, dynamic_vlan_pass, range(0, len(vlan))):
if cnt == 0:
d_vlan = False
else:
d_vlan = True
passes, result = get_test_library.enterprise_client_connectivity_test(ssid=ssid_name, passkey="[BLANK]",
security=security, extra_securities=extra_secu, mode=mode, band=band, vlan_id=vlan,
num_sta=1, ttls_passwd=user_pass, ieee80211w=0, dut_data=setup_configuration,
eap=eap, identity=user_id, key_mgmt="WPA-EAP-SHA256")
eap=eap, identity=user_id, key_mgmt="WPA-EAP-SHA256", d_vlan=d_vlan)

station_ip = get_test_library.station_data[list(get_test_library.station_data.keys())[0]]['ip']
sta_ip.append(station_ip)
Expand All @@ -479,3 +487,5 @@ def test_subsequent_user_for_different_user_account_5g_wpa3(self, get_test_libra
assert True, result
elif not val:
assert False, result

assert passes == "PASS", result
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def test_radius_vlan_info_retained_after_periodic_reauthentication_2g_wpa3(self,
mode = mode, band = band, eap = eap,
ttls_passwd = ttls_passwd, ieee80211w = 0,
identity = identity, num_sta = 1, key_mgmt="WPA-EAP-SHA256",
dut_data = setup_configuration, cleanup=False)
dut_data = setup_configuration, cleanup=False, d_vlan=True)

station_ip = get_test_library.station_data[list(get_test_library.station_data.keys())[0]]['ip']
eth_ip = get_test_library.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
Expand Down Expand Up @@ -223,6 +223,8 @@ def test_radius_vlan_info_retained_after_periodic_reauthentication_2g_wpa3(self,
else:
assert False, result

assert passes == "PASS", result

@pytest.mark.absenceofvlanid
@pytest.mark.wpa3_enterprise
@pytest.mark.twog
Expand Down Expand Up @@ -250,7 +252,7 @@ def test_ssid_vlan_used_in_absence_of_radius_vlan_2g_wpa3(self, get_test_library

passes, result = get_test_library.enterprise_client_connectivity_test(ssid=ssid_name, security=security,
extra_securities=extra_secu, vlan_id=vlan, mode=mode, band=band, eap=eap,
d_vlan=True, ttls_passwd=ttls_passwd, ieee80211w=0, identity=identity,
d_vlan=False, ttls_passwd=ttls_passwd, ieee80211w=0, identity=identity,
num_sta=1, dut_data=setup_configuration, key_mgmt="WPA-EAP-SHA256")

station_ip = get_test_library.station_data[list(get_test_library.station_data.keys())[0]]['ip']
Expand Down Expand Up @@ -346,7 +348,7 @@ def test_client_association_ap_with_dynamic_vlan_2g_wpa3(self, get_test_library,
mode=mode, band=band, eap=eap,
ttls_passwd=ttls_passwd, ieee80211w=0,
identity=identity, num_sta=1, key_mgmt="WPA-EAP-SHA256",
dut_data=setup_configuration)
dut_data=setup_configuration, d_vlan=True)

station_ip = get_test_library.station_data[list(get_test_library.station_data.keys())[0]]['ip']
eth_ssid_vlan_ip = get_test_library.json_get("/port/" + port_resources[0] + "/" + port_resources[1] +
Expand Down Expand Up @@ -374,6 +376,8 @@ def test_client_association_ap_with_dynamic_vlan_2g_wpa3(self, get_test_library,
elif not val:
assert False, result

assert passes == "PASS", result

@pytest.mark.subsequent_user_for_same_user_account
@pytest.mark.wpa3_enterprise
@pytest.mark.twog
Expand Down Expand Up @@ -454,11 +458,15 @@ def test_subsequent_user_for_different_user_account_2g_wpa3(self, get_test_libra
dynamic_vlan_pass = ["passwordA", "passwordB"]

for user_id, user_pass, cnt in zip(dynamic_vlan_user, dynamic_vlan_pass, range(0, len(vlan))):
if cnt == 0:
d_vlan = False
else:
d_vlan = True
passes, result = get_test_library.enterprise_client_connectivity_test(ssid=ssid_name, passkey="[BLANK]",
security=security, extra_securities=extra_secu, key_mgmt="WPA-EAP-SHA256",
mode=mode, band=band, vlan_id=vlan, dut_data=setup_configuration,
num_sta=1, ttls_passwd=user_pass, ieee80211w=0,
wep_key="NA", ca_cert="NA", eap=eap, identity=user_id)
wep_key="NA", ca_cert="NA", eap=eap, identity=user_id, d_vlan=d_vlan)

station_ip = get_test_library.station_data[list(get_test_library.station_data.keys())[0]]['ip']
sta_ip.append(station_ip)
Expand All @@ -482,3 +490,5 @@ def test_subsequent_user_for_different_user_account_2g_wpa3(self, get_test_libra
elif not val:
assert False, result

assert passes == "PASS", result

0 comments on commit 7a997a6

Please sign in to comment.