Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lots of small fixes to tests and ci stuff #33

Merged
merged 13 commits into from
Feb 24, 2021
Merged
8 changes: 4 additions & 4 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ clone:

matrix:
PYTHON_VERSION:
# yes py35 is eol, but tinkerbell/osie still uses old ubuntu and py3.5... sigh
- 3.5
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the version of python osie is running still uses 3.5 :/

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wat

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wow we need to update those containers already

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

put it back and added a comment

- 3.6
- 3.7
Expand All @@ -12,11 +13,10 @@ matrix:

pipeline:
fmt_and_lint:
image: python:3.8-alpine
image: nixos/nix:2.3.6
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i feel this over complicates the build process as well as gives the assumption that you need nix to run these tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can make clear that we don't require nix to run the tests? It does neatly pin the black/pylama(and co) versions which is nice for CI.

commands:
- pip install black==19.3b0 pylama
- black --check --diff .
- pylama --ignore=E203 packetnetworking setup.py
- nix-shell --run "black --check --diff ."
- nix-shell --run "pylama packetnetworking setup.py"

test:
image: python:${PYTHON_VERSION}
Expand Down
2 changes: 2 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
has nix && use nix
dotenv_if_exists
1 change: 0 additions & 1 deletion packetnetworking/distros/debian/bonded.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from ...utils import generate_persistent_names


# pylama:ignore=E501
class DebianBondedNetwork(NetworkBuilder):
def build(self):
if self.network.bonding.link_aggregation in ["bonded", "mlag_ha"]:
Expand Down
1 change: 0 additions & 1 deletion packetnetworking/distros/debian/individual.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from ...utils import generate_persistent_names


