Removing the 'test' directory
BATS framework was the first one to provide integrity tests to puppet module. We don't need it anymore since we have migrated to beaker. Remove the code. Change-Id: Ie6e23a29ac9bd2b33d019eae6839a5e4e26b3ff1
This commit is contained in:
parent
9a54db9438
commit
a4bb534be3
test
19
test/init.pp
19
test/init.pp
@ -1,19 +0,0 @@
|
||||
# The baseline for module testing used by Puppet Labs is that each manifest
|
||||
# should have a corresponding test manifest that declares that class or defined
|
||||
# type.
|
||||
#
|
||||
# Tests are then run by using puppet apply --noop (to check for compilation
|
||||
# errors and view a log of events) or by fully applying the test in a virtual
|
||||
# environment (to compare the resulting system state to the desired state).
|
||||
#
|
||||
# Learn more about module testing here:
|
||||
# http://docs.puppetlabs.com/guides/tests_smoke.html
|
||||
#
|
||||
|
||||
# Fake the facter when it compiles. The augeas version that will be installed
|
||||
# will be this one
|
||||
if empty($::augeasversion) {
|
||||
$augeasversion = '1.0.0'
|
||||
}
|
||||
|
||||
class {'midonet':}
|
@ -1,160 +0,0 @@
|
||||
# Test verify methods for midonet_repository
|
||||
|
||||
command_exists() {
|
||||
command -v "$@" > /dev/null 2>&1
|
||||
}
|
||||
|
||||
# Code copied unashamedly from http://get.docker.io
|
||||
get_distro() {
|
||||
lsb_dist=''
|
||||
if command_exists lsb_release; then
|
||||
lsb_dist="$(lsb_release -si)"
|
||||
fi
|
||||
if [ -z "$lsb_dist" ] && [ -r /etc/lsb-release ]; then
|
||||
lsb_dist="$(. /etc/lsb-release && echo "$DISTRIB_ID")"
|
||||
fi
|
||||
if [ -z "$lsb_dist" ] && [ -r /etc/debian_version ]; then
|
||||
lsb_dist='debian'
|
||||
fi
|
||||
if [ -z "$lsb_dist" ] && [ -r /etc/redhat-release ]; then
|
||||
lsb_dist='red-hat'
|
||||
fi
|
||||
if [ -z "$lsb_dist" ] && [ -r /etc/os-release ]; then
|
||||
lsb_dist="$(. /etc/os-release && echo "$ID")"
|
||||
fi
|
||||
|
||||
distro=$(echo "$lsb_dist" | tr '[:upper:]' '[:lower:]')
|
||||
}
|
||||
|
||||
get_distro
|
||||
|
||||
@test 'midonet repo is set' {
|
||||
|
||||
case $distro in
|
||||
ubuntu)
|
||||
run file /etc/apt/sources.list.d/midonet.list
|
||||
[ "$status" -eq 0 ]
|
||||
run file /etc/apt/sources.list.d/midonet-openstack-integration.list
|
||||
[ "$status" -eq 0 ]
|
||||
;;
|
||||
centos|red-hat)
|
||||
run ls /etc/yum.repos.d/midonet.repo
|
||||
[ "$status" -eq 0 ]
|
||||
run ls /etc/yum.repos.d/midonet-openstack-integration.repo
|
||||
[ "$status" -eq 0 ]
|
||||
;;
|
||||
*)
|
||||
exit 1;
|
||||
esac
|
||||
}
|
||||
|
||||
@test 'midonet packages are available' {
|
||||
case $distro in
|
||||
ubuntu)
|
||||
run bash -c "apt-cache search mido | grep midolman"
|
||||
[ "$status" -eq 0 ]
|
||||
run bash -c "apt-cache search mido | grep midonet-api"
|
||||
[ "$status" -eq 0 ]
|
||||
run bash -c "apt-cache search mido | grep python-midonetclient"
|
||||
[ "$status" -eq 0 ]
|
||||
run bash -c "apt-cache search mido | grep python-neutron-plugin-midonet"
|
||||
[ "$status" -eq 0 ]
|
||||
run bash -c "apt-cache search dsc20"
|
||||
[ "$status" -eq 0 ]
|
||||
;;
|
||||
centos|red-hat)
|
||||
run bash -c "yum search mido | grep midolman"
|
||||
[ "$status" -eq 0 ]
|
||||
run bash -c "yum search mido | grep midonet-api"
|
||||
[ "$status" -eq 0 ]
|
||||
run bash -c "yum search mido | grep python-midonetclient"
|
||||
[ "$status" -eq 0 ]
|
||||
run bash -c "yum search mido | grep python-neutron-plugin-midonet"
|
||||
[ "$status" -eq 0 ]
|
||||
run bash -c "yum search dsc20-2.0.10-1"
|
||||
[ "$status" -eq 0 ]
|
||||
;;
|
||||
*)
|
||||
exit 1;
|
||||
esac
|
||||
}
|
||||
|
||||
@test 'zookeeper is running' {
|
||||
case $distro in
|
||||
ubuntu)
|
||||
run bash -c "sudo /usr/share/zookeeper/bin/zkServer.sh status || sudo /usr/sbin/zkServer.sh status"
|
||||
[ "$status" -eq 0 ]
|
||||
;;
|
||||
centos|red-hat)
|
||||
run sudo /usr/sbin/zkServer.sh status
|
||||
[ "$status" -eq 0 ]
|
||||
;;
|
||||
*)
|
||||
exit 1;
|
||||
esac
|
||||
}
|
||||
|
||||
@test 'cassandra is running' {
|
||||
case $distro in
|
||||
ubuntu)
|
||||
run sudo service cassandra status
|
||||
[ "$status" -eq 0 ]
|
||||
;;
|
||||
centos|red-hat)
|
||||
run sudo service cassandra status
|
||||
[ "$status" -eq 0 ]
|
||||
;;
|
||||
*)
|
||||
exit 1;
|
||||
esac
|
||||
}
|
||||
|
||||
@test 'midonet-agent is running' {
|
||||
case $distro in
|
||||
ubuntu)
|
||||
run sudo service midolman status
|
||||
[ "$status" -eq 0 ]
|
||||
;;
|
||||
centos|red-hat)
|
||||
run sudo service midolman status
|
||||
[ "$status" -eq 0 ]
|
||||
;;
|
||||
*)
|
||||
exit 1;
|
||||
esac
|
||||
}
|
||||
|
||||
@test 'midonet-api is running' {
|
||||
case $distro in
|
||||
ubuntu)
|
||||
run sudo service tomcat7 status
|
||||
[ "$status" -eq 0 ]
|
||||
;;
|
||||
centos|red-hat)
|
||||
run sudo service tomcat status
|
||||
[ "$status" -eq 0 ]
|
||||
;;
|
||||
*)
|
||||
exit 1;
|
||||
esac
|
||||
}
|
||||
|
||||
@test 'midonet-cli is installed' {
|
||||
case $distro in
|
||||
ubuntu)
|
||||
run bash -c "dpkg -l | grep python-midonetclient"
|
||||
[ "$status" -eq 0 ]
|
||||
;;
|
||||
centos|red-hat)
|
||||
run bash -c "rpm -qa | grep python-midonetclient"
|
||||
[ "$status" -eq 0 ]
|
||||
;;
|
||||
*)
|
||||
exit 1;
|
||||
esac
|
||||
}
|
||||
|
||||
@test 'midonetrc file is created' {
|
||||
run bash -c "file /root/.midonetrc"
|
||||
[ "$status" -eq 0 ]
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user