mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-21 19:28:05 +01:00
Run GitHub Action in a container
This commit is contained in:
@@ -1,48 +0,0 @@
|
||||
/*
|
||||
* Copyright 2021 Signal Messenger, LLC
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
package org.whispersystems.textsecuregcm.metrics;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.stream.Stream;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.condition.EnabledOnOs;
|
||||
import org.junit.jupiter.api.condition.OS;
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.Arguments;
|
||||
import org.junit.jupiter.params.provider.MethodSource;
|
||||
import org.whispersystems.textsecuregcm.metrics.NstatCounters.NetworkStatistics;
|
||||
|
||||
class NstatCountersTest {
|
||||
|
||||
@Test
|
||||
@EnabledOnOs(OS.LINUX)
|
||||
void loadNetworkStatistics() throws IOException, InterruptedException {
|
||||
final NetworkStatistics networkStatistics = NstatCounters.loadNetworkStatistics();
|
||||
|
||||
assertNotNull(networkStatistics.getKernelStatistics());
|
||||
assertFalse(networkStatistics.getKernelStatistics().isEmpty());
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
@MethodSource("shouldIncludeMetricNameProvider")
|
||||
void shouldIncludeMetric(final String metricName, final boolean expectInclude) {
|
||||
assertEquals(expectInclude, NstatCounters.shouldIncludeMetric(metricName));
|
||||
}
|
||||
|
||||
static Stream<Arguments> shouldIncludeMetricNameProvider() {
|
||||
return Stream.of(Arguments.of("IpInReceives", true),
|
||||
Arguments.of("TcpActiveOpens", true),
|
||||
Arguments.of("UdpInDatagrams", false),
|
||||
Arguments.of("Ip6InReceives", false),
|
||||
Arguments.of("Udp6InDatagrams", false),
|
||||
Arguments.of("TcpExtSyncookiesSent", true),
|
||||
Arguments.of("IpExtInNoRoutes", true));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user