]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/commitdiff
Refactor the tests to reflect actual functionality
authorFrançois HORTA <fhorta@scaleway.com>
Tue, 23 Nov 2021 16:03:51 +0000 (17:03 +0100)
committerFrançois HORTA <fhorta@scaleway.com>
Tue, 23 Nov 2021 16:03:51 +0000 (17:03 +0100)
46 files changed:
.travis.yml
tests/cached/dcounter1.output [new symlink]
tests/cached/graph1.output [new symlink]
tests/cached/graph2.output [new symlink]
tests/cached/modify-test1.create.dump [new symlink]
tests/cached/modify-test1.mod1.dump [new symlink]
tests/cached/modify-test3.create.dump [new symlink]
tests/cached/modify-test3.mod1.dump [new symlink]
tests/cached/modify2-testa-create.dump [new symlink]
tests/cached/modify2-testb-mod1.dump [new symlink]
tests/cached/modify2-testc-mod1.dump [new symlink]
tests/cached/modify4-testa-create.dump [new symlink]
tests/cached/modify4-testa1-create.dump [new symlink]
tests/cached/modify4-testa2-create.dump [new symlink]
tests/cached/modify5-testa1-create.dump [new symlink]
tests/cached/modify5-testa2-create.dump [new symlink]
tests/cached/pdp-calc1-1-avg-300.output [new symlink]
tests/cached/pdp-calc1-1-avg-60.output [new symlink]
tests/cached/pdp-calc1-1-max-300.output [new symlink]
tests/cached/rpn1.output [new symlink]
tests/cached/rpn2.output [new symlink]
tests/cached/tune1-testa-mod1.dump [new symlink]
tests/cached/tune1-testa-mod2.dump [new symlink]
tests/cached/tune1-testorg.dump [new symlink]
tests/cached/tune2-testa-mod1.dump [new symlink]
tests/cached/tune2-testorg.dump [new symlink]
tests/cached/xport1.json.output [new symlink]
tests/cached/xport1.xml.output [new symlink]
tests/create-from-template-1
tests/create-with-source-1
tests/create-with-source-3
tests/create-with-source-4
tests/dump-restore
tests/functions
tests/graph1
tests/list1
tests/modify1
tests/modify2
tests/modify3
tests/modify4
tests/modify5
tests/rpn1
tests/rpn2
tests/tune1
tests/tune2
tests/vformatter1

index 0e4ddfa8f43eabe7083beb871635502d11ead59f..efe3a71c1a7b43f7b004efc417b2d437ad3955c1 100644 (file)
@@ -24,7 +24,8 @@ script:
   # - make CFLAGS+="-g -O0 -fprofile-arcs -ftest-coverage" LDFLAGS+="-fprofile-arcs --coverage"
   - make
   - make check
-  - make check TESTS_STYLE="rrdcached"
+  - make check TESTS_STYLE="rrdcached-tcp"
+  - make check TESTS_STYLE="rrdcached-unix"
   # - make check TESTS_STYLE="valgrind-logfile"
   # Disable the following, failing tests: rpn1 rpn2 xport1
   # These tests are failing on Travis CI (currently Ubuntu xenial, 16.04LTS), when using valgrind-logfile
