summaryrefslogtreecommitdiffstats
path: root/tests/lifecycle.bats
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2019-02-28 21:16:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2019-02-28 21:16:49 +0000
commitc7191c291b318c93b4db058b7ff820cb7dc44cc7 (patch)
tree8caa842f47708dac599794745b87212e4d71df7b /tests/lifecycle.bats
parentReleasing debian version 1.12.1-2. (diff)
downloadnetdata-c7191c291b318c93b4db058b7ff820cb7dc44cc7.tar.xz
netdata-c7191c291b318c93b4db058b7ff820cb7dc44cc7.zip
Merging upstream version 1.12.2.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/lifecycle.bats')
-rwxr-xr-xtests/lifecycle.bats35
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/lifecycle.bats b/tests/lifecycle.bats
new file mode 100755
index 000000000..d008fea46
--- /dev/null
+++ b/tests/lifecycle.bats
@@ -0,0 +1,35 @@
+#!/usr/bin/env bats
+
+INSTALLATION="$BATS_TMPDIR/installation"
+ENV="${INSTALLATION}/netdata/etc/netdata/.environment"
+# list of files which need to be checked. Path cannot start from '/'
+FILES="usr/libexec/netdata/plugins.d/go.d.plugin
+ usr/libexec/netdata/plugins.d/charts.d.plugin
+ usr/libexec/netdata/plugins.d/python.d.plugin
+ usr/libexec/netdata/plugins.d/node.d.plugin"
+
+setup() {
+ if [ ! -f .gitignore ]; then
+ echo "Run as ./tests/lifecycle/$(basename "$0") from top level directory of git repository"
+ exit 1
+ fi
+}
+
+@test "install netdata" {
+ ./netdata-installer.sh --dont-wait --dont-start-it --auto-update --install "${INSTALLATION}"
+ for file in $FILES; do
+ [ ! -f "$BATS_TMPDIR/$file" ]
+ done
+}
+
+@test "update netdata" {
+ export ENVIRONMENT_FILE="${ENV}"
+ /etc/cron.daily/netdata-updater
+ ! grep "new_installation" "${ENV}"
+}
+
+@test "uninstall netdata" {
+ ./packaging/installer/netdata-uninstaller.sh --yes --force --env "${ENV}"
+ [ ! -f "${INSTALLATION}/netdata/usr/sbin/netdata" ]
+ [ ! -f "/etc/cron.daily/netdata-updater" ]
+}