Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

Commit

Permalink
PIE-1606
Browse files Browse the repository at this point in the history
  • Loading branch information
smatthewenglish committed May 16, 2019
1 parent f1ead6a commit 2aa359d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,12 @@ public ExpectNetServicesReturnsAllServicesAsActive(final NetServicesTransaction
public void verify(final Node node) {
final Map<String, Map<String, String>> result = node.execute(transaction);
assertThat(result.keySet())
.containsExactlyInAnyOrderElementsOf(Arrays.asList("p2p", "jsonrpc", "ws", "metrics"));
.containsExactlyInAnyOrderElementsOf(Arrays.asList("p2p", "jsonrpc", "ws"));

assertThat(InetAddresses.isUriInetAddress(result.get("p2p").get("host"))).isTrue();
final int p2pPort = Integer.valueOf(result.get("p2p").get("port"));
assertThat(NetworkUtility.isValidPort(p2pPort)).isTrue();

assertThat(InetAddresses.isUriInetAddress(result.get("metrics").get("host"))).isTrue();
final int metricsPort = Integer.valueOf(result.get("metrics").get("port"));
// TODO: Port should not be 0-valued. Refer to PAN-2703
assertThat(NetworkUtility.isValidPort(p2pPort) || metricsPort == 0).isTrue();

assertThat(InetAddresses.isUriInetAddress(result.get("ws").get("host"))).isTrue();
final int wsPort = Integer.valueOf(result.get("ws").get("port"));
// TODO: Port should not be 0-valued. Refer to PAN-2703
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import tech.pegasys.pantheon.ethereum.jsonrpc.RpcApi;
import tech.pegasys.pantheon.ethereum.jsonrpc.RpcApis;
import tech.pegasys.pantheon.ethereum.jsonrpc.websocket.WebSocketConfiguration;
import tech.pegasys.pantheon.metrics.prometheus.MetricsConfiguration;
import tech.pegasys.pantheon.tests.acceptance.dsl.node.GenesisConfigProvider;
import tech.pegasys.pantheon.tests.acceptance.dsl.node.Node;
import tech.pegasys.pantheon.tests.acceptance.dsl.node.PantheonNode;
Expand Down Expand Up @@ -132,27 +131,24 @@ public PantheonNode createArchiveNodeWithDiscoveryDisabledAndAdmin(final String
}

public PantheonNode createArchiveNodeNetServicesEnabled(final String name) throws IOException {
final MetricsConfiguration metricsConfiguration = MetricsConfiguration.createDefault();
metricsConfiguration.setEnabled(true);
metricsConfiguration.setPort(0);
metricsConfiguration.setPushEnabled(false);
// TODO: Enable metrics coverage in the acceptance tests. See PIE-1606
// final MetricsConfiguration metricsConfiguration = MetricsConfiguration.createDefault();
// metricsConfiguration.setEnabled(true);
// metricsConfiguration.setPort(0);
return create(
new PantheonFactoryConfigurationBuilder()
.setName(name)
.setMetricsConfiguration(metricsConfiguration)
// .setMetricsConfiguration(metricsConfiguration)
.setJsonRpcConfiguration(jsonRpcConfigWithAdmin())
.webSocketEnabled()
.setP2pEnabled(true)
.build());
}

public PantheonNode createArchiveNodeNetServicesDisabled(final String name) throws IOException {
final MetricsConfiguration metricsConfiguration = MetricsConfiguration.createDefault();
metricsConfiguration.setEnabled(false);
return create(
new PantheonFactoryConfigurationBuilder()
.setName(name)
.setMetricsConfiguration(metricsConfiguration)
.setJsonRpcConfiguration(jsonRpcConfigWithAdmin())
.setP2pEnabled(false)
.build());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class NetServicesAcceptanceTest extends AcceptanceTestBase {
@Test
public void shouldIndicateNetServicesEnabled() throws Exception {
final ClusterConfiguration clusterConfiguration =
new ClusterConfigurationBuilder().setAwaitPeerDiscovery(false).build();
new ClusterConfigurationBuilder().awaitPeerDiscovery(false).build();
noDiscoveryCluster = new Cluster(clusterConfiguration, net);
nodeA = pantheon.createArchiveNodeNetServicesEnabled("nodeA");
nodeB = pantheon.createArchiveNodeNetServicesEnabled("nodeB");
Expand All @@ -43,7 +43,7 @@ public void shouldIndicateNetServicesEnabled() throws Exception {
@Test
public void shouldNotDisplayDisabledServices() throws Exception {
final ClusterConfiguration clusterConfiguration =
new ClusterConfigurationBuilder().setAwaitPeerDiscovery(false).build();
new ClusterConfigurationBuilder().awaitPeerDiscovery(false).build();
noDiscoveryCluster = new Cluster(clusterConfiguration, net);
nodeA = pantheon.createArchiveNodeNetServicesDisabled("nodeA");
nodeB = pantheon.createArchiveNodeNetServicesDisabled("nodeB");
Expand Down

0 comments on commit 2aa359d

Please sign in to comment.