diff --git a/tests/cached/dcounter1.output b/tests/cached/dcounter1.output
new file mode 120000 (symlink)
index 0000000..30894f9
--- /dev/null
@@ -0,0 +1 @@
+../dcounter1.output
\ No newline at end of file
diff --git a/tests/cached/graph1.output b/tests/cached/graph1.output
new file mode 120000 (symlink)
index 0000000..1e965bd
--- /dev/null
@@ -0,0 +1 @@
+../graph1.output
\ No newline at end of file
diff --git a/tests/cached/graph2.output b/tests/cached/graph2.output
new file mode 120000 (symlink)
index 0000000..705a035
--- /dev/null
@@ -0,0 +1 @@
+../graph2.output
\ No newline at end of file
diff --git a/tests/cached/modify-test1.create.dump b/tests/cached/modify-test1.create.dump
new file mode 120000 (symlink)
index 0000000..8a11b6d
--- /dev/null
@@ -0,0 +1 @@
+../modify-test1.create.dump
\ No newline at end of file
diff --git a/tests/cached/modify-test1.mod1.dump b/tests/cached/modify-test1.mod1.dump
new file mode 120000 (symlink)
index 0000000..a636b8f
--- /dev/null
@@ -0,0 +1 @@
+../modify-test1.mod1.dump
\ No newline at end of file
diff --git a/tests/cached/modify-test3.create.dump b/tests/cached/modify-test3.create.dump
new file mode 120000 (symlink)
index 0000000..40519bc
--- /dev/null
@@ -0,0 +1 @@
+../modify-test3.create.dump
\ No newline at end of file
diff --git a/tests/cached/modify-test3.mod1.dump b/tests/cached/modify-test3.mod1.dump
new file mode 120000 (symlink)
index 0000000..155389d
--- /dev/null
@@ -0,0 +1 @@
+../modify-test3.mod1.dump
\ No newline at end of file
diff --git a/tests/cached/modify2-testa-create.dump b/tests/cached/modify2-testa-create.dump
new file mode 120000 (symlink)
index 0000000..e9735ae
--- /dev/null
@@ -0,0 +1 @@
+../modify2-testa-create.dump
\ No newline at end of file
diff --git a/tests/cached/modify2-testb-mod1.dump b/tests/cached/modify2-testb-mod1.dump
new file mode 120000 (symlink)
index 0000000..0a318f5
--- /dev/null
@@ -0,0 +1 @@
+../modify2-testb-mod1.dump
\ No newline at end of file
diff --git a/tests/cached/modify2-testc-mod1.dump b/tests/cached/modify2-testc-mod1.dump
new file mode 120000 (symlink)
index 0000000..072d8e4
--- /dev/null
@@ -0,0 +1 @@
+../modify2-testc-mod1.dump
\ No newline at end of file
diff --git a/tests/cached/modify4-testa-create.dump b/tests/cached/modify4-testa-create.dump
new file mode 120000 (symlink)
index 0000000..17dda1f
--- /dev/null
@@ -0,0 +1 @@
+../modify4-testa-create.dump
\ No newline at end of file
diff --git a/tests/cached/modify4-testa1-create.dump b/tests/cached/modify4-testa1-create.dump
new file mode 120000 (symlink)
index 0000000..0e24b9a
--- /dev/null
@@ -0,0 +1 @@
+../modify4-testa1-create.dump
\ No newline at end of file
diff --git a/tests/cached/modify4-testa2-create.dump b/tests/cached/modify4-testa2-create.dump
new file mode 120000 (symlink)
index 0000000..eb6de45
--- /dev/null
@@ -0,0 +1 @@
+../modify4-testa2-create.dump
\ No newline at end of file
diff --git a/tests/cached/modify5-testa1-create.dump b/tests/cached/modify5-testa1-create.dump
new file mode 120000 (symlink)
index 0000000..ea341b0
--- /dev/null
@@ -0,0 +1 @@
+../modify5-testa1-create.dump
\ No newline at end of file
diff --git a/tests/cached/modify5-testa2-create.dump b/tests/cached/modify5-testa2-create.dump
new file mode 120000 (symlink)
index 0000000..a78b4f5
--- /dev/null
@@ -0,0 +1 @@
+../modify5-testa2-create.dump
\ No newline at end of file
diff --git a/tests/cached/pdp-calc1-1-avg-300.output b/tests/cached/pdp-calc1-1-avg-300.output
new file mode 120000 (symlink)
index 0000000..fbe0f12
--- /dev/null
@@ -0,0 +1 @@
+../pdp-calc1-1-avg-300.output
\ No newline at end of file
diff --git a/tests/cached/pdp-calc1-1-avg-60.output b/tests/cached/pdp-calc1-1-avg-60.output
new file mode 120000 (symlink)
index 0000000..3d9b190
--- /dev/null
@@ -0,0 +1 @@
+../pdp-calc1-1-avg-60.output
\ No newline at end of file
diff --git a/tests/cached/pdp-calc1-1-max-300.output b/tests/cached/pdp-calc1-1-max-300.output
new file mode 120000 (symlink)
index 0000000..88a3c75
--- /dev/null
@@ -0,0 +1 @@
+../pdp-calc1-1-max-300.output
\ No newline at end of file
diff --git a/tests/cached/rpn1.output b/tests/cached/rpn1.output
new file mode 120000 (symlink)
index 0000000..8175506
--- /dev/null
@@ -0,0 +1 @@
+../rpn1.output
\ No newline at end of file
diff --git a/tests/cached/rpn2.output b/tests/cached/rpn2.output
new file mode 120000 (symlink)
index 0000000..c80e432
--- /dev/null
@@ -0,0 +1 @@
+../rpn2.output
\ No newline at end of file
diff --git a/tests/cached/tune1-testa-mod1.dump b/tests/cached/tune1-testa-mod1.dump
new file mode 120000 (symlink)
index 0000000..c6dc014
--- /dev/null
@@ -0,0 +1 @@
+../tune1-testa-mod1.dump
\ No newline at end of file
diff --git a/tests/cached/tune1-testa-mod2.dump b/tests/cached/tune1-testa-mod2.dump
new file mode 120000 (symlink)
index 0000000..cf9fc84
--- /dev/null
@@ -0,0 +1 @@
+../tune1-testa-mod2.dump
\ No newline at end of file
diff --git a/tests/cached/tune1-testorg.dump b/tests/cached/tune1-testorg.dump
new file mode 120000 (symlink)
index 0000000..194cb5a
--- /dev/null
@@ -0,0 +1 @@
+../tune1-testorg.dump
\ No newline at end of file
diff --git a/tests/cached/tune2-testa-mod1.dump b/tests/cached/tune2-testa-mod1.dump
new file mode 120000 (symlink)
index 0000000..a2fd80c
--- /dev/null
@@ -0,0 +1 @@
+../tune2-testa-mod1.dump
\ No newline at end of file
diff --git a/tests/cached/tune2-testorg.dump b/tests/cached/tune2-testorg.dump
new file mode 120000 (symlink)
index 0000000..54fcc48
--- /dev/null
@@ -0,0 +1 @@
+../tune2-testorg.dump
\ No newline at end of file
diff --git a/tests/cached/xport1.json.output b/tests/cached/xport1.json.output
new file mode 120000 (symlink)
index 0000000..def59d5
--- /dev/null
@@ -0,0 +1 @@
+../xport1.json.output
\ No newline at end of file
diff --git a/tests/cached/xport1.xml.output b/tests/cached/xport1.xml.output
new file mode 120000 (symlink)
index 0000000..574497e
--- /dev/null
@@ -0,0 +1 @@
+../xport1.xml.output
\ No newline at end of file
index a247510421e164093113d33a761be5c1c7b7fa4f..ac4f9c6ae093f78ac78d7cb0fee5848f9f3a927a 100755 (executable)
@@ -33,7 +33,7 @@ rm -f ${PREFIX}*.rrd ${PREFIX}*.xml
 $RRDTOOL create ${PREFIX}ax1.rrd --start $(($ST-1)) --step 60 DS:a:GAUGE:120:0:U DS:b:COUNTER:120:0:U $RRA
 report createax1
 
