From 91d95dcd5244675955db895d4673d13b89b3456a Mon Sep 17 00:00:00 2001 From: Federico Mastellone Date: Wed, 2 Oct 2024 13:09:20 +0000 Subject: [PATCH] WIP: topology projection-for TestSuite --- bench/cardano-topology/cardano-topology.cabal | 3 +- .../data/test/ci-test-coay/node-0.json | 9 + .../data/test/ci-test-coay/node-1.json | 9 + .../data/test/ci-test-coay/topology.json | 27 + .../value-volt-nomadperf-coay/explorer.json | 264 +++++ .../value-volt-nomadperf-coay/node-0.json | 66 ++ .../value-volt-nomadperf-coay/node-1.json | 66 ++ .../value-volt-nomadperf-coay/node-10.json | 66 ++ .../value-volt-nomadperf-coay/node-11.json | 66 ++ .../value-volt-nomadperf-coay/node-2.json | 66 ++ .../value-volt-nomadperf-coay/node-3.json | 66 ++ .../value-volt-nomadperf-coay/node-4.json | 66 ++ .../value-volt-nomadperf-coay/node-5.json | 66 ++ .../value-volt-nomadperf-coay/node-6.json | 66 ++ .../value-volt-nomadperf-coay/node-7.json | 66 ++ .../value-volt-nomadperf-coay/node-8.json | 66 ++ .../value-volt-nomadperf-coay/node-9.json | 66 ++ .../value-volt-nomadperf-coay/topology.json | 900 ++++++++++++++++++ .../Benchmarking/Topology/Projection/Tests.hs | 102 ++ bench/cardano-topology/test/Main.hs | 2 + 20 files changed, 2107 insertions(+), 1 deletion(-) create mode 100644 bench/cardano-topology/data/test/ci-test-coay/node-0.json create mode 100644 bench/cardano-topology/data/test/ci-test-coay/node-1.json create mode 100644 bench/cardano-topology/data/test/ci-test-coay/topology.json create mode 100644 bench/cardano-topology/data/test/value-volt-nomadperf-coay/explorer.json create mode 100644 bench/cardano-topology/data/test/value-volt-nomadperf-coay/node-0.json create mode 100644 bench/cardano-topology/data/test/value-volt-nomadperf-coay/node-1.json create mode 100644 bench/cardano-topology/data/test/value-volt-nomadperf-coay/node-10.json create mode 100644 bench/cardano-topology/data/test/value-volt-nomadperf-coay/node-11.json create mode 100644 bench/cardano-topology/data/test/value-volt-nomadperf-coay/node-2.json create mode 100644 bench/cardano-topology/data/test/value-volt-nomadperf-coay/node-3.json create mode 100644 bench/cardano-topology/data/test/value-volt-nomadperf-coay/node-4.json create mode 100644 bench/cardano-topology/data/test/value-volt-nomadperf-coay/node-5.json create mode 100644 bench/cardano-topology/data/test/value-volt-nomadperf-coay/node-6.json create mode 100644 bench/cardano-topology/data/test/value-volt-nomadperf-coay/node-7.json create mode 100644 bench/cardano-topology/data/test/value-volt-nomadperf-coay/node-8.json create mode 100644 bench/cardano-topology/data/test/value-volt-nomadperf-coay/node-9.json create mode 100644 bench/cardano-topology/data/test/value-volt-nomadperf-coay/topology.json create mode 100644 bench/cardano-topology/test/Cardano/Benchmarking/Topology/Projection/Tests.hs diff --git a/bench/cardano-topology/cardano-topology.cabal b/bench/cardano-topology/cardano-topology.cabal index 17a696bc201..16c54b82ed6 100644 --- a/bench/cardano-topology/cardano-topology.cabal +++ b/bench/cardano-topology/cardano-topology.cabal @@ -70,7 +70,8 @@ test-suite cardano-topology-test hs-source-dirs: test/ main-is: Main.hs type: exitcode-stdio-1.0 - other-modules: Paths_cardano_topology + other-modules: Cardano.Benchmarking.Topology.Projection.Tests + , Paths_cardano_topology autogen-modules: Paths_cardano_topology build-depends: base , aeson diff --git a/bench/cardano-topology/data/test/ci-test-coay/node-0.json b/bench/cardano-topology/data/test/ci-test-coay/node-0.json new file mode 100644 index 00000000000..2262d8255d6 --- /dev/null +++ b/bench/cardano-topology/data/test/ci-test-coay/node-0.json @@ -0,0 +1,9 @@ +{ + "Producers": [ + { + "addr": "127.0.0.1", + "port": 30001, + "valency": 1 + } + ] +} diff --git a/bench/cardano-topology/data/test/ci-test-coay/node-1.json b/bench/cardano-topology/data/test/ci-test-coay/node-1.json new file mode 100644 index 00000000000..099be543fc9 --- /dev/null +++ b/bench/cardano-topology/data/test/ci-test-coay/node-1.json @@ -0,0 +1,9 @@ +{ + "Producers": [ + { + "addr": "127.0.0.1", + "port": 30000, + "valency": 1 + } + ] +} diff --git a/bench/cardano-topology/data/test/ci-test-coay/topology.json b/bench/cardano-topology/data/test/ci-test-coay/topology.json new file mode 100644 index 00000000000..d58cb6575b2 --- /dev/null +++ b/bench/cardano-topology/data/test/ci-test-coay/topology.json @@ -0,0 +1,27 @@ +{ + "coreNodes": [ + { + "name": "node-0", + "nodeId": 0, + "org": "IOHK", + "pools": 1, + "producers": [ + "node-1" + ], + "region": "loopback", + "stakePool": true + }, + { + "name": "node-1", + "nodeId": 1, + "org": "IOHK", + "pools": 1, + "producers": [ + "node-0" + ], + "region": "loopback", + "stakePool": true + } + ], + "relayNodes": [] +} diff --git a/bench/cardano-topology/data/test/value-volt-nomadperf-coay/explorer.json b/bench/cardano-topology/data/test/value-volt-nomadperf-coay/explorer.json new file mode 100644 index 00000000000..f9541e5725a --- /dev/null +++ b/bench/cardano-topology/data/test/value-volt-nomadperf-coay/explorer.json @@ -0,0 +1,264 @@ +{ + "Producers": [ + { + "addr": "127.0.0.1", + "port": 30000, + "valency": 1 + }, + { + "addr": "127.0.0.1", + "port": 30001, + "valency": 1 + }, + { + "addr": "127.0.0.1", + "port": 30002, + "valency": 1 + }, + { + "addr": "127.0.0.1", + "port": 30003, + "valency": 1 + }, + { + "addr": "127.0.0.1", + "port": 30004, + "valency": 1 + }, + { + "addr": "127.0.0.1", + "port": 30005, + "valency": 1 + }, + { + "addr": "127.0.0.1", + "port": 30006, + "valency": 1 + }, + { + "addr": "127.0.0.1", + "port": 30007, + "valency": 1 + }, + { + "addr": "127.0.0.1", + "port": 30008, + "valency": 1 + }, + { + "addr": "127.0.0.1", + "port": 30009, + "valency": 1 + }, + { + "addr": "127.0.0.1", + "port": 30010, + "valency": 1 + }, + { + "addr": "127.0.0.1", + "port": 30011, + "valency": 1 + }, + { + "addr": "127.0.0.1", + "port": 30012, + "valency": 1 + }, + { + "addr": "127.0.0.1", + "port": 30013, + "valency": 1 + }, + { + "addr": "127.0.0.1", + "port": 30014, + "valency": 1 + }, + { + "addr": "127.0.0.1", + "port": 30015, + "valency": 1 + }, + { + "addr": "127.0.0.1", + "port": 30016, + "valency": 1 + }, + { + "addr": "127.0.0.1", + "port": 30017, + "valency": 1 + }, + { + "addr": "127.0.0.1", + "port": 30018, + "valency": 1 + }, + { + "addr": "127.0.0.1", + "port": 30019, + "valency": 1 + }, + { + "addr": "127.0.0.1", + "port": 30020, + "valency": 1 + }, + { + "addr": "127.0.0.1", + "port": 30021, + "valency": 1 + }, + { + "addr": "127.0.0.1", + "port": 30022, + "valency": 1 + }, + { + "addr": "127.0.0.1", + "port": 30023, + "valency": 1 + }, + { + "addr": "127.0.0.1", + "port": 30024, + "valency": 1 + }, + { + "addr": "127.0.0.1", + "port": 30025, + "valency": 1 + }, + { + "addr": "127.0.0.1", + "port": 30026, + "valency": 1 + }, + { + "addr": "127.0.0.1", + "port": 30027, + "valency": 1 + }, + { + "addr": "127.0.0.1", + "port": 30028, + "valency": 1 + }, + { + "addr": "127.0.0.1", + "port": 30029, + "valency": 1 + }, + { + "addr": "127.0.0.1", + "port": 30030, + "valency": 1 + }, + { + "addr": "127.0.0.1", + "port": 30031, + "valency": 1 + }, + { + "addr": "127.0.0.1", + "port": 30032, + "valency": 1 + }, + { + "addr": "127.0.0.1", + "port": 30033, + "valency": 1 + }, + { + "addr": "127.0.0.1", + "port": 30034, + "valency": 1 + }, + { + "addr": "127.0.0.1", + "port": 30035, + "valency": 1 + }, + { + "addr": "127.0.0.1", + "port": 30036, + "valency": 1 + }, + { + "addr": "127.0.0.1", + "port": 30037, + "valency": 1 + }, + { + "addr": "127.0.0.1", + "port": 30038, + "valency": 1 + }, + { + "addr": "127.0.0.1", + "port": 30039, + "valency": 1 + }, + { + "addr": "127.0.0.1", + "port": 30040, + "valency": 1 + }, + { + "addr": "127.0.0.1", + "port": 30041, + "valency": 1 + }, + { + "addr": "127.0.0.1", + "port": 30042, + "valency": 1 + }, + { + "addr": "127.0.0.1", + "port": 30043, + "valency": 1 + }, + { + "addr": "127.0.0.1", + "port": 30044, + "valency": 1 + }, + { + "addr": "127.0.0.1", + "port": 30045, + "valency": 1 + }, + { + "addr": "127.0.0.1", + "port": 30046, + "valency": 1 + }, + { + "addr": "127.0.0.1", + "port": 30047, + "valency": 1 + }, + { + "addr": "127.0.0.1", + "port": 30048, + "valency": 1 + }, + { + "addr": "127.0.0.1", + "port": 30049, + "valency": 1 + }, + { + "addr": "127.0.0.1", + "port": 30050, + "valency": 1 + }, + { + "addr": "127.0.0.1", + "port": 30051, + "valency": 1 + } + ] +} diff --git a/bench/cardano-topology/data/test/value-volt-nomadperf-coay/node-0.json b/bench/cardano-topology/data/test/value-volt-nomadperf-coay/node-0.json new file mode 100644 index 00000000000..3c4b1415bd5 --- /dev/null +++ b/bench/cardano-topology/data/test/value-volt-nomadperf-coay/node-0.json @@ -0,0 +1,66 @@ +{ + "localRoots": [ + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30001 + } + ], + "advertise": false, + "valency": 6 + }, + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30002 + } + ], + "advertise": false, + "valency": 6 + }, + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30003 + } + ], + "advertise": false, + "valency": 6 + }, + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30051 + } + ], + "advertise": false, + "valency": 6 + }, + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30018 + } + ], + "advertise": false, + "valency": 6 + }, + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30036 + } + ], + "advertise": false, + "valency": 6 + } + ], + "publicRoots": [], + "useLedgerAfterSlot": -1 +} diff --git a/bench/cardano-topology/data/test/value-volt-nomadperf-coay/node-1.json b/bench/cardano-topology/data/test/value-volt-nomadperf-coay/node-1.json new file mode 100644 index 00000000000..f4f1a1b145d --- /dev/null +++ b/bench/cardano-topology/data/test/value-volt-nomadperf-coay/node-1.json @@ -0,0 +1,66 @@ +{ + "localRoots": [ + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30002 + } + ], + "advertise": false, + "valency": 6 + }, + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30000 + } + ], + "advertise": false, + "valency": 6 + }, + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30004 + } + ], + "advertise": false, + "valency": 6 + }, + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30049 + } + ], + "advertise": false, + "valency": 6 + }, + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30016 + } + ], + "advertise": false, + "valency": 6 + }, + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30034 + } + ], + "advertise": false, + "valency": 6 + } + ], + "publicRoots": [], + "useLedgerAfterSlot": -1 +} diff --git a/bench/cardano-topology/data/test/value-volt-nomadperf-coay/node-10.json b/bench/cardano-topology/data/test/value-volt-nomadperf-coay/node-10.json new file mode 100644 index 00000000000..bc49c0842ab --- /dev/null +++ b/bench/cardano-topology/data/test/value-volt-nomadperf-coay/node-10.json @@ -0,0 +1,66 @@ +{ + "localRoots": [ + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30011 + } + ], + "advertise": false, + "valency": 6 + }, + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30009 + } + ], + "advertise": false, + "valency": 6 + }, + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30013 + } + ], + "advertise": false, + "valency": 6 + }, + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30007 + } + ], + "advertise": false, + "valency": 6 + }, + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30025 + } + ], + "advertise": false, + "valency": 6 + }, + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30043 + } + ], + "advertise": false, + "valency": 6 + } + ], + "publicRoots": [], + "useLedgerAfterSlot": -1 +} diff --git a/bench/cardano-topology/data/test/value-volt-nomadperf-coay/node-11.json b/bench/cardano-topology/data/test/value-volt-nomadperf-coay/node-11.json new file mode 100644 index 00000000000..294877069ee --- /dev/null +++ b/bench/cardano-topology/data/test/value-volt-nomadperf-coay/node-11.json @@ -0,0 +1,66 @@ +{ + "localRoots": [ + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30009 + } + ], + "advertise": false, + "valency": 6 + }, + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30010 + } + ], + "advertise": false, + "valency": 6 + }, + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30014 + } + ], + "advertise": false, + "valency": 6 + }, + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30008 + } + ], + "advertise": false, + "valency": 6 + }, + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30026 + } + ], + "advertise": false, + "valency": 6 + }, + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30044 + } + ], + "advertise": false, + "valency": 6 + } + ], + "publicRoots": [], + "useLedgerAfterSlot": -1 +} diff --git a/bench/cardano-topology/data/test/value-volt-nomadperf-coay/node-2.json b/bench/cardano-topology/data/test/value-volt-nomadperf-coay/node-2.json new file mode 100644 index 00000000000..7f0efbc3cbf --- /dev/null +++ b/bench/cardano-topology/data/test/value-volt-nomadperf-coay/node-2.json @@ -0,0 +1,66 @@ +{ + "localRoots": [ + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30000 + } + ], + "advertise": false, + "valency": 6 + }, + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30001 + } + ], + "advertise": false, + "valency": 6 + }, + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30005 + } + ], + "advertise": false, + "valency": 6 + }, + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30050 + } + ], + "advertise": false, + "valency": 6 + }, + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30017 + } + ], + "advertise": false, + "valency": 6 + }, + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30035 + } + ], + "advertise": false, + "valency": 6 + } + ], + "publicRoots": [], + "useLedgerAfterSlot": -1 +} diff --git a/bench/cardano-topology/data/test/value-volt-nomadperf-coay/node-3.json b/bench/cardano-topology/data/test/value-volt-nomadperf-coay/node-3.json new file mode 100644 index 00000000000..87e3ca45d14 --- /dev/null +++ b/bench/cardano-topology/data/test/value-volt-nomadperf-coay/node-3.json @@ -0,0 +1,66 @@ +{ + "localRoots": [ + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30004 + } + ], + "advertise": false, + "valency": 6 + }, + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30005 + } + ], + "advertise": false, + "valency": 6 + }, + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30006 + } + ], + "advertise": false, + "valency": 6 + }, + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30000 + } + ], + "advertise": false, + "valency": 6 + }, + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30021 + } + ], + "advertise": false, + "valency": 6 + }, + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30039 + } + ], + "advertise": false, + "valency": 6 + } + ], + "publicRoots": [], + "useLedgerAfterSlot": -1 +} diff --git a/bench/cardano-topology/data/test/value-volt-nomadperf-coay/node-4.json b/bench/cardano-topology/data/test/value-volt-nomadperf-coay/node-4.json new file mode 100644 index 00000000000..9411eb964da --- /dev/null +++ b/bench/cardano-topology/data/test/value-volt-nomadperf-coay/node-4.json @@ -0,0 +1,66 @@ +{ + "localRoots": [ + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30005 + } + ], + "advertise": false, + "valency": 6 + }, + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30003 + } + ], + "advertise": false, + "valency": 6 + }, + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30007 + } + ], + "advertise": false, + "valency": 6 + }, + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30001 + } + ], + "advertise": false, + "valency": 6 + }, + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30019 + } + ], + "advertise": false, + "valency": 6 + }, + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30037 + } + ], + "advertise": false, + "valency": 6 + } + ], + "publicRoots": [], + "useLedgerAfterSlot": -1 +} diff --git a/bench/cardano-topology/data/test/value-volt-nomadperf-coay/node-5.json b/bench/cardano-topology/data/test/value-volt-nomadperf-coay/node-5.json new file mode 100644 index 00000000000..e0a8ed83fae --- /dev/null +++ b/bench/cardano-topology/data/test/value-volt-nomadperf-coay/node-5.json @@ -0,0 +1,66 @@ +{ + "localRoots": [ + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30003 + } + ], + "advertise": false, + "valency": 6 + }, + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30004 + } + ], + "advertise": false, + "valency": 6 + }, + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30008 + } + ], + "advertise": false, + "valency": 6 + }, + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30002 + } + ], + "advertise": false, + "valency": 6 + }, + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30020 + } + ], + "advertise": false, + "valency": 6 + }, + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30038 + } + ], + "advertise": false, + "valency": 6 + } + ], + "publicRoots": [], + "useLedgerAfterSlot": -1 +} diff --git a/bench/cardano-topology/data/test/value-volt-nomadperf-coay/node-6.json b/bench/cardano-topology/data/test/value-volt-nomadperf-coay/node-6.json new file mode 100644 index 00000000000..c49a11ae4bd --- /dev/null +++ b/bench/cardano-topology/data/test/value-volt-nomadperf-coay/node-6.json @@ -0,0 +1,66 @@ +{ + "localRoots": [ + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30007 + } + ], + "advertise": false, + "valency": 6 + }, + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30008 + } + ], + "advertise": false, + "valency": 6 + }, + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30009 + } + ], + "advertise": false, + "valency": 6 + }, + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30003 + } + ], + "advertise": false, + "valency": 6 + }, + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30024 + } + ], + "advertise": false, + "valency": 6 + }, + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30042 + } + ], + "advertise": false, + "valency": 6 + } + ], + "publicRoots": [], + "useLedgerAfterSlot": -1 +} diff --git a/bench/cardano-topology/data/test/value-volt-nomadperf-coay/node-7.json b/bench/cardano-topology/data/test/value-volt-nomadperf-coay/node-7.json new file mode 100644 index 00000000000..f9e18576950 --- /dev/null +++ b/bench/cardano-topology/data/test/value-volt-nomadperf-coay/node-7.json @@ -0,0 +1,66 @@ +{ + "localRoots": [ + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30008 + } + ], + "advertise": false, + "valency": 6 + }, + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30006 + } + ], + "advertise": false, + "valency": 6 + }, + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30010 + } + ], + "advertise": false, + "valency": 6 + }, + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30004 + } + ], + "advertise": false, + "valency": 6 + }, + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30022 + } + ], + "advertise": false, + "valency": 6 + }, + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30040 + } + ], + "advertise": false, + "valency": 6 + } + ], + "publicRoots": [], + "useLedgerAfterSlot": -1 +} diff --git a/bench/cardano-topology/data/test/value-volt-nomadperf-coay/node-8.json b/bench/cardano-topology/data/test/value-volt-nomadperf-coay/node-8.json new file mode 100644 index 00000000000..a0a8d31b402 --- /dev/null +++ b/bench/cardano-topology/data/test/value-volt-nomadperf-coay/node-8.json @@ -0,0 +1,66 @@ +{ + "localRoots": [ + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30006 + } + ], + "advertise": false, + "valency": 6 + }, + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30007 + } + ], + "advertise": false, + "valency": 6 + }, + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30011 + } + ], + "advertise": false, + "valency": 6 + }, + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30005 + } + ], + "advertise": false, + "valency": 6 + }, + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30023 + } + ], + "advertise": false, + "valency": 6 + }, + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30041 + } + ], + "advertise": false, + "valency": 6 + } + ], + "publicRoots": [], + "useLedgerAfterSlot": -1 +} diff --git a/bench/cardano-topology/data/test/value-volt-nomadperf-coay/node-9.json b/bench/cardano-topology/data/test/value-volt-nomadperf-coay/node-9.json new file mode 100644 index 00000000000..85ac021f1ee --- /dev/null +++ b/bench/cardano-topology/data/test/value-volt-nomadperf-coay/node-9.json @@ -0,0 +1,66 @@ +{ + "localRoots": [ + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30010 + } + ], + "advertise": false, + "valency": 6 + }, + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30011 + } + ], + "advertise": false, + "valency": 6 + }, + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30012 + } + ], + "advertise": false, + "valency": 6 + }, + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30006 + } + ], + "advertise": false, + "valency": 6 + }, + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30027 + } + ], + "advertise": false, + "valency": 6 + }, + { + "accessPoints": [ + { + "address": "127.0.0.1", + "port": 30045 + } + ], + "advertise": false, + "valency": 6 + } + ], + "publicRoots": [], + "useLedgerAfterSlot": -1 +} diff --git a/bench/cardano-topology/data/test/value-volt-nomadperf-coay/topology.json b/bench/cardano-topology/data/test/value-volt-nomadperf-coay/topology.json new file mode 100644 index 00000000000..d8245cc165b --- /dev/null +++ b/bench/cardano-topology/data/test/value-volt-nomadperf-coay/topology.json @@ -0,0 +1,900 @@ +{ + "coreNodes": [ + { + "name": "node-0", + "nodeId": 0, + "org": "IOHK", + "pools": 1, + "producers": [ + "node-1", + "node-2", + "node-3", + "node-51", + "node-18", + "node-36" + ], + "region": "eu-central-1", + "stakePool": true + }, + { + "name": "node-3", + "nodeId": 3, + "org": "IOHK", + "pools": 1, + "producers": [ + "node-4", + "node-5", + "node-6", + "node-0", + "node-21", + "node-39" + ], + "region": "eu-central-1", + "stakePool": true + }, + { + "name": "node-6", + "nodeId": 6, + "org": "IOHK", + "pools": 1, + "producers": [ + "node-7", + "node-8", + "node-9", + "node-3", + "node-24", + "node-42" + ], + "region": "eu-central-1", + "stakePool": true + }, + { + "name": "node-9", + "nodeId": 9, + "org": "IOHK", + "pools": 1, + "producers": [ + "node-10", + "node-11", + "node-12", + "node-6", + "node-27", + "node-45" + ], + "region": "eu-central-1", + "stakePool": true + }, + { + "name": "node-12", + "nodeId": 12, + "org": "IOHK", + "pools": 1, + "producers": [ + "node-13", + "node-14", + "node-15", + "node-9", + "node-30", + "node-48" + ], + "region": "eu-central-1", + "stakePool": true + }, + { + "name": "node-15", + "nodeId": 15, + "org": "IOHK", + "pools": 1, + "producers": [ + "node-16", + "node-17", + "node-18", + "node-12", + "node-33", + "node-51" + ], + "region": "eu-central-1", + "stakePool": true + }, + { + "name": "node-18", + "nodeId": 18, + "org": "IOHK", + "pools": 1, + "producers": [ + "node-19", + "node-20", + "node-21", + "node-15", + "node-36", + "node-0" + ], + "region": "eu-central-1", + "stakePool": true + }, + { + "name": "node-21", + "nodeId": 21, + "org": "IOHK", + "pools": 1, + "producers": [ + "node-22", + "node-23", + "node-24", + "node-18", + "node-39", + "node-3" + ], + "region": "eu-central-1", + "stakePool": true + }, + { + "name": "node-24", + "nodeId": 24, + "org": "IOHK", + "pools": 1, + "producers": [ + "node-25", + "node-26", + "node-27", + "node-21", + "node-42", + "node-6" + ], + "region": "eu-central-1", + "stakePool": true + }, + { + "name": "node-27", + "nodeId": 27, + "org": "IOHK", + "pools": 1, + "producers": [ + "node-28", + "node-29", + "node-30", + "node-24", + "node-45", + "node-9" + ], + "region": "eu-central-1", + "stakePool": true + }, + { + "name": "node-30", + "nodeId": 30, + "org": "IOHK", + "pools": 1, + "producers": [ + "node-31", + "node-32", + "node-33", + "node-27", + "node-48", + "node-12" + ], + "region": "eu-central-1", + "stakePool": true + }, + { + "name": "node-33", + "nodeId": 33, + "org": "IOHK", + "pools": 1, + "producers": [ + "node-34", + "node-35", + "node-36", + "node-30", + "node-51", + "node-15" + ], + "region": "eu-central-1", + "stakePool": true + }, + { + "name": "node-36", + "nodeId": 36, + "org": "IOHK", + "pools": 1, + "producers": [ + "node-37", + "node-38", + "node-39", + "node-33", + "node-0", + "node-18" + ], + "region": "eu-central-1", + "stakePool": true + }, + { + "name": "node-39", + "nodeId": 39, + "org": "IOHK", + "pools": 1, + "producers": [ + "node-40", + "node-41", + "node-42", + "node-36", + "node-3", + "node-21" + ], + "region": "eu-central-1", + "stakePool": true + }, + { + "name": "node-42", + "nodeId": 42, + "org": "IOHK", + "pools": 1, + "producers": [ + "node-43", + "node-44", + "node-45", + "node-39", + "node-6", + "node-24" + ], + "region": "eu-central-1", + "stakePool": true + }, + { + "name": "node-45", + "nodeId": 45, + "org": "IOHK", + "pools": 1, + "producers": [ + "node-46", + "node-47", + "node-48", + "node-42", + "node-9", + "node-27" + ], + "region": "eu-central-1", + "stakePool": true + }, + { + "name": "node-48", + "nodeId": 48, + "org": "IOHK", + "pools": 1, + "producers": [ + "node-49", + "node-50", + "node-51", + "node-45", + "node-12", + "node-30" + ], + "region": "eu-central-1", + "stakePool": true + }, + { + "name": "node-51", + "nodeId": 51, + "org": "IOHK", + "pools": 1, + "producers": [ + "node-1", + "node-2", + "node-0", + "node-48", + "node-15", + "node-33" + ], + "region": "eu-central-1", + "stakePool": true + }, + { + "name": "node-1", + "nodeId": 1, + "org": "IOHK", + "pools": 1, + "producers": [ + "node-2", + "node-0", + "node-4", + "node-49", + "node-16", + "node-34" + ], + "region": "us-east-1", + "stakePool": true + }, + { + "name": "node-4", + "nodeId": 4, + "org": "IOHK", + "pools": 1, + "producers": [ + "node-5", + "node-3", + "node-7", + "node-1", + "node-19", + "node-37" + ], + "region": "us-east-1", + "stakePool": true + }, + { + "name": "node-7", + "nodeId": 7, + "org": "IOHK", + "pools": 1, + "producers": [ + "node-8", + "node-6", + "node-10", + "node-4", + "node-22", + "node-40" + ], + "region": "us-east-1", + "stakePool": true + }, + { + "name": "node-10", + "nodeId": 10, + "org": "IOHK", + "pools": 1, + "producers": [ + "node-11", + "node-9", + "node-13", + "node-7", + "node-25", + "node-43" + ], + "region": "us-east-1", + "stakePool": true + }, + { + "name": "node-13", + "nodeId": 13, + "org": "IOHK", + "pools": 1, + "producers": [ + "node-14", + "node-12", + "node-16", + "node-10", + "node-28", + "node-46" + ], + "region": "us-east-1", + "stakePool": true + }, + { + "name": "node-16", + "nodeId": 16, + "org": "IOHK", + "pools": 1, + "producers": [ + "node-17", + "node-15", + "node-19", + "node-13", + "node-31", + "node-49" + ], + "region": "us-east-1", + "stakePool": true + }, + { + "name": "node-19", + "nodeId": 19, + "org": "IOHK", + "pools": 1, + "producers": [ + "node-20", + "node-18", + "node-22", + "node-16", + "node-34", + "node-1" + ], + "region": "us-east-1", + "stakePool": true + }, + { + "name": "node-22", + "nodeId": 22, + "org": "IOHK", + "pools": 1, + "producers": [ + "node-23", + "node-21", + "node-25", + "node-19", + "node-37", + "node-4" + ], + "region": "us-east-1", + "stakePool": true + }, + { + "name": "node-25", + "nodeId": 25, + "org": "IOHK", + "pools": 1, + "producers": [ + "node-26", + "node-24", + "node-28", + "node-22", + "node-40", + "node-7" + ], + "region": "us-east-1", + "stakePool": true + }, + { + "name": "node-28", + "nodeId": 28, + "org": "IOHK", + "pools": 1, + "producers": [ + "node-29", + "node-27", + "node-31", + "node-25", + "node-43", + "node-10" + ], + "region": "us-east-1", + "stakePool": true + }, + { + "name": "node-31", + "nodeId": 31, + "org": "IOHK", + "pools": 1, + "producers": [ + "node-32", + "node-30", + "node-34", + "node-28", + "node-46", + "node-13" + ], + "region": "us-east-1", + "stakePool": true + }, + { + "name": "node-34", + "nodeId": 34, + "org": "IOHK", + "pools": 1, + "producers": [ + "node-35", + "node-33", + "node-37", + "node-31", + "node-49", + "node-16" + ], + "region": "us-east-1", + "stakePool": true + }, + { + "name": "node-37", + "nodeId": 37, + "org": "IOHK", + "pools": 1, + "producers": [ + "node-38", + "node-36", + "node-40", + "node-34", + "node-1", + "node-19" + ], + "region": "us-east-1", + "stakePool": true + }, + { + "name": "node-40", + "nodeId": 40, + "org": "IOHK", + "pools": 1, + "producers": [ + "node-41", + "node-39", + "node-43", + "node-37", + "node-4", + "node-22" + ], + "region": "us-east-1", + "stakePool": true + }, + { + "name": "node-43", + "nodeId": 43, + "org": "IOHK", + "pools": 1, + "producers": [ + "node-44", + "node-42", + "node-46", + "node-40", + "node-7", + "node-25" + ], + "region": "us-east-1", + "stakePool": true + }, + { + "name": "node-46", + "nodeId": 46, + "org": "IOHK", + "pools": 1, + "producers": [ + "node-47", + "node-45", + "node-49", + "node-43", + "node-10", + "node-28" + ], + "region": "us-east-1", + "stakePool": true + }, + { + "name": "node-49", + "nodeId": 49, + "org": "IOHK", + "pools": 1, + "producers": [ + "node-50", + "node-48", + "node-1", + "node-46", + "node-13", + "node-31" + ], + "region": "us-east-1", + "stakePool": true + }, + { + "name": "node-2", + "nodeId": 2, + "org": "IOHK", + "pools": 1, + "producers": [ + "node-0", + "node-1", + "node-5", + "node-50", + "node-17", + "node-35" + ], + "region": "ap-southeast-2", + "stakePool": true + }, + { + "name": "node-5", + "nodeId": 5, + "org": "IOHK", + "pools": 1, + "producers": [ + "node-3", + "node-4", + "node-8", + "node-2", + "node-20", + "node-38" + ], + "region": "ap-southeast-2", + "stakePool": true + }, + { + "name": "node-8", + "nodeId": 8, + "org": "IOHK", + "pools": 1, + "producers": [ + "node-6", + "node-7", + "node-11", + "node-5", + "node-23", + "node-41" + ], + "region": "ap-southeast-2", + "stakePool": true + }, + { + "name": "node-11", + "nodeId": 11, + "org": "IOHK", + "pools": 1, + "producers": [ + "node-9", + "node-10", + "node-14", + "node-8", + "node-26", + "node-44" + ], + "region": "ap-southeast-2", + "stakePool": true + }, + { + "name": "node-14", + "nodeId": 14, + "org": "IOHK", + "pools": 1, + "producers": [ + "node-12", + "node-13", + "node-17", + "node-11", + "node-29", + "node-47" + ], + "region": "ap-southeast-2", + "stakePool": true + }, + { + "name": "node-17", + "nodeId": 17, + "org": "IOHK", + "pools": 1, + "producers": [ + "node-15", + "node-16", + "node-20", + "node-14", + "node-32", + "node-50" + ], + "region": "ap-southeast-2", + "stakePool": true + }, + { + "name": "node-20", + "nodeId": 20, + "org": "IOHK", + "pools": 1, + "producers": [ + "node-18", + "node-19", + "node-23", + "node-17", + "node-35", + "node-2" + ], + "region": "ap-southeast-2", + "stakePool": true + }, + { + "name": "node-23", + "nodeId": 23, + "org": "IOHK", + "pools": 1, + "producers": [ + "node-21", + "node-22", + "node-26", + "node-20", + "node-38", + "node-5" + ], + "region": "ap-southeast-2", + "stakePool": true + }, + { + "name": "node-26", + "nodeId": 26, + "org": "IOHK", + "pools": 1, + "producers": [ + "node-24", + "node-25", + "node-29", + "node-23", + "node-41", + "node-8" + ], + "region": "ap-southeast-2", + "stakePool": true + }, + { + "name": "node-29", + "nodeId": 29, + "org": "IOHK", + "pools": 1, + "producers": [ + "node-27", + "node-28", + "node-32", + "node-26", + "node-44", + "node-11" + ], + "region": "ap-southeast-2", + "stakePool": true + }, + { + "name": "node-32", + "nodeId": 32, + "org": "IOHK", + "pools": 1, + "producers": [ + "node-30", + "node-31", + "node-35", + "node-29", + "node-47", + "node-14" + ], + "region": "ap-southeast-2", + "stakePool": true + }, + { + "name": "node-35", + "nodeId": 35, + "org": "IOHK", + "pools": 1, + "producers": [ + "node-33", + "node-34", + "node-38", + "node-32", + "node-50", + "node-17" + ], + "region": "ap-southeast-2", + "stakePool": true + }, + { + "name": "node-38", + "nodeId": 38, + "org": "IOHK", + "pools": 1, + "producers": [ + "node-36", + "node-37", + "node-41", + "node-35", + "node-2", + "node-20" + ], + "region": "ap-southeast-2", + "stakePool": true + }, + { + "name": "node-41", + "nodeId": 41, + "org": "IOHK", + "pools": 1, + "producers": [ + "node-39", + "node-40", + "node-44", + "node-38", + "node-5", + "node-23" + ], + "region": "ap-southeast-2", + "stakePool": true + }, + { + "name": "node-44", + "nodeId": 44, + "org": "IOHK", + "pools": 1, + "producers": [ + "node-42", + "node-43", + "node-47", + "node-41", + "node-8", + "node-26" + ], + "region": "ap-southeast-2", + "stakePool": true + }, + { + "name": "node-47", + "nodeId": 47, + "org": "IOHK", + "pools": 1, + "producers": [ + "node-45", + "node-46", + "node-50", + "node-44", + "node-11", + "node-29" + ], + "region": "ap-southeast-2", + "stakePool": true + }, + { + "name": "node-50", + "nodeId": 50, + "org": "IOHK", + "pools": 1, + "producers": [ + "node-48", + "node-49", + "node-2", + "node-47", + "node-14", + "node-32" + ], + "region": "ap-southeast-2", + "stakePool": true + } + ], + "relayNodes": [ + { + "name": "explorer", + "nodeId": 52, + "org": "IOHK", + "pools": null, + "producers": [ + "node-0", + "node-1", + "node-2", + "node-3", + "node-4", + "node-5", + "node-6", + "node-7", + "node-8", + "node-9", + "node-10", + "node-11", + "node-12", + "node-13", + "node-14", + "node-15", + "node-16", + "node-17", + "node-18", + "node-19", + "node-20", + "node-21", + "node-22", + "node-23", + "node-24", + "node-25", + "node-26", + "node-27", + "node-28", + "node-29", + "node-30", + "node-31", + "node-32", + "node-33", + "node-34", + "node-35", + "node-36", + "node-37", + "node-38", + "node-39", + "node-40", + "node-41", + "node-42", + "node-43", + "node-44", + "node-45", + "node-46", + "node-47", + "node-48", + "node-49", + "node-50", + "node-51" + ], + "region": "eu-central-1", + "stakePool": null + } + ] +} diff --git a/bench/cardano-topology/test/Cardano/Benchmarking/Topology/Projection/Tests.hs b/bench/cardano-topology/test/Cardano/Benchmarking/Topology/Projection/Tests.hs new file mode 100644 index 00000000000..e769b982e97 --- /dev/null +++ b/bench/cardano-topology/test/Cardano/Benchmarking/Topology/Projection/Tests.hs @@ -0,0 +1,102 @@ +{-# LANGUAGE Trustworthy #-} +{-# LANGUAGE OverloadedStrings #-} + +-------------------------------------------------------------------------------- + +module Cardano.Benchmarking.Topology.Projection.Tests (tests) where + +-------------------------------------------------------------------------------- + +import Prelude +-- Package: aeson. +import qualified Data.Aeson as Aeson +-- Package: tasty. +import qualified Test.Tasty as Tasty +-- Package: tasty-hunit. +import Test.Tasty.HUnit +-- Package: self. +import qualified Cardano.Benchmarking.Topology.Projection as Projection +import qualified Paths_cardano_topology as Paths + +-------------------------------------------------------------------------------- + +tests :: Tasty.TestTree +tests = Tasty.testGroup "Cardano.Benchmarking.Topology.Projection" + [ + projection + , projectionP2P + ] + +projection :: Tasty.TestTree +projection = Tasty.testGroup + "Cardano.Benchmarking.Topology.Projection.projection" $ + map + (\(topologyName, projections) -> Tasty.testGroup topologyName $ + map + (\(projectionId, projectionName) -> testCase projectionName $ do + let topologyDir = "data/test/" ++ topologyName ++ "/" + let projectionDir = topologyDir + topologyPath <- Paths.getDataFileName $ topologyDir ++ "topology.json" + projectionPath <- Paths.getDataFileName $ projectionDir ++ projectionName + eitherTopology <- Aeson.eitherDecodeFileStrict topologyPath + eitherProjection <- Aeson.eitherDecodeFileStrict projectionPath + case (eitherTopology, eitherProjection) of + (Right topology, Right proj) -> + assertEqual + ("node-specs.json == (nodeSpecs \"" ++ topologyName ++ "\")") + proj -- expected + (Projection.projection topology projectionId 30000) -- got + errors -> fail (show errors) + ) + projections + ) + [ ( + "ci-test-coay" + , [ + ( 0, "node-0.json") + , ( 1, "node-1.json") + ] + ) + ] + +projectionP2P :: Tasty.TestTree +projectionP2P = Tasty.testGroup + "Cardano.Benchmarking.Topology.Projection.projectionP2P" $ + map + (\(topologyName, projections) -> Tasty.testGroup topologyName $ + map + (\(projectionId, projectionName) -> testCase projectionName $ do + let topologyDir = "data/test/" ++ topologyName ++ "/" + let projectionDir = topologyDir + topologyPath <- Paths.getDataFileName $ topologyDir ++ "topology.json" + projectionPath <- Paths.getDataFileName $ projectionDir ++ projectionName + eitherTopology <- Aeson.eitherDecodeFileStrict topologyPath + eitherProjection <- Aeson.eitherDecodeFileStrict projectionPath + case (eitherTopology, eitherProjection) of + (Right topology, Right projP2P) -> + assertEqual + ("node-specs.json == (nodeSpecs \"" ++ topologyName ++ "\")") + projP2P -- expected + (Projection.projectionP2P topology projectionId 30000) -- got + errors -> fail (show errors) + ) + projections + ) + [ ( + "value-volt-nomadperf-coay" + , [ + ( 0, "node-0.json") + , ( 1, "node-1.json") + , ( 2, "node-2.json") + , ( 3, "node-3.json") + , ( 4, "node-4.json") + , ( 5, "node-5.json") + , ( 6, "node-6.json") + , ( 7, "node-7.json") + , ( 8, "node-8.json") + , ( 9, "node-9.json") + , (10, "node-10.json") + , (11, "node-11.json") + ] + ) + ] diff --git a/bench/cardano-topology/test/Main.hs b/bench/cardano-topology/test/Main.hs index 373586d97fb..16d442ec853 100644 --- a/bench/cardano-topology/test/Main.hs +++ b/bench/cardano-topology/test/Main.hs @@ -13,6 +13,7 @@ import qualified Test.Tasty as Tasty import Test.Tasty.HUnit import qualified Cardano.Benchmarking.Topology as Topo +import qualified Cardano.Benchmarking.Topology.Projection.Tests as Projection import qualified Cardano.Benchmarking.Topology.Types as Types import qualified Paths_cardano_topology as Paths @@ -27,6 +28,7 @@ tests = Tasty.testGroup "cardano-topology" [ topologyTypes , topology + , Projection.tests ] topologyTypes :: Tasty.TestTree