]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/commitdiff
add graph test
authorTobias Oetiker <tobi@oetiker.ch>
Thu, 3 Jan 2019 11:01:20 +0000 (12:01 +0100)
committerTobias Oetiker <tobi@oetiker.ch>
Thu, 3 Jan 2019 12:05:10 +0000 (13:05 +0100)
tests/Makefile.am
tests/Makefile.in
tests/graph1 [new file with mode: 0755]
tests/graph1.output [new file with mode: 0644]

index 28909cec177ea21a1183919c377c6379e42d27cd..d2230ca6e3ed9d14e875301123fda1bf6690e134 100644 (file)
@@ -1,5 +1,5 @@
 TESTS = modify1 modify2 modify3 modify4 modify5 \
-       tune1 tune2 rpn1 rpn2 \
+       tune1 tune2 graph1 rpn1 rpn2 \
        rrdcreate \
        dump-restore \
        create-with-source-1 create-with-source-2 create-with-source-3 \
@@ -20,7 +20,7 @@ EXTRA_DIST = Makefile.am \
        xport1.json.output xport1.xml.output
        
 # NB: AM_TESTS_ENVIRONMENT not available until automake 1.12
-TESTS_ENVIRONMENT = \
+AM_TESTS_ENVIRONMENT = \
        BASEDIR=${abs_srcdir} ; export BASEDIR ; \
        BUILDDIR=${abs_builddir} ; export BUILDDIR ; \
        TOP_BUILDDIR=${abs_top_builddir} ; export TOP_BUILDDIR ;
index 9ffa189b962ea4da1c13b70ff19c99bf05bfdc0f..21316f463037166c9ab3bae6fd23e1bbc1cb7ed1 100644 (file)
@@ -537,7 +537,7 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 TESTS = modify1 modify2 modify3 modify4 modify5 \
-       tune1 tune2 rpn1 rpn2 \
+       tune1 tune2 graph1 rpn1 rpn2 \
        rrdcreate \
        dump-restore \
        create-with-source-1 create-with-source-2 create-with-source-3 \
@@ -559,7 +559,7 @@ EXTRA_DIST = Makefile.am \
 
 
 # NB: AM_TESTS_ENVIRONMENT not available until automake 1.12
-TESTS_ENVIRONMENT = \
+AM_TESTS_ENVIRONMENT = \
        BASEDIR=${abs_srcdir} ; export BASEDIR ; \
        BUILDDIR=${abs_builddir} ; export BUILDDIR ; \
        TOP_BUILDDIR=${abs_top_builddir} ; export TOP_BUILDDIR ;
@@ -805,6 +805,13 @@ tune2.log: tune2
        --log-file $$b.log --trs-file $$b.trs \
        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
        "$$tst" $(AM_TESTS_FD_REDIRECT)
+graph1.log: graph1
+       @p='graph1'; \
+       b='graph1'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
 rpn1.log: rpn1
        @p='rpn1'; \
        b='rpn1'; \
diff --git a/tests/graph1 b/tests/graph1
new file mode 100755 (executable)
index 0000000..e0035d5
--- /dev/null
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+. $(dirname $0)/functions
+
+RRD=graph1.rrd
+
+$RRDTOOL create $RRD --start 920804400 DS:speed:COUNTER:600:U:U RRA:AVERAGE:0.5:1:24 RRA:AVERAGE:0.5:6:10
+report "create"
+$RRDTOOL update $RRD 920804700:12345 920805000:12357 920805300:12363
+$RRDTOOL update $RRD 920805600:12363 920805900:12363 920806200:12373
+$RRDTOOL update $RRD 920806500:12383 920806800:12393 920807100:12399
+$RRDTOOL update $RRD 920807400:12405 920807700:12411 920808000:12415
+$RRDTOOL update $RRD 920808300:12420 920808600:12422 920808900:12423
+report "update"
+# blank out any absolute coordinates, as they might differ
+$BLANK < $BASEDIR/graph1.output > $BASEDIR/graph1.output.out
+$RRDTOOL graphv $BASEDIR/graph1.out \
+      --start 920804400 --end 920808000               \
+      DEF:my-speed=$RRD:speed:AVERAGE              \
+      VDEF:o=my-speed,MAXIMUM \
+      PRINT:o:'%lf' | $BLANK | $DIFF9 - $BASEDIR/graph1.output.out
+report "graphv"
diff --git a/tests/graph1.output b/tests/graph1.output
new file mode 100644 (file)
index 0000000..ce3b606
--- /dev/null
@@ -0,0 +1 @@
+print[0] = "0.040000"