Skip to content

Commit

Permalink
cleanup unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
a-dubs committed Feb 27, 2025
1 parent f982183 commit 3a94f04
Showing 1 changed file with 5 additions and 30 deletions.
35 changes: 5 additions & 30 deletions tests/unittests/sources/test_oracle.py
Original file line number Diff line number Diff line change
Expand Up @@ -1706,22 +1706,6 @@ def test_get_versioned_metadata_base_url(
)


###############################################################################
###############################################################################
##################### NETPLAN V2 MIGRATION TESTING BELOW ######################
###############################################################################
###############################################################################


def move_version_to_beggining_of_nteplan_yaml_str(yaml_str: str) -> str:
version_line = [
line for line in yaml_str.split("\n") if "version:" in line
][0]
lines = [line for line in yaml_str.split("\n") if "version:" not in line]
lines.insert(1, version_line)
return "\n".join(lines)


logger = logging.getLogger(__name__)


Expand Down Expand Up @@ -1842,12 +1826,6 @@ def test_convert_v1_netplan_to_v2_no_network_key_in_output(self):
assert result == {"network": mock_output}


##############################################################################
## Validating neplan v1 vs v2
##############################################################################


# VNIC Data:
ipv6_only_single_nic_imds_data = [
{
"ipv6Addresses": ["2603:c020:400d:5d7e:193:941a:fd48:f87f"],
Expand All @@ -1859,7 +1837,6 @@ def test_convert_v1_netplan_to_v2_no_network_key_in_output(self):
}
]

# Netplan Config:
ipv6_only_single_nic_netplan_output = """
network:
version: 2
Expand All @@ -1872,12 +1849,6 @@ def test_convert_v1_netplan_to_v2_no_network_key_in_output(self):
mtu: 9000
""".strip()

interfaces_by_mac = {
"01:23:45:67:89:ab": "eth_0",
"ba:98:76:54:32:10": "eth_1",
}


ipv6_2_imds_data = [
{
"ipv6Addresses": ["2603:c020:400d:5d7e:193:941a:fd48:f87f"],
Expand Down Expand Up @@ -1917,7 +1888,6 @@ def test_convert_v1_netplan_to_v2_no_network_key_in_output(self):
mtu: 9000
""".strip()


dual_stack_2_nics_imds_data = [
{
"ipv6Addresses": ["2603:c020:400d:5dbb:ca1d:a563:5e98:719e"],
Expand Down Expand Up @@ -1963,6 +1933,11 @@ def test_convert_v1_netplan_to_v2_no_network_key_in_output(self):
mtu: 9000
""".strip()

interfaces_by_mac = {
"01:23:45:67:89:ab": "eth_0",
"ba:98:76:54:32:10": "eth_1",
}


@mock.patch(
DS_PATH + ".get_interfaces_by_mac",
Expand Down

0 comments on commit 3a94f04

Please sign in to comment.