mirror of
https://github.com/prometheus/node_exporter.git
synced 2025-01-13 15:01:16 -08:00
Add fixture update helper (#1551)
* Add makefile target to update sysfs fixtures. * Use similar style for fixtures from procfs. * Re-pack fixtures ttar file. Signed-off-by: Ben Kochie <superq@gmail.com>
This commit is contained in:
parent
04fbcfffa1
commit
67d3010a79
12
Makefile
12
Makefile
|
@ -91,12 +91,16 @@ test-32bit: collector/fixtures/sys/.unpacked
|
||||||
skip-test-32bit:
|
skip-test-32bit:
|
||||||
@echo ">> SKIP running tests in 32-bit mode: not supported on $(GOHOSTOS)/$(GOHOSTARCH)"
|
@echo ">> SKIP running tests in 32-bit mode: not supported on $(GOHOSTOS)/$(GOHOSTARCH)"
|
||||||
|
|
||||||
collector/fixtures/sys/.unpacked: collector/fixtures/sys.ttar
|
%/.unpacked: %.ttar
|
||||||
@echo ">> extracting sysfs fixtures"
|
@echo ">> extracting fixtures"
|
||||||
if [ -d collector/fixtures/sys ] ; then rm -r collector/fixtures/sys ; fi
|
if [ -d $(dir $@) ] ; then rm -r $(dir $@) ; fi
|
||||||
./ttar -C collector/fixtures -x -f collector/fixtures/sys.ttar
|
./ttar -C $(dir $*) -x -f $*.ttar
|
||||||
touch $@
|
touch $@
|
||||||
|
|
||||||
|
update_fixtures:
|
||||||
|
rm -vf collector/fixtures/sys/.unpacked
|
||||||
|
./ttar -C collector/fixtures -c -f collector/fixtures/sys.ttar sys
|
||||||
|
|
||||||
.PHONY: test-e2e
|
.PHONY: test-e2e
|
||||||
test-e2e: build collector/fixtures/sys/.unpacked
|
test-e2e: build collector/fixtures/sys/.unpacked
|
||||||
@echo ">> running end-to-end tests"
|
@echo ">> running end-to-end tests"
|
||||||
|
|
|
@ -298,11 +298,6 @@ Lines: 1
|
||||||
0
|
0
|
||||||
Mode: 644
|
Mode: 644
|
||||||
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
Path: sys/class/infiniband/mlx4_0/ports/1/counters/port_xmit_discards
|
|
||||||
Lines: 1
|
|
||||||
0
|
|
||||||
Mode: 644
|
|
||||||
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
||||||
Path: sys/class/infiniband/mlx4_0/ports/1/counters/port_rcv_errors
|
Path: sys/class/infiniband/mlx4_0/ports/1/counters/port_rcv_errors
|
||||||
Lines: 1
|
Lines: 1
|
||||||
0
|
0
|
||||||
|
@ -1278,15 +1273,16 @@ Path: sys/class/power_supply/BAT0/voltage_now
|
||||||
Lines: 1
|
Lines: 1
|
||||||
11660000
|
11660000
|
||||||
Mode: 444
|
Mode: 444
|
||||||
|
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
Directory: sys/class/thermal
|
Directory: sys/class/thermal
|
||||||
Mode: 755
|
Mode: 755
|
||||||
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
Path: sys/class/thermal/thermal_zone0
|
|
||||||
SymlinkTo: ../../devices/virtual/thermal/thermal_zone0
|
|
||||||
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
||||||
Path: sys/class/thermal/cooling_device0
|
Path: sys/class/thermal/cooling_device0
|
||||||
SymlinkTo: ../../devices/virtual/thermal/cooling_device0
|
SymlinkTo: ../../devices/virtual/thermal/cooling_device0
|
||||||
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
Path: sys/class/thermal/thermal_zone0
|
||||||
|
SymlinkTo: ../../devices/virtual/thermal/thermal_zone0
|
||||||
|
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
Directory: sys/devices
|
Directory: sys/devices
|
||||||
Mode: 755
|
Mode: 755
|
||||||
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
@ -3200,7 +3196,3 @@ Lines: 1
|
||||||
20
|
20
|
||||||
Mode: 644
|
Mode: 644
|
||||||
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
Path: sys/.unpacked
|
|
||||||
Lines: 0
|
|
||||||
Mode: 644
|
|
||||||
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
||||||
|
|
Loading…
Reference in a new issue