#3062 - Remove discriminators from abstract classes and fix remaining old discriminator names

This commit is contained in:
Marek Wolan
2025-02-05 10:12:13 +00:00
parent 0a6b604afd
commit 4a472c5c75
28 changed files with 55 additions and 79 deletions

View File

@@ -678,8 +678,8 @@ def test_firewall_acl_add_remove_rule_integration():
assert firewall.external_outbound_acl.acl[1].action.name == "DENY"
assert firewall.external_outbound_acl.acl[1].src_ip_address == IPv4Address("192.168.20.10")
assert firewall.external_outbound_acl.acl[1].dst_ip_address == IPv4Address("192.168.0.10")
assert firewall.external_outbound_acl.acl[1].dst_port == PORT_LOOKUP["NONE"]
assert firewall.external_outbound_acl.acl[1].src_port == PORT_LOOKUP["NONE"]
assert firewall.external_outbound_acl.acl[1].dst_port is None
assert firewall.external_outbound_acl.acl[1].src_port is None
assert firewall.external_outbound_acl.acl[1].protocol == PROTOCOL_LOOKUP["NONE"]
env.step(12) # Remove ACL rule from External Outbound

View File

@@ -27,7 +27,7 @@ class BroadcastTestService(Service, discriminator="broadcast-test-service"):
def __init__(self, **kwargs):
# Set default service properties for broadcasting
kwargs["name"] = "BroadcastService"
kwargs["name"] = "broadcast-test-service"
kwargs["port"] = PORT_LOOKUP["HTTP"]
kwargs["protocol"] = PROTOCOL_LOOKUP["TCP"]
super().__init__(**kwargs)
@@ -127,7 +127,7 @@ def broadcast_network() -> Network:
server_1.power_on()
server_1.software_manager.install(BroadcastTestService)
service: BroadcastTestService = server_1.software_manager.software["BroadcastService"]
service: BroadcastTestService = server_1.software_manager.software["broadcast-test-service"]
service.start()
switch_1: Switch = Switch.from_config(
@@ -153,7 +153,7 @@ def broadcast_service_and_clients(
"broadcast-test-client"
]
service: BroadcastTestService = broadcast_network.get_node_by_hostname("server_1").software_manager.software[
"broadcast-service"
"broadcast-test-service"
]
return service, client_1, client_2

View File

@@ -22,7 +22,7 @@ class _DatabaseListener(Service, discriminator="database-listener"):
listen_on_ports: Set[int] = {PORT_LOOKUP["POSTGRES_SERVER"]}
config: "_DatabaseListener.ConfigSchema" = Field(default_factory=lambda: _DatabaseListener.ConfigSchema())
name: str = "DatabaseListener"
name: str = "database-listener"
protocol: str = PROTOCOL_LOOKUP["TCP"]
port: int = PORT_LOOKUP["NONE"]
listen_on_ports: Set[int] = {PORT_LOOKUP["POSTGRES_SERVER"]}
@@ -45,7 +45,7 @@ def test_http_listener(client_server):
server_db.start()
server.software_manager.install(_DatabaseListener)
server_db_listener: _DatabaseListener = server.software_manager.software["DatabaseListener"]
server_db_listener: _DatabaseListener = server.software_manager.software["database-listener"]
server_db_listener.start()
computer.software_manager.install(DatabaseClient)