mirror of
https://github.com/prometheus/node_exporter
synced 2024-12-17 20:05:10 +00: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:
|
||||
@echo ">> SKIP running tests in 32-bit mode: not supported on $(GOHOSTOS)/$(GOHOSTARCH)"
|
||||
|
||||
collector/fixtures/sys/.unpacked: collector/fixtures/sys.ttar
|
||||
@echo ">> extracting sysfs fixtures"
|
||||
if [ -d collector/fixtures/sys ] ; then rm -r collector/fixtures/sys ; fi
|
||||
./ttar -C collector/fixtures -x -f collector/fixtures/sys.ttar
|
||||
%/.unpacked: %.ttar
|
||||
@echo ">> extracting fixtures"
|
||||
if [ -d $(dir $@) ] ; then rm -r $(dir $@) ; fi
|
||||
./ttar -C $(dir $*) -x -f $*.ttar
|
||||
touch $@
|
||||
|
||||
update_fixtures:
|
||||
rm -vf collector/fixtures/sys/.unpacked
|
||||
./ttar -C collector/fixtures -c -f collector/fixtures/sys.ttar sys
|
||||
|
||||
.PHONY: test-e2e
|
||||
test-e2e: build collector/fixtures/sys/.unpacked
|
||||
@echo ">> running end-to-end tests"
|
||||
|
@ -298,11 +298,6 @@ Lines: 1
|
||||
0
|
||||
Mode: 644
|
||||
# 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
|
||||
Lines: 1
|
||||
0
|
||||
@ -1278,15 +1273,16 @@ Path: sys/class/power_supply/BAT0/voltage_now
|
||||
Lines: 1
|
||||
11660000
|
||||
Mode: 444
|
||||
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
Directory: sys/class/thermal
|
||||
Mode: 755
|
||||
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
Path: sys/class/thermal/thermal_zone0
|
||||
SymlinkTo: ../../devices/virtual/thermal/thermal_zone0
|
||||
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
Path: sys/class/thermal/cooling_device0
|
||||
SymlinkTo: ../../devices/virtual/thermal/cooling_device0
|
||||
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
Path: sys/class/thermal/thermal_zone0
|
||||
SymlinkTo: ../../devices/virtual/thermal/thermal_zone0
|
||||
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
Directory: sys/devices
|
||||
Mode: 755
|
||||
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
@ -3200,7 +3196,3 @@ Lines: 1
|
||||
20
|
||||
Mode: 644
|
||||
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
Path: sys/.unpacked
|
||||
Lines: 0
|
||||
Mode: 644
|
||||
# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
Loading…
Reference in New Issue
Block a user