#1522: added a check for existing links in laydown + test that checks if red agent instructions are random

This commit is contained in:
Czar Echavez
2023-07-03 09:46:52 +01:00
parent 3e691b4f46
commit 4299170ce4
2 changed files with 24 additions and 18 deletions

View File

@@ -1265,6 +1265,12 @@ class Primaite(Env):
# Bandwidth for all links
bandwidths = [i.get_bandwidth() for i in list(self.links.values())]
if len(bandwidths) < 1:
msg = "Random red agent cannot be used on a network without any links"
_LOGGER.error(msg)
raise Exception(msg)
servers = [node for node in node_list if node.node_type == NodeType.SERVER]
for n, node in enumerate(nodes_to_be_compromised):