Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test that Jayatana is ignored #13821

Merged
merged 1 commit into from
Oct 6, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 8 additions & 4 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ Vagrant.configure(2) do |config|
end
config.vm.define "vivid" do |config|
config.vm.box = "ubuntu/vivid64"
ubuntu_common config
ubuntu_common config, extra: <<-SHELL
# Install Jayatana so we can work around it being present.
[ -f /usr/share/java/jayatanaag.jar ] || install jayatana
SHELL
end
# Wheezy's backports don't contain Openjdk 8 and the backflips required to
# get the sun jdk on there just aren't worth it. We have jessie for testing
Expand Down Expand Up @@ -116,11 +119,11 @@ SOURCE_PROMPT
end
end

def ubuntu_common(config)
deb_common config, 'apt-add-repository -y ppa:openjdk-r/ppa > /dev/null 2>&1', 'openjdk-r-*'
def ubuntu_common(config, extra: '')
deb_common config, 'apt-add-repository -y ppa:openjdk-r/ppa > /dev/null 2>&1', 'openjdk-r-*', extra: extra
end

def deb_common(config, add_openjdk_repository_command, openjdk_list)
def deb_common(config, add_openjdk_repository_command, openjdk_list, extra: '')
# http://foo-o-rama.com/vagrant--stdin-is-not-a-tty--fix.html
config.vm.provision "fix-no-tty", type: "shell" do |s|
s.privileged = false
Expand All @@ -137,6 +140,7 @@ def deb_common(config, add_openjdk_repository_command, openjdk_list)
(echo "Importing java-8 ppa" &&
#{add_openjdk_repository_command} &&
apt-get update)
#{extra}
SHELL
)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,14 @@ start_elasticsearch_service() {
# su and the Elasticsearch init script work together to break bats.
# sudo isolates bats enough from the init script so everything continues
# to tick along
sudo -u elasticsearch /tmp/elasticsearch/bin/elasticsearch -d \
-p /tmp/elasticsearch/elasticsearch.pid
sudo -u elasticsearch bash <<BASH
# If jayatana is installed then we try to use it. Elasticsearch should ignore it even when we try.
# If it doesn't ignore it then Elasticsearch will fail to start because of security errors.
# This line is attempting to emulate the on login behavior of /usr/share/upstart/sessions/jayatana.conf
[ -f /usr/share/java/jayatanaag.jar ] && export JAVA_TOOL_OPTIONS="-javaagent:/usr/share/java/jayatanaag.jar"
# And now we can start Elasticsearch normally, in the background (-d) and with a pidfile (-p).
/tmp/elasticsearch/bin/elasticsearch -d -p /tmp/elasticsearch/elasticsearch.pid
BASH
elif is_systemd; then
run systemctl daemon-reload
[ "$status" -eq 0 ]
Expand Down