#2888: Fix merge test failures.

This commit is contained in:
Nick Todd
2025-01-16 16:32:55 +00:00
parent 1fe0aea48d
commit dff976b336
6 changed files with 15 additions and 13 deletions

View File

@@ -376,7 +376,7 @@ class PrimaiteGame:
if service_class is not None: if service_class is not None:
_LOGGER.debug(f"installing {service_type} on node {new_node.hostname}") _LOGGER.debug(f"installing {service_type} on node {new_node.hostname}")
new_node.software_manager.install(service_class, **service_cfg.get("options", {})) new_node.software_manager.install(service_class)
new_service = new_node.software_manager.software[service_class.__name__] new_service = new_node.software_manager.software[service_class.__name__]
# fixing duration for the service # fixing duration for the service

View File

@@ -30,6 +30,7 @@ class DatabaseService(Service, identifier="DatabaseService"):
"""ConfigSchema for DatabaseService.""" """ConfigSchema for DatabaseService."""
type: str = "DatabaseService" type: str = "DatabaseService"
backup_server_ip: Optional[IPv4Address] = None
config: "DatabaseService.ConfigSchema" = Field(default_factory=lambda: DatabaseService.ConfigSchema()) config: "DatabaseService.ConfigSchema" = Field(default_factory=lambda: DatabaseService.ConfigSchema())
@@ -51,6 +52,7 @@ class DatabaseService(Service, identifier="DatabaseService"):
kwargs["protocol"] = PROTOCOL_LOOKUP["TCP"] kwargs["protocol"] = PROTOCOL_LOOKUP["TCP"]
super().__init__(**kwargs) super().__init__(**kwargs)
self._create_db_file() self._create_db_file()
self.backup_server_ip = self.config.backup_server_ip
def install(self): def install(self):
""" """

View File

@@ -21,6 +21,7 @@ class DNSServer(Service, identifier="DNSServer"):
"""ConfigSchema for DNSServer.""" """ConfigSchema for DNSServer."""
type: str = "DNSServer" type: str = "DNSServer"
domain_mapping: dict = {}
config: "DNSServer.ConfigSchema" = Field(default_factory=lambda: DNSServer.ConfigSchema()) config: "DNSServer.ConfigSchema" = Field(default_factory=lambda: DNSServer.ConfigSchema())

View File

@@ -588,9 +588,9 @@ simulation:
default_gateway: 192.168.1.1 default_gateway: 192.168.1.1
services: services:
- type: DNSServer - type: DNSServer
options: # options:
domain_mapping: # domain_mapping:
arcd.com: 192.168.1.12 # web server # arcd.com: 192.168.1.12 # web server
- type: server - type: server
hostname: web_server hostname: web_server

View File

@@ -1380,9 +1380,9 @@ simulation:
default_gateway: 192.168.1.1 default_gateway: 192.168.1.1
services: services:
- type: DNSServer - type: DNSServer
options: # options:
domain_mapping: # domain_mapping:
arcd.com: 192.168.1.12 # web server # arcd.com: 192.168.1.12 # web server
- hostname: web_server - hostname: web_server
type: server type: server

View File

@@ -496,12 +496,11 @@ def test_c2_suite_yaml():
computer_b: Computer = yaml_network.get_node_by_hostname("node_b") computer_b: Computer = yaml_network.get_node_by_hostname("node_b")
c2_beacon: C2Beacon = computer_b.software_manager.software.get("C2Beacon") c2_beacon: C2Beacon = computer_b.software_manager.software.get("C2Beacon")
c2_beacon.configure( c2_beacon.configure(
c2_server_ip_address=c2_beacon.config.c2_server_ip_address, c2_server_ip_address=c2_beacon.config.c2_server_ip_address,
keep_alive_frequency=c2_beacon.config.keep_alive_frequency, keep_alive_frequency=c2_beacon.config.keep_alive_frequency,
masquerade_port=c2_beacon.config.masquerade_port, masquerade_port=c2_beacon.config.masquerade_port,
masquerade_protocol=c2_beacon.config.masquerade_protocol, masquerade_protocol=c2_beacon.config.masquerade_protocol,
) )
assert c2_server.operating_state == ApplicationOperatingState.RUNNING assert c2_server.operating_state == ApplicationOperatingState.RUNNING