Redmine#4718: fixing authentication state machine

Right now some command are forced to be read in correct order.
If agent is not following it it is NOT able to authenticate to server.
Switch to extended regular expressions in testall grepping.

Using extended regular expression via escaping doesn't work on neither
HP-UX nor AIX, so we need to switch grep into real extended mode. Also
has the benefit of making the regular expression more readable.
Merge pull request #1544 from pasinskim/old_proto_authentication_fix

Old proto authentication fix
Don't wipe out test directory before we have used its contents.

Fixes a "File not found" problem when trying to output the test log
for tests that suppress their failure.
Tag host-identifying variables as inventory.
cf-serverd: fix file-access path calculation, after symlink expansion

If we define an access rule to some symlink, like:
 "/var/cfengine/masterfiles" -> "/var/lib/cfengine/masterfiles"
then, pre-processing of the path will expand it to a longer string,
and thus "path_len" will be invalid.
Try to fix spurious 002.cf test failures.
Merge pull request #1559 from jimis/agent_protocol_version

Try to fix spurious 002.cf test failures.
Merge pull request #1557 from kacfengine/testall_workdir_fix

Don't wipe out test directory before we have used its contents.
Merge pull request #1558 from xrg/fix-server-access-promise

cf-serverd: fix file-access path calculation, after symlink expansion
File creation in 002.cf was in the wrong order.

I'm wondering how it was working all this time...
Merge pull request #1560 from jimis/agent_protocol_version

File creation in 002.cf was in the wrong order.
Merge pull request #1556 from kacfengine/extended_regex_testall

Switch to extended regular expressions in testall grepping.