-cp ${PREFIX}ax1.rrd ${PREFIX}ax1-copy.rrd
+cp ${BASE}ax1.rrd ${BASE}ax1-copy.rrd
 
 UPDATEAx1=
 V=10
index 36dc7cbcd3f283dea2ec23014d48196eed1ab741..e6ffbca591b7bf6c7d240f388b3000645c661b1d 100755 (executable)
@@ -41,7 +41,7 @@ $RRDTOOL update ${PREFIX}a1.rrd  $UPDATE
 $RRDTOOL create ${PREFIX}a2.rrd --start $ST --step 60 --source ${PREFIX}a1.rrd DS:a:GAUGE:120:0:U  RRA:AVERAGE:0.5:1:100 RRA:AVERAGE:0.5:5:2 RRA:MIN:0.5:5:2 RRA:MAX:0.5:5:2 RRA:LAST:0.5:5:2 
 report create-with-source-1
 
-[ -f ${PREFIX}a2.rrd ] || fail "file is missing!!"
+[ -f ${BASE}a2.rrd ] || fail "file is missing!!"
 
 $RRDTOOL dump ${PREFIX}a1.rrd > ${PREFIX}a1.xml
 $RRDTOOL dump ${PREFIX}a2.rrd > ${PREFIX}a2.xml
index 975f49c85af55de31e70ca5cb8259ce71decff7d..4db2e4647a92647b8cb82153fd78e5b28a82c6c4 100755 (executable)
@@ -29,7 +29,7 @@ ST=$FIRST
 
 
 
-rm -f ${PREFIX}*.rrd ${PREFIX}*.xml
+rm -f ${BASE}*.rrd ${BASE}*.xml
 $RRDTOOL create ${PREFIX}a1_x.rrd --start $(($ST-1)) --step 60 DS:a:GAUGE:120:0:U  RRA:AVERAGE:0.5:1:100 RRA:AVERAGE:0.5:5:2 RRA:MIN:0.5:5:2 RRA:MAX:0.5:5:2 RRA:LAST:0.5:5:2 
 report createa1
 
