Move tests to gitlab
This commit is contained in:
parent
99a3f37e5f
commit
a6fff80b7e
9 changed files with 7 additions and 167 deletions
3
main.fmf
3
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 <rhel-lightspeed-qe@redhat.com>
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -1 +0,0 @@
|
|||
summary: Basic sanity test
|
||||
|
|
@ -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 <COMMAND>'" 2 "Print help, missing argument"
|
||||
rlRun "goosed help | grep 'Usage: goosed <COMMAND>'" 0 "Print help"
|
||||
rlRun "goosed --help | grep 'Usage: goosed <COMMAND>'" 0 "Print help by --help"
|
||||
rlRun "goosed -h | grep 'Usage: goosed <COMMAND>'" 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
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
# QE owner
|
||||
test: ./test.sh
|
||||
framework: beakerlib
|
||||
component:
|
||||
- goose
|
||||
recommend:
|
||||
- goose
|
||||
duration: 10m
|
||||
|
|
@ -1 +0,0 @@
|
|||
summary: Test creation of recipe
|
||||
|
|
@ -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
|
||||
|
|
@ -1 +0,0 @@
|
|||
summary: Test logging
|
||||
|
|
@ -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
|
||||
Loading…
Add table
Add a link
Reference in a new issue