about summary refs log tree commit diff
path: root/test
diff options
context:
space:
mode:
authorHeikki Kallasjoki <fis@zem.fi>2018-12-15 01:13:46 +0000
committerHeikki Kallasjoki <fis+github@zem.fi>2018-12-15 01:19:43 +0000
commit66fa2c3797bae4ef0c2a2165c34020d1fe7ea6ed (patch)
tree2d1044c429359d01a6d03e9e5408b3303674a1a6 /test
parenta940aeb47cf9f3c83f4e3e94d2b38f0dba9e19a0 (diff)
downloadnano-exporter-66fa2c3797bae4ef0c2a2165c34020d1fe7ea6ed.tar.gz
nano-exporter-66fa2c3797bae4ef0c2a2165c34020d1fe7ea6ed.tar.xz
nano-exporter-66fa2c3797bae4ef0c2a2165c34020d1fe7ea6ed.zip
Rename the network collector to netdev.
Resolves #14. For consistency with node_exporter, and with other
network-related collectors.
Diffstat (limited to 'test')
-rw-r--r--test/Makefile2
-rw-r--r--test/netdev_test.c (renamed from test/network_test.c)10
2 files changed, 6 insertions, 6 deletions
diff --git a/test/Makefile b/test/Makefile
index 872cfe7..c2bd981 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -12,7 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-COLLECTOR_TESTS := cpu diskstats filesystem hwmon meminfo network stat textfile uname
+COLLECTOR_TESTS := cpu diskstats filesystem hwmon meminfo netdev stat textfile uname
 
 COLLECTOR_TEST_PROGS := $(foreach c,$(COLLECTOR_TESTS),$(c)_test)
 COLLECTOR_TEST_OBJS := $(foreach p,$(COLLECTOR_TEST_PROGS),$(p).o)
diff --git a/test/network_test.c b/test/netdev_test.c
index 841604c..5db1da6 100644
--- a/test/network_test.c
+++ b/test/netdev_test.c
@@ -18,9 +18,9 @@
 #include "mock_scrape.h"
 #include "../collector.h"
 
-extern const struct collector network_collector;
+extern const struct collector netdev_collector;
 
-TEST(network_metrics) {
+TEST(netdev_metrics) {
   test_write_file(
       env,
       "proc/net/dev",
@@ -30,8 +30,8 @@ TEST(network_metrics) {
       "  eno1:   12345    1234   12   23   34    45         56        67    98765    9876   98   87   76    65      54         43\n");
   scrape_req *req = mock_scrape_start(env);
 
-  void *ctx = network_collector.init(0, 0);
-  network_collector.collect(req, ctx);
+  void *ctx = netdev_collector.init(0, 0);
+  netdev_collector.collect(req, ctx);
 
   struct label *labels;
   labels = LABEL_LIST({"device", "eno1"});
@@ -57,6 +57,6 @@ TEST(network_metrics) {
 
 TEST_SUITE {
   TEST_SUITE_START;
-  RUN_TEST(network_metrics);
+  RUN_TEST(netdev_metrics);
   TEST_SUITE_END;
 }