@@ -45,8 +45,8 @@ report createba1
 $RRDTOOL create ${PREFIX}bca1_x.rrd --start $(($ST-1)) --step 60 DS:b:GAUGE:120:0:U DS:c:GAUGE:120:0:U DS:a:GAUGE:120:0:U  RRA:AVERAGE:0.5:1:100 RRA:AVERAGE:0.5:5:2 RRA:MIN:0.5:5:2 RRA:MAX:0.5:5:2 RRA:LAST:0.5:5:2 
 report createbca1
 
-for A in ${PREFIX}*_x.rrd ; do
-       cp $A $(basename $A _x.rrd)_y.rrd
+for A in ${BASE}*_x.rrd ; do
+       cp $A ${BASEDIR}/$(basename $A _x.rrd)_y.rrd
 done
 
 
index 42c318b9014b84bfd172eaa617dc751a6ee29e1b..17b1c3dbf92da7d3c246f8a75f71a2eb942acfdf 100755 (executable)
@@ -73,15 +73,15 @@ report create-ab-with-two-sources
 
 # now calculate average and standard deviation
 
-AB1=$($RRDTOOL graph ${PREFIX}ab1.png --imginfo '' --end "$ST" --start end-1h DEF:a=${PREFIX}ab1.rrd:a:AVERAGE  DEF:b=${PREFIX}ab1.rrd:b:AVERAGE CDEF:c=b,2,/,a,/ VDEF:s=c,STDEV VDEF:cavg=c,AVERAGE PRINT:s:%lg PRINT:cavg:%lg)
-AB2=$($RRDTOOL graph ${PREFIX}ab2.png --imginfo '' --end "$ST" --start end-1h DEF:a=${PREFIX}ab2.rrd:a:AVERAGE  DEF:b=${PREFIX}ab2.rrd:b:AVERAGE CDEF:c=b,2,/,a,/ VDEF:s=c,STDEV VDEF:cavg=c,AVERAGE PRINT:s:%lg PRINT:cavg:%lg)
-
+AB1=$($RRDTOOL graph ${PREFIX}ab1.png --imginfo '%s%lu%lu' --end "$ST" --start end-1h DEF:a=${PREFIX}ab1.rrd:a:AVERAGE  DEF:b=${PREFIX}ab1.rrd:b:AVERAGE CDEF:c=b,2,/,a,/ VDEF:s=c,STDEV VDEF:cavg=c,AVERAGE PRINT:s:%lg PRINT:cavg:%lg)
+AB2=$($RRDTOOL graph ${PREFIX}ab2.png --imginfo '%s%lu%lu' --end "$ST" --start end-1h DEF:a=${PREFIX}ab2.rrd:a:AVERAGE  DEF:b=${PREFIX}ab2.rrd:b:AVERAGE CDEF:c=b,2,/,a,/ VDEF:s=c,STDEV VDEF:cavg=c,AVERAGE PRINT:s:%lg PRINT:cavg:%lg)
+echo $AB1
 set -- $AB1
-STDEV1=$1
-AVG1=$2
+STDEV1=$2
+AVG1=$3
 set -- $AB2
-STDEV2=$1
-AVG2=$2
+STDEV2=$2
+AVG2=$3
 
 [ $AVG1 = 1 ] ; report average ab1 == 1
 [ $(dc <<< "$AVG2 1 - 10000 * 1 / p") -lt 10 ] ; report "average ab2 ($AVG2 - 1) < 1/1000"
index a3fa769453b4212934ddf44b6624f2d019d488b7..8b95d274343ae0d80e572789c44496549d4f1cf5 100755 (executable)
@@ -18,7 +18,7 @@ for A in $(seq $ST 60 $(($ST + 60*($CNT - 1))) ) ; do
        ST=$A
        $RRDTOOL update ${BUILD}a1.rrd  $A:$V
 
-       rm -f ${BUILD}a1.xml ${BUILD}r1.rrd ${BUILD}r1.xml
+       rm -f ${BASE}a1.xml ${BASE}r1.rrd ${BASE}r1.xml
 
        $RRDTOOL dump ${BUILD}a1.rrd ${BUILD}a1.xml
        $RRDTOOL restore ${BUILD}a1.xml ${BUILD}r1.rrd
