cf_popen() generates an error message on distributions where ifconfig cannot be found during IPv6 discovery, affects RHEL 7

(cherry picked from commit b957ad6eb19c3fdb3c62940c61a24266f4fbcff3)
cf_popen() generates an error message on distributions where netstat et al cannot be found during monitoring probing, affects RHEL 7

(cherry picked from commit 6bebdcc08a1899a89f17a8a0e9e2b4904c61c1bb)
Add: Acceptance tests for warn only and mustache templating

Modified by: Kristian Amlie <kristian.amlie@cfengine.com>
(cherry picked from commit b4c5f6fd9ff7209896eb3b46a96d22b92616186d)
support dry-run for mustache templates. Redmine #6739
(cherry picked from commit 8924c1e66f7a2e531e28462107e5a0ac431fa989)
tag mustace acceptance tests with story_id 5535
(cherry picked from commit 832691fb6041651651a6d0be200f5ad50cd33a1b)
Fix broken variables tree iteration.

This fixes whole number of problems with iterating through RB tree
containing variables. Especially:
https://dev.cfengine.com/issues/6033
https://dev.cfengine.com/issues/6779

EvalContextVariableTableIteratorNew is calling VariableTableIteratorNew
which is not aware of variable indexes (VarRef->indices). Then while picking
value form tree to be iterator it might or might not contain indexes.
Randomly selecting variable with wrong index (and number of indexes)
is causing wrong behavior while iterating through list of variables.
VariableTableIteratorNext is checking indexes and returning variables
based on VariableTableIterator selected previously by
EvalContextVariableTableIteratorNew which is totally unreliable in case
of arrays.
(cherry picked from commit e2c8cd0f2fb9724e47330ecaca7fdd452a7bc60a)

Conflicts:

	libpromises/evalfunction.c
Fix relaying on order of keys returned by maparray.
(cherry picked from commit e4809443a5b959f3166ea718df87792380733712)
Merge pull request #2042 from pasinskim/3.6.x

Redmine#6779 cherries
Convert bogus strncat() - no pre-zeroed buffer - to strlcat().

(cherry picked from commit d829109fed815966fc78032d71ed38ecd962fc1f)
Fix very old code, if read is partial (n_read < toget) this would write garbage.

(cherry picked from commit 076d45c1216fd7694f1a18745e9bfd49272f84b5)

Conflicts:
	libcfnet/client_code.c
Make sure list is free'd in case of error. A bit cleanups as well.

(cherry picked from commit f62c0e43dba947b237da044278dd48319c604e80)

Conflicts:
	libcfnet/client_code.c
Exit with error if connection is closed before having received CFD_TERMINATOR.

(cherry picked from commit 7359e88682dfa60e13ec42edaacf27adced23b03)
If client fails to run time() send 0 in SYNCH packet. Server should then not fail, unless denybadclocks is set.

(cherry picked from commit 8208d1c3717c5944c534b9d1fa2bdeb67f028cf9)

Conflicts:
	libcfnet/stat_cache.c
Suppress failure on Solaris 11 due to process selection failure.

(cherry picked from commit 909aaa393cb61b72c050c9a1c9f4dd42fbc887e2)
Disable problematic acceptance test completely on Solaris 11.

(cherry picked from commit 3e660cabcf957f3dd4ecbd7465fae458b5227c94)
Fix fakeroot messing up a test by moving it to the unsafe area.

Fakeroot's file magic somehow interferes with the backgrounded
promises which in turn leads to stale processes lingering after the
test has finished.

(cherry picked from commit 1b9a58d50783e46e3a46790de76beff3a9a6b7b7)
Merge pull request #2043 from jimis/jimis_3.6.x_cherries

3.6.x cherry-picks
Revert "Fix fakeroot messing up a test by moving it to the unsafe area."

This reverts commit 1b9a58d50783e46e3a46790de76beff3a9a6b7b7.

Still doesn't work correctly, will disable the test instead.
(cherry picked from commit 99d43cc5da3d17bb045191f054da7f45af56eacc)
Disable test that has problems with stale processes.
(cherry picked from commit 48c3b486e6470a34055f1cc9e2e920dd53d4c4b0)
Make sure remake_outputs.pl fails when passed wrong options.

It was failing silently for a long time because a wrong argument was
erronously given to it.
(cherry picked from commit 6db447d011c4ac110e152062f5391b01758067ca)