Fix SO MANY Ruby 1.8.7 issues in storeconfigs spec

When reading our export tarball back and mapping it to a hash, we were
trying to omit directories, which are indicated by a trailing slash.
Unfortunately, on Ruby 1.8.7, indexing into a string returns the integer
value of the character at that position. So we need to use
filename[-1,1] to tell Ruby to get a 1-character long substring instead.

Also, we had been reusing the variable (filename) containing the
location of our tarball as a block variable. In Ruby 1.8, this clobbers
the original variable outside the block, which caused us to be unable to
read the tarball later.

Finally, we were retrieving the content of the tarball using
String#lines. This returns an Enumerator, which for some reason in Ruby
1.8.7 won't implicitly convert to an array when passed as an argument to
zip, so we have to do it manually.
Define postgres settings using environment vars

In the past we were copying a magic from from tb-driver: local.clj that
contained all the information needed to connect to our test Postgres
database. tb-driver is being decommissioned, and its felt we need a better
way to manage this going forward.

This patch allows us to parameterize database tests, in particular the postgres
specific settings using environment variables. This way we can pass the
settings in from Jenkins using its special 'passwords as environment vars'
feature.

The default HSQLDB behaviour is kept if DBTEST_TYPE is not set, and local.clj
support is kept.

Signed-off-by: Ken Barber <ken@bob.sh>
Merge pull request #450 from kbarber/ticket/master/tb-driver-deprecation

Define postgres settings using environment vars
Properly package new Ruby files

These were being inadvertently left out of packaging, which naturally
caused it to fail.
Merge pull request #451 from nicklewis/package-storeconfigs-code

Properly package new Ruby files
(#17842) Return meaningful errors with invalid resource references

Normally this kind of thing isn't allowed:

    file { '/tmp/foo':
      ensure => present,
      require => Mymodule::foo['bar'],
    }

However puppet lets it slip by when someone uses create resources:

    create_resources('file', { '/usr/local/homeaway/api-favorites-ustst1-jdk/java' => { ensure => present, require => "Mymodule::foo[bar]" }})

With the puppetdb terminus, our relationship checks fail when this kind of
delcaration is used, however in the compiler terminus it slips through because
I believe the comparison is done all in capitals.

Since the parser stops it, it shouldn't be allowed. However, our behaviour is
confusing to the user. This patch adds a more meaningful error message to this
kind of failure, instead of stating that it is a relationship error we stop
earlier with an error about the format.

Signed-off-by: Ken Barber <ken@bob.sh>
Raise Puppet::Error consistently in catalog indirector

Previously we were just raise exceptions with no specific exception, this patch
makes the behaviour consistent across the file. Tests updated also.

Signed-off-by: Ken Barber <ken@bob.sh>
Fix the spelling of os_families in acceptance test
Install EPEL on redhat machines during acceptance tests

This is necessary for sqlite3.
Add crucial -y to sqlite3 package installs
Merge pull request #443 from nicklewis/disable-version-check

Disable version check
Merge pull request #442 from kbarber/ticket/master/17842-raise_correct_error_when_resourceref_invalid

(#17842) Return meaningful errors with invalid resource references
Fix spelling in rspec test

I had fixed 'capitalization' in the code, but not in the test.

Signed-off-by: Ken Barber <ken@bob.sh>
Merge pull request #452 from kbarber/maint/master/spelling_in_rspec_test

Fix spelling in rspec test
Backport remaining packaging fixes from master
Define postgres settings using environment vars

In the past we were copying a magic from from tb-driver: local.clj that
contained all the information needed to connect to our test Postgres
database. tb-driver is being decommissioned, and its felt we need a better
way to manage this going forward.

This patch allows us to parameterize database tests, in particular the postgres
specific settings using environment variables. This way we can pass the
settings in from Jenkins using its special 'passwords as environment vars'
feature.

The default HSQLDB behaviour is kept if DBTEST_TYPE is not set, and local.clj
support is kept.

Signed-off-by: Ken Barber <ken@bob.sh>
(#19241) Bump ActiveMQ dependency to 5.8.0 to solve upstream KahaDB issues

Two KahaDB related bugs have been solved in 5.7.0 that we care about:

1. db.data steady growth due to BTreeIndex page leak:

https://issues.apache.org/jira/browse/AMQ-3956

I believe we may have had an incident of this with #19066 but its hard to tell,
as it could have been due to bad index archiving as well.

2. Lack of tracking for db.data in systemUsage constraints:

https://issues.apache.org/jira/browse/AMQ-3973

Without this db.data is not included in size calculations, so any 'store-usage'
setting would not have taken into account this file as part of its calculation.

While most of what we care about is in 5.7.0, some follow up bugs to the changes
in that release were released with 5.8.0.

With 5.8.0 the jar activemq-core was decomposed so people could pull in the
parts they need depending on their solution, so our dependencies have changed
to accomodate this new organisation by pulling in only the jars: client, broker
and kahadb-store.

Obviously there are lots of other changes in 5.7.0 and 5.8.0 also:

5.7: https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12311210&version=12321258
5.8: https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12311210&version=12323282

Signed-off-by: Ken Barber <ken@bob.sh>
(#19239) Work around EOFException upon journal corruption

We discovered a bug in KahaDB that when the journal is corrupted there might be
a stray EOFException that is not caught by the KahaDB store, however upon
broker restart it corrects itself.

This patch will automatically restart the broker when that state is detected,
avoiding the need for an administrator to intervene.

This also adds a section to documentation to explain how to recover from
KahaDB corruption errors manually.

Signed-off-by: Ken Barber <ken@bob.sh>
Merge pull request #436 from kbarber/ticket/master/19239-eofexception_for_corrupt_kahadb_journal

(#19239) Work around EOFException upon journal corruption
Merge pull request #434 from kbarber/ticket/master/bump_amq_to_solve_storage_issues

(#19241) Bump ActiveMQ dependency to 5.8.0 to solve upstream KahaDB issues