Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enforce fixture events order #3132

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion lib/mix/tasks/dump_scenario.ex
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ defmodule Mix.Tasks.DumpScenario do
events = Discovery.get_current_discovery_events()

Enum.map(events, fn %DiscoveryEvent{
id: id,
agent_id: agent_id,
discovery_type: discovery_type,
payload: payload
Expand All @@ -72,8 +73,10 @@ defmodule Mix.Tasks.DumpScenario do
scenario_path = Path.join(path, scenario_name)
File.mkdir_p!(scenario_path)

index = id |> Integer.to_string() |> String.pad_leading(4, "0")

scenario_path
|> Path.join("#{agent_id}_#{discovery_type}.json")
|> Path.join("#{index}_#{agent_id}_#{discovery_type}.json")
|> File.write!(data)
end)
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,21 @@
{
"agent_id": "098fc159-3ed6-58e7-91be-38fda8a833ea",
"discovery_type": "host_discovery",
"payload": {
"hostname": "vmnwqas03",
"agent_version": "2.1.0",
"cpu_count": 2,
"os_version": "15-SP3",
"fully_qualified_domain_name": "vmnwqas03.l15cqsinwnpu5gfyrf1r5l51fe.ax.internal.cloudapp.net",
"hostname": "vmnwqas03",
"ip_addresses": [
"127.0.0.1",
"::1",
"10.90.1.27",
"10.90.1.23",
"fe80::6245:bdff:fe8d:5d9"
],
"netmasks": [
"8",
"128",
"24",
"24",
"64"
],
"netmasks": ["8", "128", "24", "24", "64"],
"os_version": "15-SP3",
"socket_count": 1,
"agent_version": "2.1.0",
"total_memory_mb": 7951,
"fully_qualified_domain_name": "vmnwqas03.l15cqsinwnpu5gfyrf1r5l51fe.ax.internal.cloudapp.net"
}
"total_memory_mb": 7951
},
"discovery_type": "host_discovery",
"agent_id": "098fc159-3ed6-58e7-91be-38fda8a833ea"
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"discovery_type": "saptune_discovery",
"agent_id": "21de186a-e38f-5804-b643-7f4ef22fecfd",
"payload": {
"saptune_installed": true,
"package_version": "3.0.0",
"saptune_installed": true,
"status": null
}
}
},
"discovery_type": "saptune_discovery",
"agent_id": "098fc159-3ed6-58e7-91be-38fda8a833ea"
}
Original file line number Diff line number Diff line change
@@ -1,48 +1,48 @@
{
"agent_id": "81e9b629-c1e7-538f-bff1-47d3a6580522",
"discovery_type": "subscription_discovery",
"payload": [
{
"arch": "x86_64",
"identifier": "SLES_SAP",
"status": "Not Registered",
"version": "15.3",
"identifier": "SLES_SAP"
"version": "15.3"
},
{
"arch": "x86_64",
"identifier": "sle-module-basesystem",
"status": "Not Registered",
"version": "15.3",
"identifier": "sle-module-basesystem"
"version": "15.3"
},
{
"arch": "x86_64",
"identifier": "sle-module-desktop-applications",
"status": "Not Registered",
"version": "15.3",
"identifier": "sle-module-desktop-applications"
"version": "15.3"
},
{
"arch": "x86_64",
"identifier": "sle-module-server-applications",
"status": "Not Registered",
"version": "15.3",
"identifier": "sle-module-server-applications"
"version": "15.3"
},
{
"arch": "x86_64",
"identifier": "sle-ha",
"status": "Not Registered",
"version": "15.3",
"identifier": "sle-ha"
"version": "15.3"
},
{
"arch": "x86_64",
"identifier": "sle-module-sap-applications",
"status": "Not Registered",
"version": "15.3",
"identifier": "sle-module-sap-applications"
"version": "15.3"
},
{
"arch": "x86_64",
"identifier": "sle-module-public-cloud",
"status": "Not Registered",
"version": "15.3",
"identifier": "sle-module-public-cloud"
"version": "15.3"
}
]
],
"discovery_type": "subscription_discovery",
"agent_id": "098fc159-3ed6-58e7-91be-38fda8a833ea"
}
Loading
Loading