This further abstracts some of the setup and teardown code so it can be
used for git-over-http tests.
It also moves the code that was originally added to the archive
state integration tests to create a local http server into
salt.support.helpers so that it can be more easily and portably used.
Allows patching more than one loader module.
Allows auto-loading the minion functions which will get namespaced with
the globals used to patch the loader module(s).
This avoids tracebacks when daemonizing code which is running under the XMLRunner:
```
23:22:46 Traceback (most recent call last):
23:22:47 File "/testing/salt/utils/process.py", line 644, in _run
23:22:47 return self._original_run()
23:22:47 File "/usr/lib64/python3.4/multiprocessing/process.py", line 93, in run
23:22:47 self._target(*self._args, **self._kwargs)
23:22:47 File "/testing/salt/client/mixins.py", line 464, in _proc_function
23:22:47 salt.utils.daemonize()
23:22:47 File "/testing/salt/utils/__init__.py", line 502, in daemonize
23:22:47 os.dup2(dev_null.fileno(), sys.stdout.fileno())
23:22:47 io.UnsupportedOperation: fileno
23:22:47 Process SignalHandlingMultiprocessingProcess-2:
23:22:47 Traceback (most recent call last):
23:22:47 File "/usr/lib64/python3.4/multiprocessing/process.py", line 254, in _bootstrap
23:22:47 self.run()
23:22:47 File "/testing/salt/utils/process.py", line 644, in _run
23:22:47 return self._original_run()
23:22:47 File "/usr/lib64/python3.4/multiprocessing/process.py", line 93, in run
23:22:47 self._target(*self._args, **self._kwargs)
23:22:47 File "/testing/salt/client/mixins.py", line 464, in _proc_function
23:22:47 salt.utils.daemonize()
23:22:47 File "/testing/salt/utils/__init__.py", line 502, in daemonize
23:22:47 os.dup2(dev_null.fileno(), sys.stdout.fileno())
23:22:47 io.UnsupportedOperation: fileno
```
We just keep a record of all the test case class attributes prior to
running the test and then just delete it afterwards.
We also issue a warning log message to tell the users how to cleanup
such references.