index b87538dbefebf2e73596c78bb02944bd46df5e83..b5526ce88ef0255e606ed384c97dc6fd8418e4e7 100644 (file)
@@ -138,10 +138,76 @@ function run_cached {
         stop_cached
 
         local ADDR
-        ADDR="unix:$BASEDIR/$(basename $0)-rrdcached.sock"
+        if [ $RRDCACHED_SOCK == "unix" ]; then
+            export BASEDIR="${BUILDDIR}/cached"
+            export BUILDDIR="${BASEDIR}"
+            ADDR="unix:$BASEDIR/$(basename $0)-rrdcached.sock"
+        else
+            export BASEDIR="${BUILDDIR}/cached"
+            export RRDCACHED_STRIPPATH="${BUILDDIR}"
+
+            function RRDTOOLCOMPAT() {
+                RRDCACHED_STRIPPATH=${BUILDDIR}
+                RRDTOOL_ORIG=$TOP_BUILDDIR/src/rrdtool
+                ARGS=("$@")
+
+                # rrdcached does not support update with remote template
+                if [ $1 == "update" ] && [ $3 == '--template' ]; then
+                    RRDCACHED_STRIPPATH=${BASEDIR}
+                    ARGS=( $(sed "s#${BUILDDIR}#${BASEDIR}#" <<< "${ARGS[@]}") )
+                fi
+
+                # rrdcached does not support remote dump
+                if [ $1 == "dump" ]; then
+                    RRDCACHED_STRIPPATH=${BUILDDIR} $RRDTOOL_ORIG flushcached $2 || fail flushcached
+                    ARGS=( $(sed "s#${BUILDDIR}#${BASEDIR}#" <<< "${ARGS[@]}") )
+                    RRDCACHED_STRIPPATH=${BASEDIR}
+                fi
+
+                # rrdcached does not support remote restore
+                if [ $1 == "restore" ]; then
+                    ARGS=( "restore" "$2" $(sed "s#${BUILDDIR}#${BASEDIR}#" <<< $3) )
+                    RRDCACHED_STRIPPATH=${BASEDIR}
+                fi
+
+                # rrdcached does not support tune
+                # if [ $1 == "tune" ]; then
+                #     ARGS=( $(sed "s#${BUILDDIR}#${BASEDIR}#" <<< "${ARGS[@]}") )
+                # fi
+
+                # rrdcached does not support create with remote source or template
+                if [ $1 == "create" ]; then
+                    NEWARGS=()
+                    IS_NEXT_SOURCE_TEMPLATE=0
+                    for arg in $(echo "${ARGS[@]}"); do
+                        if [ $IS_NEXT_SOURCE_TEMPLATE == "1" ]; then
+                            arg=$(sed "s#${BUILDDIR}#${BASEDIR}#" <<< $arg)
+                            IS_NEXT_SOURCE_TEMPLATE=0
+                        fi
+                        ([ $arg == "--source" ] || [ $arg == "--template" ]) && IS_NEXT_SOURCE_TEMPLATE=1
+                        NEWARGS+="$arg "
+                    done
+                    ARGS=( ${NEWARGS[@]} )
+                fi
+
+                $RRDTOOL_ORIG "${ARGS[@]}"
+                ret=$?
+
+                if [ $1 == "update" ]; then
+                    RRDCACHED_STRIPPATH=${BUILDDIR} $RRDTOOL_ORIG flushcached $2 || fail flushcached
+                fi
+
+                return $ret
+            }
+            export RRDTOOL=RRDTOOLCOMPAT
+
+            randport=$(python -S -c "import random; random.seed('$(basename $0)'); print(random.randrange(49152,65535))")
+            ADDR="localhost:$randport"
+        fi
+
         CACHED_PID_FILE="$BASEDIR/$(basename $0)-rrdcached.pid"
 
-        $CACHED -p "$CACHED_PID_FILE" -l "$ADDR" -b "$(readlink -f -- $BASEDIR)" -F
+        $CACHED -p "$CACHED_PID_FILE" -l "$ADDR" -b "$(readlink -f -- $BASEDIR)" -F -B
 
         RRDCACHED_ADDRESS=$ADDR
         export RRDCACHED_ADDRESS
@@ -179,9 +245,15 @@ if [ -z "$RRDTOOL" ] ; then
         NEED_CACHED=
         for ST in $TESTS_STYLE ; do
                 case "$ST" in
-                rrdcached)
+                rrdcached-unix)
+                        NEED_CACHED=1
+                        STANDARD_RRDCACHED="$RRDCACHED"
+                        RRDCACHED_SOCK=unix
+                        ;;
+                rrdcached-tcp)
                         NEED_CACHED=1
                         STANDARD_RRDCACHED="$RRDCACHED"