# pylama:ignore=E501
class DebianIndividualNetwork(NetworkBuilder):
def build(self):
if self.network.bonding.link_aggregation == "individual":
Expand Down
6 changes: 2 additions & 4 deletions packetnetworking/distros/debian/test_debian_10_bonded.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ def test_debian_10_public_bonded_task_etc_network_interfaces(debian_10_bonded_ne
assert tasks["etc/network/interfaces"] == result


# pylama:ignore=E501
def test_debian_10_private_bonded_task_etc_network_interfaces(debian_10_bonded_network):
"""
When no public ip is assigned, we should see the private ip details in the
Expand Down Expand Up @@ -96,7 +95,7 @@ def test_debian_10_private_bonded_task_etc_network_interfaces(debian_10_bonded_n


def test_debian_10_public_bonded_task_etc_network_interfaces_with_custom_private_ip_space(
debian_10_bonded_network
debian_10_bonded_network,
):
"""Validates /etc/network/interfaces for a public bond"""
subnets = {"private_subnets": ["192.168.5.0/24", "172.16.0.0/12"]}
Expand Down Expand Up @@ -147,7 +146,7 @@ def test_debian_10_public_bonded_task_etc_network_interfaces_with_custom_private


def test_debian_10_private_bonded_task_etc_network_interfaces_with_custom_private_ip_space(
debian_10_bonded_network
debian_10_bonded_network,
):
"""
When no public ip is assigned, we should see the private ip details in the
Expand Down Expand Up @@ -250,7 +249,6 @@ def test_debian_10_etc_hosts_configured(debian_10_bonded_network):
assert tasks["etc/hosts"] == result


# pylama:ignore=E501
def test_debian_10_persistent_interface_names(debian_10_bonded_network):
"""
When using certain operating systems, we want to bypass driver interface name,
Expand Down
10 changes: 4 additions & 6 deletions packetnetworking/distros/debian/test_debian_10_individual.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def _builder(**kwargs):


def test_debian_10_public_individual_task_etc_network_interfaces(
debian_10_individual_network
debian_10_individual_network,
):
"""Validates /etc/network/interfaces for a public bond"""

Expand Down Expand Up @@ -52,7 +52,7 @@ def test_debian_10_public_individual_task_etc_network_interfaces(


def test_debian_10_private_individual_task_etc_network_interfaces(
debian_10_individual_network
debian_10_individual_network,
):
"""
When no public ip is assigned, we should see the private ip details in the
Expand Down Expand Up @@ -82,9 +82,8 @@ def test_debian_10_private_individual_task_etc_network_interfaces(
assert tasks["etc/network/interfaces"] == result


# pylama:ignore=E501
def test_debian_10_public_individual_task_etc_network_interfaces_with_custom_private_ip_space(
debian_10_individual_network
debian_10_individual_network,
):
"""Validates /etc/network/interfaces for a public bond"""
subnets = {"private_subnets": ["192.168.5.0/24", "172.16.0.0/12"]}
Expand Down Expand Up @@ -127,7 +126,7 @@ def test_debian_10_public_individual_task_etc_network_interfaces_with_custom_pri


def test_debian_10_private_individual_task_etc_network_interfaces_with_custom_private_ip_space(
debian_10_individual_network
debian_10_individual_network,
):
"""
When no public ip is assigned, we should see the private ip details in the
Expand Down Expand Up @@ -209,7 +208,6 @@ def test_debian_10_etc_hosts_configured(debian_10_individual_network):
assert tasks["etc/hosts"] == result


# pylama:ignore=E501
def test_debian_10_persistent_interface_names(debian_10_individual_network):
"""
When using certain operating systems, we want to bypass driver interface name,
Expand Down
6 changes: 2 additions & 4 deletions packetnetworking/distros/debian/test_debian_11_bonded.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ def test_debian_11_public_bonded_task_etc_network_interfaces(debian_11_bonded_ne
assert tasks["etc/network/interfaces"] == result


# pylama:ignore=E501
def test_debian_11_private_bonded_task_etc_network_interfaces(debian_11_bonded_network):
"""
When no public ip is assigned, we should see the private ip details in the
Expand Down Expand Up @@ -96,7 +95,7 @@ def test_debian_11_private_bonded_task_etc_network_interfaces(debian_11_bonded_n


def test_debian_11_public_bonded_task_etc_network_interfaces_with_custom_private_ip_space(
debian_11_bonded_network
debian_11_bonded_network,
):
"""Validates /etc/network/interfaces for a public bond"""
subnets = {"private_subnets": ["192.168.5.0/24", "172.16.0.0/12"]}
Expand Down Expand Up @@ -147,7 +146,7 @@ def test_debian_11_public_bonded_task_etc_network_interfaces_with_custom_private


def test_debian_11_private_bonded_task_etc_network_interfaces_with_custom_private_ip_space(
debian_11_bonded_network
debian_11_bonded_network,
):
"""
When no public ip is assigned, we should see the private ip details in the
Expand Down Expand Up @@ -250,7 +249,6 @@ def test_debian_11_etc_hosts_configured(debian_11_bonded_network):
assert tasks["etc/hosts"] == result


# pylama:ignore=E501
def test_debian_11_persistent_interface_names(debian_11_bonded_network):
"""
When using certain operating systems, we want to bypass driver interface name,
Expand Down
10 changes: 4 additions & 6 deletions packetnetworking/distros/debian/test_debian_11_individual.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def _builder(**kwargs):


def test_debian_11_public_individual_task_etc_network_interfaces(
debian_11_individual_network
debian_11_individual_network,
):
"""Validates /etc/network/interfaces for a public bond"""

Expand Down Expand Up @@ -52,7 +52,7 @@ def test_debian_11_public_individual_task_etc_network_interfaces(


def test_debian_11_private_individual_task_etc_network_interfaces(
debian_11_individual_network
debian_11_individual_network,
):
"""
When no public ip is assigned, we should see the private ip details in the
Expand Down Expand Up @@ -82,9 +82,8 @@ def test_debian_11_private_individual_task_etc_network_interfaces(
assert tasks["etc/network/interfaces"] == result


# pylama:ignore=E501
def test_debian_11_public_individual_task_etc_network_interfaces_with_custom_private_ip_space(
debian_11_individual_network
debian_11_individual_network,
):
"""Validates /etc/network/interfaces for a public bond"""
subnets = {"private_subnets": ["192.168.5.0/24", "172.16.0.0/12"]}
Expand Down Expand Up @@ -127,7 +126,7 @@ def test_debian_11_public_individual_task_etc_network_interfaces_with_custom_pri


def test_debian_11_private_individual_task_etc_network_interfaces_with_custom_private_ip_space(
debian_11_individual_network
debian_11_individual_network,
):
"""
When no public ip is assigned, we should see the private ip details in the
Expand Down Expand Up @@ -209,7 +208,6 @@ def test_debian_11_etc_hosts_configured(debian_11_individual_network):
assert tasks["etc/hosts"] == result


# pylama:ignore=E501
def test_debian_11_persistent_interface_names(debian_11_individual_network):
"""
When using certain operating systems, we want to bypass driver interface name,
Expand Down
5 changes: 2 additions & 3 deletions packetnetworking/distros/debian/test_debian_7_bonded.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,8 @@ def test_debian_7_private_bonded_task_etc_network_interfaces(debian_7_bonded_net
assert tasks["etc/network/interfaces"] == result


# pylama:ignore=E501
def test_debian_7_public_bonded_task_etc_network_interfaces_with_custom_private_ip_space(
debian_7_bonded_network
debian_7_bonded_network,
):
"""Validates /etc/network/interfaces for a public bond"""
subnets = {"private_subnets": ["192.168.5.0/24", "172.16.0.0/12"]}
Expand Down Expand Up @@ -147,7 +146,7 @@ def test_debian_7_public_bonded_task_etc_network_interfaces_with_custom_private_


def test_debian_7_private_bonded_task_etc_network_interfaces_with_custom_private_ip_space(
debian_7_bonded_network
debian_7_bonded_network,
):
"""
When no public ip is assigned, we should see the private ip details in the
Expand Down
9 changes: 4 additions & 5 deletions packetnetworking/distros/debian/test_debian_7_individual.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def _builder(**kwargs):


def test_debian_7_public_individual_task_etc_network_interfaces(
debian_7_individual_network
debian_7_individual_network,
):
"""Validates /etc/network/interfaces for a public bond"""

Expand Down Expand Up @@ -52,7 +52,7 @@ def test_debian_7_public_individual_task_etc_network_interfaces(


def test_debian_7_private_individual_task_etc_network_interfaces(
debian_7_individual_network
debian_7_individual_network,
):
"""
When no public ip is assigned, we should see the private ip details in the
Expand Down Expand Up @@ -82,9 +82,8 @@ def test_debian_7_private_individual_task_etc_network_interfaces(
assert tasks["etc/network/interfaces"] == result


# pylama:ignore=E501
def test_debian_7_public_individual_task_etc_network_interfaces_with_custom_private_ip_space(
debian_7_individual_network
debian_7_individual_network,
):
"""Validates /etc/network/interfaces for a public bond"""
subnets = {"private_subnets": ["192.168.5.0/24", "172.16.0.0/12"]}
Expand Down Expand Up @@ -127,7 +126,7 @@ def test_debian_7_public_individual_task_etc_network_interfaces_with_custom_priv


def test_debian_7_private_individual_task_etc_network_interfaces_with_custom_private_ip_space(
debian_7_individual_network
debian_7_individual_network,
):
"""
When no public ip is assigned, we should see the private ip details in the
Expand Down
5 changes: 2 additions & 3 deletions packetnetworking/distros/debian/test_debian_8_bonded.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,8 @@ def test_debian_8_private_bonded_task_etc_network_interfaces(debian_8_bonded_net
assert tasks["etc/network/interfaces"] == result


# pylama:ignore=E501
def test_debian_8_public_bonded_task_etc_network_interfaces_with_custom_private_ip_space(
debian_8_bonded_network
debian_8_bonded_network,
):
"""Validates /etc/network/interfaces for a public bond"""
subnets = {"private_subnets": ["192.168.5.0/24", "172.16.0.0/12"]}
Expand Down Expand Up @@ -147,7 +146,7 @@ def test_debian_8_public_bonded_task_etc_network_interfaces_with_custom_private_


def test_debian_8_private_bonded_task_etc_network_interfaces_with_custom_private_ip_space(
debian_8_bonded_network
debian_8_bonded_network,
):
"""
When no public ip is assigned, we should see the private ip details in the
Expand Down
9 changes: 4 additions & 5 deletions packetnetworking/distros/debian/test_debian_8_individual.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def _builder(**kwargs):


def test_debian_8_public_individual_task_etc_network_interfaces(
debian_8_individual_network
debian_8_individual_network,
):
"""Validates /etc/network/interfaces for a public bond"""

Expand Down Expand Up @@ -52,7 +52,7 @@ def test_debian_8_public_individual_task_etc_network_interfaces(


def test_debian_8_private_individual_task_etc_network_interfaces(
debian_8_individual_network
debian_8_individual_network,
):
"""
When no public ip is assigned, we should see the private ip details in the
Expand Down Expand Up @@ -82,9 +82,8 @@ def test_debian_8_private_individual_task_etc_network_interfaces(
assert tasks["etc/network/interfaces"] == result


# pylama:ignore=E501
def test_debian_8_public_individual_task_etc_network_interfaces_with_custom_private_ip_space(
debian_8_individual_network
debian_8_individual_network,
):
"""Validates /etc/network/interfaces for a public bond"""
subnets = {"private_subnets": ["192.168.5.0/24", "172.16.0.0/12"]}
Expand Down Expand Up @@ -127,7 +126,7 @@ def test_debian_8_public_individual_task_etc_network_interfaces_with_custom_priv


def test_debian_8_private_individual_task_etc_network_interfaces_with_custom_private_ip_space(
debian_8_individual_network
debian_8_individual_network,
):
"""
When no public ip is assigned, we should see the private ip details in the
Expand Down
5 changes: 2 additions & 3 deletions packetnetworking/distros/debian/test_debian_9_bonded.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,8 @@ def test_debian_9_private_bonded_task_etc_network_interfaces(debian_9_bonded_net
assert tasks["etc/network/interfaces"] == result


# pylama:ignore=E501
def test_debian_9_public_bonded_task_etc_network_interfaces_with_custom_private_ip_space(
debian_9_bonded_network
debian_9_bonded_network,
):
"""Validates /etc/network/interfaces for a public bond"""
subnets = {"private_subnets": ["192.168.5.0/24", "172.16.0.0/12"]}
Expand Down Expand Up @@ -147,7 +146,7 @@ def test_debian_9_public_bonded_task_etc_network_interfaces_with_custom_private_


def test_debian_9_private_bonded_task_etc_network_interfaces_with_custom_private_ip_space(
debian_9_bonded_network
debian_9_bonded_network,
):
"""
When no public ip is assigned, we should see the private ip details in the
Expand Down
9 changes: 4 additions & 5 deletions packetnetworking/distros/debian/test_debian_9_individual.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def _builder(**kwargs):


def test_debian_9_public_individual_task_etc_network_interfaces(
debian_9_individual_network
debian_9_individual_network,
):
"""Validates /etc/network/interfaces for a public bond"""

Expand Down Expand Up @@ -52,7 +52,7 @@ def test_debian_9_public_individual_task_etc_network_interfaces(


def test_debian_9_private_individual_task_etc_network_interfaces(
debian_9_individual_network
debian_9_individual_network,
):
"""
When no public ip is assigned, we should see the private ip details in the
Expand Down Expand Up @@ -82,9 +82,8 @@ def test_debian_9_private_individual_task_etc_network_interfaces(
assert tasks["etc/network/interfaces"] == result


# pylama:ignore=E501
def test_debian_9_public_individual_task_etc_network_interfaces_with_custom_private_ip_space(
debian_9_individual_network
debian_9_individual_network,
):
"""Validates /etc/network/interfaces for a public bond"""
subnets = {"private_subnets": ["192.168.5.0/24", "172.16.0.0/12"]}
Expand Down Expand Up @@ -127,7 +126,7 @@ def test_debian_9_public_individual_task_etc_network_interfaces_with_custom_priv


def test_debian_9_private_individual_task_etc_network_interfaces_with_custom_private_ip_space(
debian_9_individual_network
debian_9_individual_network,
):
"""
When no public ip is assigned, we should see the private ip details in the
Expand Down
Loading