- Add CI tests
This commit is contained in:
parent
d8d98431bc
commit
63a7b4fb0c
26
tests/run_tests.sh
Executable file
26
tests/run_tests.sh
Executable file
@ -0,0 +1,26 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
err=0
|
||||||
|
|
||||||
|
agents=$(pcs resource list ocf:heartbeat 2>&1)
|
||||||
|
if [ $(echo "$agents" | wc -l) -lt 2 ]; then
|
||||||
|
echo "ERROR: pcs: agents available:\n$agents"
|
||||||
|
err=$((err+1))
|
||||||
|
else
|
||||||
|
echo "INFO: pcs: agents available..."
|
||||||
|
fi
|
||||||
|
|
||||||
|
for bin in aliyuncli-ra "gcloud-ra -v"; do
|
||||||
|
output="$($bin 2>&1)"
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo -e "ERROR: $bin failed:\n$output"
|
||||||
|
err=$((err+1))
|
||||||
|
else
|
||||||
|
echo "INFO: $bin works..."
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ $err -ge 1 ]; then
|
||||||
|
echo -e "\nERROR: $err tests FAILED..."
|
||||||
|
exit 1
|
||||||
|
fi
|
16
tests/tests.yml
Normal file
16
tests/tests.yml
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
- hosts: localhost
|
||||||
|
roles:
|
||||||
|
- role: standard-test-basic
|
||||||
|
tags:
|
||||||
|
- classic
|
||||||
|
- container
|
||||||
|
required_packages:
|
||||||
|
- resource-agents
|
||||||
|
- resource-agents-aliyun
|
||||||
|
- resource-agents-gcp
|
||||||
|
- pcs
|
||||||
|
|
||||||
|
tests:
|
||||||
|
- subpackage_tests:
|
||||||
|
dir: .
|
||||||
|
run: ./run_tests.sh
|
Loading…
Reference in New Issue
Block a user