+                        RRDCACHED_SOCK=tcp
                         ;;
                 valgrind)
                         RRDTOOL="valgrind $TOP_BUILDDIR/src/rrdtool"
index e0035d5efd463a817afe92eadc0ab3b9fa051ef1..6c903018bf34771aabd0e7e223c7c7350e73d9fc 100755 (executable)
@@ -2,7 +2,10 @@
 
 . $(dirname $0)/functions
 
-RRD=graph1.rrd
+BASE=$BASEDIR/
+BUILD=$BUILDDIR/
+
+RRD=${BUILD}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"
index c4fe85b29221f809f30cf667c7e0fe0ce6522b02..0cb8c9d8f03317bcb9adbcec6173d54a48155ee4 100755 (executable)
@@ -86,9 +86,11 @@ else
 fi
 
 if is_cached; then
-        mkdir -p "$LIST_DIR"
+        PWD_TEMP="$PWD"
         # This relies on '-b' setting in functions::run_cached()
-        CACHED_DIR=`echo "$LIST_DIR" | sed "s|^$BASEDIR||"`
+        CACHED_DIR=`echo "$LIST_DIR" | sed "s|^$BUILDDIR||"`
+        cd "$BASEDIR" && mkdir -p ".$CACHED_DIR"
+        $RRDTOOL create ${BUILD}.rrd --start 1300000000 --step 60s DS:dv:DDERIVE:300:U:U DS:wh:DCOUNTER:300:0:U RRA:AVERAGE:0.5:1:600 RRA:AVERAGE:0.5:10:144
         do_list_tests "$CACHED_DIR"
 
         # rrdcached-specific tests
@@ -97,7 +99,8 @@ if is_cached; then
         test $list_count -eq 0
         report "escape from cached basedir via symlink denied"
 
-        rm -rf "$LIST_DIR"
+        rm -rf ".$CACHED_DIR"
+        cd "$PWD_TEMP"
         stop_cached || true
 else
         echo "rrdcached not started - skipping"
index d6b288db8c2f5cfb167b0cce11e442d9302e9b36..3d86155e05e2b48a86b723df59de88cb436669e9 100755 (executable)
@@ -14,11 +14,12 @@ for T in $(seq 1300000020 60 1300003020) ; do
        let N=$N+10
 done
 
+
 $RRDTOOL dump ${BUILD}a.rrd | $DIFF9 - ${BASE}.create.dump 
 report "created content"
 
 # extend base RRA, refill from coarse RRA
-cp ${BUILD}a.rrd ${BUILD}b.rrd
+cp ${BASE}a.rrd ${BASE}b.rrd
 $RRDTOOL tune ${BUILD}b.rrd RRA#0:+10 || fail "tune"
 $RRDTOOL dump ${BUILD}b.rrd | $DIFF9 - ${BASE}.mod1.dump 
 report "extend base RRA"
index dbc02f01e580c474a834dd9db4e7061a260d65f5..4d72718e2d8e7cd66d854c38de6ba297759233fa 100755 (executable)
@@ -17,12 +17,12 @@ done
 $RRDTOOL dump ${BUILD}a.rrd | $DIFF9 ${BASE}a-create.dump -
 report create
 
-cp ${BUILD}a.rrd ${BUILD}b.rrd
+cp ${BASE}a.rrd ${BASE}b.rrd
 $RRDTOOL tune ${BUILD}b.rrd RRA#1:+10 RRA#2:+10 RRA#3:+10 RRA#4:+10 || fail modify
 $RRDTOOL dump ${BUILD}b.rrd | $DIFF9 ${BASE}b-mod1.dump -
 report "simultaneously extend aggregate RRAs"
 
-cp ${BUILD}a.rrd ${BUILD}c.rrd
+cp ${BASE}a.rrd ${BASE}c.rrd
 $RRDTOOL tune ${BUILD}c.rrd RRA:AVERAGE:0.5:2:10 || fail modify
 $RRDTOOL dump ${BUILD}c.rrd | $DIFF9 ${BASE}c-mod1.dump -
 report "add RRA with intermediate pdp_cnt"
