#2887 - Test fixes

This commit is contained in:
Charlie Crane
2025-01-31 18:46:02 +00:00
parent 3d47b9c863
commit d806391625
4 changed files with 5 additions and 4 deletions

View File

@@ -130,6 +130,7 @@ class WirelessRouter(Router, identifier="wireless_router"):
hostname: str = "WirelessRouter"
airspace: AirSpace
num_ports: int = 0
def __init__(self, **kwargs):
super().__init__(**kwargs)

View File

@@ -25,7 +25,7 @@ def check_default_rules(acl_obs):
def test_firewall_observation():
"""Test adding/removing acl rules and enabling/disabling ports."""
net = Network()
firewall_cfg = {"type": "firewall", "hostname": "firewall", "opertating_state": NodeOperatingState.ON}
firewall_cfg = {"type": "firewall", "hostname": "firewall"}
firewall = Firewall.from_config(config=firewall_cfg)
firewall_observation = FirewallObservation(
where=[],
@@ -118,7 +118,7 @@ def test_firewall_observation():
# connect a switch to the firewall and check that only the correct port is updated
switch: Switch = Switch.from_config(
config={"type": "switch", "hostname": "switch", "num_ports": 1, "operating_state": NodeOperatingState.ON}
config={"type": "switch", "hostname": "switch", "num_ports": 1, "operating_state": "ON"}
)
link = net.connect(firewall.network_interface[1], switch.network_interface[1])
assert firewall.network_interface[1].enabled

View File

@@ -62,7 +62,7 @@ def peer_to_peer_secure_db(peer_to_peer) -> Tuple[Computer, Computer]:
database_service: DatabaseService = node_b.software_manager.software["DatabaseService"] # noqa
database_service.stop()
database_service.password = "12345"
database_service.config.db_password = "12345"
database_service.start()
return node_a, node_b