[test] Add opensuse-13 to packaging tests

This gets opensuse-13 working with vagrant and the packaging tests. They pass
with some minor tweaks.

Closes #13507
This commit is contained in:
Nik Everett 2015-09-15 17:20:53 -04:00
parent f62da59ed4
commit 058d385942
4 changed files with 27 additions and 9 deletions

16
Vagrantfile vendored
View File

@ -68,11 +68,16 @@ Vagrant.configure(2) do |config|
config.vm.box = "boxcutter/fedora22"
dnf_common config
end
config.vm.define "opensuse-13" do |config|
config.vm.box = "chef/opensuse-13"
config.vm.box_url = "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_opensuse-13.2-x86_64_chef-provisionerless.box"
suse_common config
end
# Switch the default share for the project root from /vagrant to
# /elasticsearch because /vagrant is confusing when there is a project inside
# the elasticsearch project called vagrant....
config.vm.synced_folder ".", "/vagrant", disabled: true
config.vm.synced_folder "", "/elasticsearch"
config.vm.synced_folder ".", "/elasticsearch"
if Vagrant.has_plugin?("vagrant-cachier")
config.cache.scope = :box
end
@ -150,6 +155,14 @@ def dnf_common(config)
end
end
def suse_common(config)
provision(config,
update_command: "zypper --non-interactive list-updates",
update_tracking_file: "/var/cache/zypp/packages/last_update",
install_command: "zypper --non-interactive --quiet install --no-recommends",
java_package: "java-1_8_0-openjdk-devel")
end
# Register the main box provisioning script.
# @param config Vagrant's config object. Required.
# @param update_command [String] The command used to update the package
@ -194,6 +207,7 @@ def provision(config,
#{extra}
installed java || install #{java_package}
ensure tar
ensure curl
ensure unzip

View File

@ -21,7 +21,7 @@
<testCommand>sudo bats $BATS/${testScripts}</testCommand>
<allDebBoxes>precise, trusty, vivid, jessie</allDebBoxes>
<allRpmBoxes>centos-6, centos-7, fedora-22, oel-7</allRpmBoxes>
<allRpmBoxes>centos-6, centos-7, oel-7, fedora-22, opensuse-13</allRpmBoxes>
<defaultDebBoxes>trusty</defaultDebBoxes>
<defaultRpmBoxes>centos-7</defaultRpmBoxes>

View File

@ -99,23 +99,27 @@ setup() {
@test "[SYSTEMD] stop (running)" {
systemctl stop elasticsearch.service
}
@test "[SYSTEMD] status (stopping)" {
run systemctl status elasticsearch.service
[ "$status" -eq 3 ] || "Expected exit code 3 meaning stopped"
# I'm not sure why suse exits 0 here, but it does
if [ ! -e /etc/SuSE-release ]; then
[ "$status" -eq 3 ] || "Expected exit code 3 meaning stopped but got $status"
fi
echo "$output" | grep "Active:" | grep "inactive"
}
@test "[SYSTEMD] stop (stopped)" {
systemctl stop elasticsearch.service
run systemctl status elasticsearch.service
[ "$status" -eq 3 ] || "Expected exit code 3 meaning stopped"
echo "$output" | grep "Active:" | grep "inactive"
}
@test "[SYSTEMD] status (stopped)" {
run systemctl status elasticsearch.service
[ "$status" -eq 3 ] || "Expected exit code 3 meaning stopped"
# I'm not sure why suse exits 0 here, but it does
if [ ! -e /etc/SuSE-release ]; then
[ "$status" -eq 3 ] || "Expected exit code 3 meaning stopped but got $status"
fi
echo "$output" | grep "Active:" | grep "inactive"
}

View File

@ -414,7 +414,7 @@ wait_for_elasticsearch_status() {
local desiredStatus=${1:-green}
echo "Making sure elasticsearch is up..."
wget -O - --retry-connrefused --waitretry=1 --timeout=60 http://localhost:9200 || {
wget -O - --retry-connrefused --waitretry=1 --timeout=60 --tries 60 http://localhost:9200 || {
echo "Looks like elasticsearch never started. Here is its log:"
if [ -r "/tmp/elasticsearch/elasticsearch.pid" ]; then
cat /tmp/elasticsearch/log/elasticsearch.log