(maint) Refactor hpux_spec.rb to reduce test redundancy

Prior to this commit tests for IP facts had significant duplication making it difficult to maintain in the event fixtures change or version support is added or dropped.

This commit consolidates the common features of the tests, making it easier to identify where maintenance should occur as fixtures change.
fix use C as default locale.

Currently facter sets only LANG environment variable, this does not
work on systems that have LC_ALL configured, because LC_ALL
have higher priority than LANG variable.

So the correct procedure is to configure LC_ALL=C instead of LANG=C.
change resolution_spec to test LC_ALL locale environment  var.
should configure LANG and LC_ALL.

refer to the pull request:
https://github.com/puppetlabs/facter/pull/497
(#22060) Revert "Faster MAC address load on Linux via sysfs"

This reverts commit 4b926d0df3bb02a0492908fd13479e0a148ae19e.
Author: Daniel Pittman daniel@puppetlabs.com
Date: Thu Jul 19 19:11:46 2012

While running `puppet agent --no-daemonize --debug`, and IFF somewhere in the
code I have $DEBUG = true, then if I Ctrl-C to kill the agent I see the
following exception:

  Exception `NilClass' at .../facter/lib/facter/macaddress.rb:19 -
  undefined local variable or method `path' for :Facter::Util::Resolution

This is followed by an "infinite" recursion / stackoverflow which impeeds
debugging other issues.

The enhancement introduced in 4b926d0 never actually took effect because this
exception was normally ignored causing the new (faster) MAC detection code to
always return nil. Spec tests were never written for this enhancement nor for
its interaction with ifconfig based MAC detection. Thus the safest path forward
is to just revert the offending commit.
21760/22005 update preflight to delete old lib dir

In order to install in the top-level site_ruby directory, we need to clean out
any installs in the old site_ruby/1.8 location. We're doing this by setting a
variable in the package:apple task. If it's set, we remove all files there as
well as files in the new location.

While I'm here:
* update erb to strip leading and trailing spaces
* validate critical variables so a script is never generated with dangerous paths
* only target top-level files/dirs in lib, since we're doing rm -RF anyway
Handle when facter is embedded in a jar
Merge branch 'pull-506'

This closes GH-506
Merge pull request #509 from mzeren-vmw/fix/22060/undefined_path_in_macaddress

(#22060) Fix undefined path in macaddress.rb
Merge pull request #497 from lmello/master

(#22097) This enforces using english locale before running facter commands.
Use Dir.glob(), don't require rubygems or rake, use Dir.chdir as a block
(Bug #22163) remove hardcoded hostname dependencies

Prior to this commit, burji.puppetlabs.com was hardcoded in different
points of puppet. Since we're in the process of migrating off burji and
onto burji2, we realized this probably is not a good thing to have in
place. This commit removes that hardcoded dependency on burji.
Merge pull request #515 from melissaanne/maint/stable/re-144_rm-hardcoded-dependencies

(Bug #22163) remove hardcoded hostname dependencies
Merge remote-tracking branch 'origin/stable'

* origin/stable:
  (Bug #22163) remove hardcoded hostname dependencies
(#12116) Windows domain/fqdn error when no domain

This fixes an annoying issue that causes facter to throw errors when domain is
not properly configured or doesn't exist. With this fix, it will properly
return an empty domain and empty fqdn without errorring.

When moving up the chain to the less specific domain fact, added a
windows_hostname command and a check so that it also does not fail with path
not found errors.

Paired-with: Josh Cooper<josh@puppetlabs.com>
Merge remote-tracking branch 'rob/fix/stable/12116_domain_errors_windows' into stable

* rob/fix/stable/12116_domain_errors_windows:
  (#12116) Windows domain/fqdn error when no domain
Merge remote-tracking branch 'upstream/stable'

* upstream/stable:
  (#12116) Windows domain/fqdn error when no domain
(#12116) Don't break on the first interface

Previously, if there were multiple interfaces with IPEnabled on Windows,
we would always use the DNSDomain value from the first interface, even
if it was nil or empty.

This commit changes the domain fact to look for the first non-nil and
non-empty DNSDomain value.
Merge pull request #520 from joshcooper/ticket/stable/12116_first_non_nil_dnsdomain

(#12116) Don't break on the first interface
Merge remote-tracking branch 'upstream/stable'

* upstream/stable:
  (#12116) Don't break on the first interface