index a065fae0da00d77811983591bfc21f30d9a1c228..3023d6ac584f5fee602e92f9c0e04357c1a1d8d1 100755 (executable)
@@ -16,7 +16,7 @@ done
 $RRDTOOL dump ${BUILD}a.rrd | $DIFF9 - ${BASE}.create.dump && ok "create" || fail "create"
 
 # extend base RRA, refill from coarse RRA
-cp ${BUILD}a.rrd ${BUILD}b.rrd
+cp ${BASE}a.rrd ${BASE}b.rrd
 $RRDTOOL tune ${BUILD}b.rrd DEL:a RRA#0:+10 || fail modify
 
 $RRDTOOL dump ${BUILD}b.rrd | $DIFF9 - ${BASE}.mod1.dump && ok "extend base RRA" || fail "extend base RRA"
index 7e0f4a440cd6882b3f63b11b57b657267c73cad0..28a4efb4067639d41561a2e23c8de13213019a58 100755 (executable)
@@ -30,13 +30,13 @@ report create 1
 $RRDTOOL dump ${BUILD}a2.rrd | $DIFF9 ${BASE}a2-create.dump -
 report create 2
 
-cp ${BUILD}a2.rrd ${BUILD}b2.rrd
+cp ${BASE}a2.rrd ${BASE}b2.rrd
 $RRDTOOL tune ${BUILD}b2.rrd DELRRA:5 || fail modify
 
 $RRDTOOL dump ${BUILD}b2.rrd | $DIFF9 ${BASE}a1-create.dump -
 report "remove additional RRA from second - must then be equal original first"
 
-cp ${BUILD}a1.rrd ${BUILD}b1.rrd
+cp ${BASE}a1.rrd ${BASE}b1.rrd
 $RRDTOOL tune ${BUILD}b1.rrd RRA:AVERAGE:0.5:4:10 || fail modify
 
 $RRDTOOL dump ${BUILD}b1.rrd | $DIFF9 ${BASE}a2-create.dump -
index d4349091538ea7fe8cc8730b132a158f0aade439..373aba2fe3fc27d7021f02459f76a8adb8a99de8 100755 (executable)
@@ -41,14 +41,14 @@ do
        $RRDTOOL dump ${BUILD}a2.rrd > ${BUILD}a2-mod.dump.tmp
        
        # remove RRA 5 from second RRD, should now match first RRD
-       cp ${BUILD}a2.rrd ${BUILD}b2.rrd 
+       cp ${BASE}a2.rrd ${BASE}b2.rrd 
        $RRDTOOL tune ${BUILD}b2.rrd DELRRA:5
 
        $RRDTOOL dump ${BUILD}b2.rrd | diff -u ${BUILD}a1-mod.dump.tmp -
        report "remove additional RRA from second - must then be equal original first"
 
         # add RRA to first RRD, should now match second RRD
-       cp ${BUILD}a1.rrd ${BUILD}b1.rrd
+       cp ${BASE}a1.rrd ${BASE}b1.rrd
        $RRDTOOL tune ${BUILD}b1.rrd RRA:AVERAGE:0.5:4:10
 
        $RRDTOOL dump ${BUILD}b1.rrd | diff -u ${BUILD}a2-mod.dump.tmp -
index 2cbe05c897fbbc691fef988063ef0d39abb8a1da..08c7482a43776a07232b14c8fff5674467631381 100755 (executable)
@@ -2,7 +2,10 @@
 
 . $(dirname $0)/functions
 
-RRD=rpn1.rrd
+BASE=$BASEDIR/
+BUILD=$BUILDDIR/
+
+RRD=${BUILD}rpn1.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"
index 9b8309adbacc6b9641c7bf00d92a514692bb6461..9f9852f5868d79e18aa1fc13a6985f2b3230703d 100755 (executable)
@@ -2,7 +2,10 @@
 
 . $(dirname $0)/functions
 
-RRD=rpn2.rrd
+BASE=$BASEDIR/
+BUILD=$BUILDDIR/
+
+RRD=${BUILD}rpn2.rrd
 
 $RRDTOOL create $RRD --step 7200 --start 1167487000 DS:speed:DCOUNTER:14000:U:U RRA:AVERAGE:0.5:1:30
 report "create"
index 4835de6ac842a151cfbef5a92d1df53588d1f1fa..5a46b3cd1515b8ee11a4fe37e464216c9c528429 100755 (executable)
@@ -22,7 +22,7 @@ report "update"
 is_cached && ( $RRDTOOL flushcached ${BUILD}org.rrd || fail flushcached)
 
 
