diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/plans/example.fmf b/plans/example.fmf new file mode 100644 index 0000000..2b7c5e4 --- /dev/null +++ b/plans/example.fmf @@ -0,0 +1,12 @@ +summary: Essential command line features +discover: + how: fmf +provision: + how: local +prepare: + how: install + package: nextcloud +environment: + PACKAGES: nextcloud +execute: + how: tmt diff --git a/tests/main.fmf b/tests/main.fmf new file mode 100644 index 0000000..44d5508 --- /dev/null +++ b/tests/main.fmf @@ -0,0 +1,6 @@ +contact: Christopher Engelhard +test: ./test.sh +framework: beakerlib +component: nextcloud +duration: 5m +tier: 2 diff --git a/tests/occ/main.fmf b/tests/occ/main.fmf new file mode 100644 index 0000000..142a529 --- /dev/null +++ b/tests/occ/main.fmf @@ -0,0 +1,5 @@ +summary: Basic test of occ cli +description: >- + Performs basic tests of Nextcloud's occ CLI utility. Tries to get installation + version and status as well as perform post-install tasks using occ. +tier: 1 diff --git a/tests/occ/test.sh b/tests/occ/test.sh new file mode 100755 index 0000000..dd0e2ac --- /dev/null +++ b/tests/occ/test.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGES=${PACKAGES:-"nextcloud"} + +installdir="/usr/share/nextcloud" +datadir="/var/lib/nextcloud/data" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm --all + rlAssertExists "$installdir" + rlAssertExists "$datadir" + rlRun "pushd $installdir" 0 "Switch to nextcloud directory" + rlPhaseEnd + + rlPhaseStartTest + rlLog "Testing basic occ functionality" + rlRun -s "sudo -u apache php occ status" 0 "Run 'occ status'" + rlAssertGrep "versionstring: $VERSION" "$rlRun_LOG" + rlAssertGrep "installed: false" "$rlRun_LOG" + rlRun -s "sudo -u apache php occ maintenance:install --data-dir=$datadir --admin-pass=admin" 0 "Run 'occ maintenance:install'" + rlAssertGrep "successfully installed" "$rlRun_LOG" + rlRun -s "sudo -u apache php occ status" 0 "Check install status" + rlAssertGrep "installed: true" "$rlRun_LOG" + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "rm $rlRun_LOG" + rlRun "popd" + rlPhaseEnd +rlJournalEnd