#2887 - Test changes to correct NodeOperatingState is correct per passed config.
This commit is contained in:
@@ -20,11 +20,11 @@ from primaite.simulator.system.software import SoftwareHealthState
|
||||
@pytest.fixture(scope="function")
|
||||
def peer_to_peer() -> Tuple[Computer, Computer]:
|
||||
network = Network()
|
||||
node_a = Computer(hostname="node_a", ip_address="192.168.0.10", subnet_mask="255.255.255.0", start_up_duration=0)
|
||||
node_a: Computer = Computer.from_config(config={"type":"computer", "hostname":"node_a", "ip_address":"192.168.0.10", "subnet_mask":"255.255.255.0", "start_up_duration":0})
|
||||
node_a.power_on()
|
||||
node_a.software_manager.get_open_ports()
|
||||
|
||||
node_b = Computer(hostname="node_b", ip_address="192.168.0.11", subnet_mask="255.255.255.0", start_up_duration=0)
|
||||
node_b: Computer = Computer.from_config(config={"type":"computer", "hostname":"node_b", "ip_address":"192.168.0.11", "subnet_mask":"255.255.255.0", "start_up_duration":0})
|
||||
node_b.power_on()
|
||||
network.connect(node_a.network_interface[1], node_b.network_interface[1])
|
||||
|
||||
@@ -412,8 +412,8 @@ def test_database_service_can_terminate_connection(peer_to_peer):
|
||||
def test_client_connection_terminate_does_not_terminate_another_clients_connection():
|
||||
network = Network()
|
||||
|
||||
db_server = Server(
|
||||
hostname="db_client", ip_address="192.168.0.11", subnet_mask="255.255.255.0", start_up_duration=0
|
||||
db_server: Server = Server.from_config(config={"type":"server",
|
||||
"hostname":"db_client", "ip_address":"192.168.0.11", "subnet_mask":"255.255.255.0", "start_up_duration":0}
|
||||
)
|
||||
db_server.power_on()
|
||||
|
||||
@@ -465,6 +465,6 @@ def test_client_connection_terminate_does_not_terminate_another_clients_connecti
|
||||
|
||||
|
||||
def test_database_server_install_ftp_client():
|
||||
server = Server(hostname="db_server", ip_address="192.168.1.2", subnet_mask="255.255.255.0", start_up_duration=0)
|
||||
server: Server = Server.from_config(config={"type":"server", "hostname":"db_server", "ip_address":"192.168.1.2", "subnet_mask":"255.255.255.0", "start_up_duration":0})
|
||||
server.software_manager.install(DatabaseService)
|
||||
assert server.software_manager.software.get("FTPClient")
|
||||
|
||||
Reference in New Issue
Block a user