On 28/01/14 11:38, Edward Welbourne wrote:
>
> In tests/acceptance/10_files/09_insert_lines/021.cf:
>
> > +}
> > +
> > +#######################################################
> > +
> > +bundle agent init
> > +{
> > +  files:
> > +      "$(G.testfile).expected"
> > +      create => "true",
> > +      edit_line => init_expected,
> > +      edit_defaults => init_empty;
> > +
> > +  files:
> > +      "$(G.testfile).actual"
> > +      create => "true",
> > +      edit_line => init_file,
>
> Not sure I made myself clear. I understood the intent to apply the 
> same edit three times, twice to one file, once to the other.
> I was thinking that we only need one of the init_file or init_expected 
> bundles; just use one bundle three times, twice in init, on each file, 
> and once in test, applied to just one of the files.
> But I don't know the language well enough to know whether applying the 
> same edit_line bundle twice to a given file would skip the second time 
> because it knows it's been done once, thus failing to test what you 
> intended.
>
> —
> Reply to this email directly or view it on GitHub 
> <https://github.com/cfengine/core/pull/1351/files#r9222924>.
>

Yes, exactly. The idempotent lock would kick in, so we have to trick it 
with some different options.

M

-- 
Founder and CTO at CFEngine
Author of In Search of Certainty: The Science of our Information 
Infrastructure <http://markburgess.org/certainty.html>