diff --git a/main.fmf b/main.fmf index 0b66ee4..4476d69 100644 --- a/main.fmf +++ b/main.fmf @@ -1,2 +1,3 @@ -# QE owner +# Goose tests - imported from GitLab +# Source: https://gitlab.com/redhat/centos-stream/tests/goose contact: RHEL Lightspeed QE diff --git a/plans/main.fmf b/plans/main.fmf index a911077..eab28fb 100644 --- a/plans/main.fmf +++ b/plans/main.fmf @@ -1,7 +1,5 @@ -summary: General test plan - -discover: - how: fmf - -execute: - how: tmt +# Import plans from GitLab +import: + url: https://gitlab.com/redhat/centos-stream/tests/goose + ref: main + name: /plans diff --git a/tests/basic-sanity/main.fmf b/tests/basic-sanity/main.fmf deleted file mode 100644 index 5963134..0000000 --- a/tests/basic-sanity/main.fmf +++ /dev/null @@ -1 +0,0 @@ -summary: Basic sanity test diff --git a/tests/basic-sanity/test.sh b/tests/basic-sanity/test.sh deleted file mode 100755 index 0863b7a..0000000 --- a/tests/basic-sanity/test.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/bash -# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k -. /usr/share/beakerlib/beakerlib.sh || exit 1 - -#Files to be checked for their existence -files=(/bin/goose /bin/goosed /goose/GOVERNANCE.md /goose/README.md /goose/SECURITY.md /goose/LICENSE) -testUser=test$RANDOM - -rlJournalStart - rlPhaseStartSetup - rlRun "tmp=\$(mktemp -d)" 0 "Create tmp directory" - rlRun "pushd $tmp" - rlRun "set -o pipefail" - rlRun "useradd $testUser" - rlPhaseEnd - - rlPhaseStartTest "RPM commands" - rlRun "rpm -q --changelog goose | grep rodolfo" 0 "Test changelog" - rlRun "rpm -V goose" - rlRun "rpm -qi goose | grep goose" - rlPhaseEnd - - rlPhaseStartTest "File existence" - for i in ${files[@]}; do - rlRun "rpm -ql goose | grep $i" - done - rlPhaseEnd - - rlPhaseStartTest "goose version" - rlRun "echo `rpm -q goose` | grep `goose --version`" 0 "Check that goose version is same as rpm version" - rlRun "echo `rpm -q goose` | grep `goose -V`" 0 "Check that goose version is same as rpm version" - rlPhaseEnd - - rlPhaseStartTest "goosed commands" - rlRun "goosed 2>&1 | grep 'Usage: goosed '" 2 "Print help, missing argument" - rlRun "goosed help | grep 'Usage: goosed '" 0 "Print help" - rlRun "goosed --help | grep 'Usage: goosed '" 0 "Print help by --help" - rlRun "goosed -h | grep 'Usage: goosed '" 0 "Print help by -h" - rlPhaseEnd - - rlPhaseStartTest "Non-root user $testUser files" - rlRun "su -c 'goose info' $testUser >gooseInfo" 0 - configYaml="$(cat gooseInfo | grep 'Config yaml' | awk '{print $3}')" - logsDir="$(cat gooseInfo | grep 'Logs dir' | awk '{print $3}')" - for file in $configYaml $logsDir; do - rlRun 'ls -l $file | grep "$testUser $testUser"' 0 "Check file existence and owner" - done - rlPhaseEnd - - rlPhaseStartTest "Root user files" - rlRun "goose info >gooseInfo" 0 - configYaml="$(cat gooseInfo | grep 'Config yaml' | awk '{print $3}')" - logsDir="$(cat gooseInfo | grep 'Logs dir' | awk '{print $3}')" - for file in $configYaml $logsDir; do - rlRun 'ls -l $file | grep "root root"' 0 "Check file existence and owner" - done - rlPhaseEnd - - rlPhaseStartCleanup - rlRun "userdel $testUser" - rlRun "popd" - rlRun "rm -r $tmp" 0 "Remove tmp directory" - rlPhaseEnd -rlJournalEnd diff --git a/tests/main.fmf b/tests/main.fmf deleted file mode 100644 index aed5cb0..0000000 --- a/tests/main.fmf +++ /dev/null @@ -1,8 +0,0 @@ -# QE owner -test: ./test.sh -framework: beakerlib -component: - - goose -recommend: - - goose -duration: 10m diff --git a/tests/recipe-validation/main.fmf b/tests/recipe-validation/main.fmf deleted file mode 100644 index 6e380d9..0000000 --- a/tests/recipe-validation/main.fmf +++ /dev/null @@ -1 +0,0 @@ -summary: Test creation of recipe diff --git a/tests/recipe-validation/test.sh b/tests/recipe-validation/test.sh deleted file mode 100755 index 307ed97..0000000 --- a/tests/recipe-validation/test.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash -# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k -. /usr/share/beakerlib/beakerlib.sh || exit 1 - -recipeFile=recipe$RANDOM.yaml - -rlJournalStart - rlPhaseStartSetup - rlRun "tmp=\$(mktemp -d)" 0 "Create tmp directory" - rlRun "pushd $tmp" - rlRun "set -o pipefail" - rlPhaseEnd - - rlPhaseStartTest "Test recipe validation" - rlRun "goose recipe validate $recipeFile 2>&1 | tee out" 1 - rlRun "cat out | grep 'No such file or directory'" - rlRun "touch $recipeFile" - rlRun "goose recipe validate $recipeFile 2>&1 | tee out" 1 - rlRun "cat out | grep 'missing field `title`'" - rlRun "echo 'title: Test title' >>$recipeFile" - rlRun "goose recipe validate $recipeFile 2>&1 | tee out" 1 - rlRun "cat out | grep 'missing field `description`'" - rlRun "echo 'description: Test description' >>$recipeFile" - rlRun "goose recipe validate $recipeFile 2>&1 | tee out" 1 - rlRun "cat out | grep 'Recipe must specify at least one of'" - rlRun "echo 'instructions: Test instruction' >>$recipeFile" - rlRun "goose recipe validate $recipeFile 2>&1 | tee out" 0 - rlRun "cat out | grep 'recipe file is valid'" - rlPhaseEnd - - rlPhaseStartCleanup - rlRun "popd" - rlRun "rm -r $tmp" 0 "Remove tmp directory" - rlPhaseEnd -rlJournalEnd diff --git a/tests/test-logging/main.fmf b/tests/test-logging/main.fmf deleted file mode 100644 index c8f749e..0000000 --- a/tests/test-logging/main.fmf +++ /dev/null @@ -1 +0,0 @@ -summary: Test logging diff --git a/tests/test-logging/test.sh b/tests/test-logging/test.sh deleted file mode 100755 index c19bebf..0000000 --- a/tests/test-logging/test.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/bash -# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k -. /usr/share/beakerlib/beakerlib.sh || exit 1 - -commands=("goose configure" "goose info" "goose acp" "goose session" "goose project" "goose projects" "goose run" "goose recipe list" "goose schedule list" "goose bench init-config --name test_bench_config" "goose web" "goose term info") - -log=("configure" "info" "acp" "session" "project" "projects" "run" "recipe" "schedule" "bench" "web" "term") - -logDir="$(goose info | grep Logs | awk '{print $3}')/cli/$(date +%Y-%m-%d)" - -testUser=test$RANDOM - -rlJournalStart - rlPhaseStartSetup - rlRun "tmp=\$(mktemp -d)" 0 "Create tmp directory" - rlRun "pushd $tmp" - rlRun "set -o pipefail" - rlRun "useradd $testUser" - rlFileBackup $logDir --clean - rlRun "rm -rf $logDir/*" - rlPhaseEnd - - rlPhaseStartTest "Logging info" - i=0 - for command in "${commands[@]}"; do - rlRun "$command" 0-255 - rlRun "cat $logDir/* | grep ${log[i]}" - i=$((i + 1)) - done - rlPhaseEnd - - rlPhaseStartTest "Logging info as $testUser" - logDir="$(su -c 'goose info' $testUser | grep Logs | awk '{print $3}')/cli/$(date +%Y-%m-%d)" - rlRun "rm -rf $logDir/*" - i=0 - for command in "${commands[@]}"; do - rlRun "su -c \"$command\" $testUser" 0-255 - rlRun "cat $logDir/* | grep ${log[i]}" - i=$((i + 1)) - done - rlPhaseEnd - - rlPhaseStartCleanup - rlFileRestore - rlRun "userdel $testUser" - rlRun "popd" - rlRun "rm -r $tmp" 0 "Remove tmp directory" - rlPhaseEnd -rlJournalEnd