-cp ${BUILD}org.rrd ${BUILD}a.rrd
+cp ${BASE}org.rrd ${BASE}a.rrd
 $RRDTOOL tune ${BUILD}a.rrd --heartbeat a:90 --minimum b:U
 $RRDTOOL tune ${BUILD}a.rrd --heartbeat a:90 --minimum b:-100
 $RRDTOOL dump ${BUILD}a.rrd | $DIFF9 - ${BASE}a-mod1.dump
@@ -31,7 +31,7 @@ report "tune heartbeat/minimum"
 # NOTE: for rrdcached based tests, we must flush before we can copy...
 is_cached && ( $RRDTOOL flushcached ${BUILD}org.rrd || fail flushcached )
 
-cp ${BUILD}org.rrd ${BUILD}a.rrd
+cp ${BASE}org.rrd ${BASE}a.rrd
 $RRDTOOL tune ${BUILD}a.rrd --data-source-type a:COUNTER --data-source-rename b:c
 $RRDTOOL dump ${BUILD}a.rrd | $DIFF9 - ${BASE}a-mod2.dump
 report "tune dst/ds-name" 
index f8a9b2261a5a859946fa563969f73730315c759b..a392e12d41d223a94fc7fab1983cdf7f40229a0e 100755 (executable)
@@ -12,7 +12,7 @@ $RRDTOOL dump ${BUILD}org.rrd | $xDIFF9 - ${BASE}org.dump
 report create
 
 is_cached && ( $RRDTOOL flushcached ${BUILD}org.rrd || fail flushcached )
-cp ${BUILD}org.rrd ${BUILD}a.rrd
+cp ${BASE}org.rrd ${BASE}a.rrd
 # this must fail
 ! $RRDTOOL tune ${BUILD}a.rrd --beta 1.4 2>/dev/null
 report "out of range beta error"
index 2f44a675910265ca54d6275e3aeece48fda3fc84..6f01e62134ce3b013b849011a6eb0df236c9061b 100755 (executable)
@@ -2,6 +2,11 @@
 
 . $(dirname $0)/functions
 
+BASE=$BASEDIR/
+BUILD=$BUILDDIR/
+
+RRD=${BUILD}vfmt1.rrd
+
 export TZ=UTC
 
 function rtest() {
@@ -13,10 +18,10 @@ function rtest() {
     #&& echo "OK: $testname" || echo "FAIL: $testname"
 }
 
-$RRDTOOL create vfmt1.rrd --start 1420070400 --step 60s DS:v:GAUGE:60:U:U RRA:LAST:0:1:10 || exit 1
+$RRDTOOL create $RRD --start 1420070400 --step 60s DS:v:GAUGE:60:U:U RRA:LAST:0:1:10 || exit 1
 
 declare -a graphargs
-graphargs=(graph /dev/null --start 1420070400 --end 1420071000 'DEF:dv=vfmt1.rrd:v:LAST' 'VDEF:v=dv,LAST')
+graphargs=(graph /dev/null --start 1420070400 --end 1420071000 "DEF:dv=$RRD:v:LAST" 'VDEF:v=dv,LAST')
 
 rtest "No data, numeric" '0x0\nnan' "${graphargs[@]}" 'PRINT:v:%0.1lf'
 
@@ -27,7 +32,7 @@ rtest "No data, value timestamp" '0x0\nnan' "${graphargs[@]}" 'PRINT:v:%F %T:val
 rtest "No data, value duration" '0x0\nnan' "${graphargs[@]}" 'PRINT:v::valstrfduration'
 
 
-$RRDTOOL update vfmt1.rrd --template v -- 1420070460:0 || exit 1
+$RRDTOOL update $RRD --template v -- 1420070460:0 || exit 1
 
 rtest "Zero, numeric" '0x0\n0.0' "${graphargs[@]}" 'PRINT:v:%0.1lf'
 
@@ -37,7 +42,7 @@ rtest "Zero, value timestamp" '0x0\n1970-01-01 00:00:00' "${graphargs[@]}" 'PRIN
 
 rtest "Zero, value duration" '0x0\n0_00_00_000' "${graphargs[@]}" 'PRINT:v:%H_%02m_%02s_%03f:valstrfduration'
 
-$RRDTOOL update vfmt1.rrd --template v -- 1420070520:3000 || exit 1
+$RRDTOOL update $RRD --template v -- 1420070520:3000 || exit 1
 
 rtest "3000, numeric" '0x0\n3000.0' "${graphargs[@]}" 'PRINT:v:%0.1lf'